Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
9863f7d2
Unverified
Commit
9863f7d2
authored
Mar 01, 2022
by
Patrick von Platen
Committed by
GitHub
Mar 01, 2022
Browse files
[Benchmark tools] Deprecate all (#15848)
* [Benchmark tools] Deprecate all * up
parent
df5a4094
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
0 deletions
+24
-0
docs/source/benchmarks.mdx
docs/source/benchmarks.mdx
+7
-0
src/transformers/benchmark/benchmark_args_utils.py
src/transformers/benchmark/benchmark_args_utils.py
+9
-0
src/transformers/benchmark/benchmark_utils.py
src/transformers/benchmark/benchmark_utils.py
+8
-0
No files found.
docs/source/benchmarks.mdx
View file @
9863f7d2
...
...
@@ -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.
...
...
src/transformers/benchmark/benchmark_args_utils.py
View file @
9863f7d2
...
...
@@ -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.
...
...
src/transformers/benchmark/benchmark_utils.py
View file @
9863f7d2
...
...
@@ -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."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment