[Benchmark tools] Deprecate all (#15848)

* [Benchmark tools] Deprecate all

* up
This commit is contained in:
Patrick von Platen
2022-03-01 11:26:20 +01:00
committed by GitHub
parent df5a4094a6
commit 9863f7d228
3 changed files with 24 additions and 0 deletions

View File

@@ -12,6 +12,13 @@ specific language governing permissions and limitations under the License.
# Benchmarks # 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]] [[open-in-colab]]
Let's take a look at how 🤗 Transformers models can be benchmarked, best practices, and already available benchmarks. Let's take a look at how 🤗 Transformers models can be benchmarked, best practices, and already available benchmarks.

View File

@@ -16,6 +16,7 @@
import dataclasses import dataclasses
import json import json
import warnings
from dataclasses import dataclass, field from dataclasses import dataclass, field
from time import time from time import time
from typing import List 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): def to_json_string(self):
""" """
Serializes this instance to a JSON string. Serializes this instance to a JSON string.

View File

@@ -23,6 +23,7 @@ import linecache
import os import os
import platform import platform
import sys import sys
import warnings
from abc import ABC, abstractmethod from abc import ABC, abstractmethod
from collections import defaultdict, namedtuple from collections import defaultdict, namedtuple
from datetime import datetime from datetime import datetime
@@ -617,6 +618,13 @@ class Benchmark(ABC):
else: else:
self.config_dict = {model_name: config for model_name, config in zip(self.args.model_names, configs)} 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: if self.args.memory and os.getenv("TRANSFORMERS_USE_MULTIPROCESSING") == 0:
logger.warning( 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." "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."