Unverified Commit 9863f7d2 authored by Patrick von Platen's avatar Patrick von Platen Committed by GitHub
Browse files

[Benchmark tools] Deprecate all (#15848)

* [Benchmark tools] Deprecate all

* up
parent df5a4094
......@@ -12,6 +12,13 @@ specific language governing permissions and limitations under the License.
# Benchmarks
<Tip warning={true}>
Hugging Face's Benchmarking tools are deprecated and it is advised to use external Benchmarking libraries to measure the speed
and memory complexity of Transformer models.
</Tip>
[[open-in-colab]]
Let's take a look at how 🤗 Transformers models can be benchmarked, best practices, and already available benchmarks.
......
......@@ -16,6 +16,7 @@
import dataclasses
import json
import warnings
from dataclasses import dataclass, field
from time import time
from typing import List
......@@ -121,6 +122,14 @@ class BenchmarkArguments:
},
)
def __post_init__(self):
warnings.warn(
f"The class {self.__class__} is deprecated. Hugging Face Benchmarking utils"
" are deprecated in general and it is advised to use external Benchmarking libraries "
" to benchmark Transformer models.",
FutureWarning,
)
def to_json_string(self):
"""
Serializes this instance to a JSON string.
......
......@@ -23,6 +23,7 @@ import linecache
import os
import platform
import sys
import warnings
from abc import ABC, abstractmethod
from collections import defaultdict, namedtuple
from datetime import datetime
......@@ -617,6 +618,13 @@ class Benchmark(ABC):
else:
self.config_dict = {model_name: config for model_name, config in zip(self.args.model_names, configs)}
warnings.warn(
f"The class {self.__class__} is deprecated. Hugging Face Benchmarking utils"
" are deprecated in general and it is advised to use external Benchmarking libraries "
" to benchmark Transformer models.",
FutureWarning,
)
if self.args.memory and os.getenv("TRANSFORMERS_USE_MULTIPROCESSING") == 0:
logger.warning(
"Memory consumption will not be measured accurately if `args.multi_process` is set to `False.` The flag 'TRANSFORMERS_USE_MULTIPROCESSING' should only be disabled for debugging / testing."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment