Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
a2f6d521
Unverified
Commit
a2f6d521
authored
Jul 30, 2020
by
Stas Bekman
Committed by
GitHub
Jul 30, 2020
Browse files
typos (#6162)
* 2 small typos * more typos * correct path
parent
f3065abd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
src/transformers/benchmark/benchmark_utils.py
src/transformers/benchmark/benchmark_utils.py
+3
-3
tests/test_benchmark.py
tests/test_benchmark.py
+2
-2
No files found.
src/transformers/benchmark/benchmark_utils.py
View file @
a2f6d521
...
...
@@ -165,7 +165,7 @@ class MemorySummary(NamedTuple):
- `sequential`: a list of `MemoryState` namedtuple (see below) computed from the provided `memory_trace`
by substracting the memory after executing each line from the memory before executing said line.
- `cumulative`: a list of `MemoryState` namedtuple (see below) with cumulative increase in memory for each line
obtained by summing repeted memory increase for a line if it's executed several times.
obtained by summing repe
a
ted memory increase for a line if it's executed several times.
The list is sorted from the frame with the largest memory consumption to the frame with the smallest (can be negative if memory is released)
- `total`: total memory increase during the full tracing as a `Memory` named tuple (see below).
Line with memory release (negative consumption) are ignored if `ignore_released_memory` is `True` (default).
...
...
@@ -310,7 +310,7 @@ def start_memory_tracing(
gpus_to_trace
:
Optional
[
List
[
int
]]
=
None
,
)
->
MemoryTrace
:
""" Setup line-by-line tracing to record rss mem (RAM) at each line of a module or sub-module.
See `../../examples/benchmark
s.py
for
a
usage example.
See `../../
../
examples/benchmark
ing/`
for usage example
s
.
Current memory consumption is returned using psutil and in particular is the RSS memory
"Resident Set Size” (the non-swapped physical memory the process is using).
See https://psutil.readthedocs.io/en/latest/#psutil.Process.memory_info
...
...
@@ -468,7 +468,7 @@ def stop_memory_tracing(
- `sequential`: a list of `MemoryState` namedtuple (see below) computed from the provided `memory_trace`
by substracting the memory after executing each line from the memory before executing said line.
- `cumulative`: a list of `MemoryState` namedtuple (see below) with cumulative increase in memory for each line
obtained by summing repeted memory increase for a line if it's executed several times.
obtained by summing repe
a
ted memory increase for a line if it's executed several times.
The list is sorted from the frame with the largest memory consumption to the frame with the smallest (can be negative if memory is released)
- `total`: total memory increase during the full tracing as a `Memory` named tuple (see below).
Line with memory release (negative consumption) are ignored if `ignore_released_memory` is `True` (default).
...
...
tests/test_benchmark.py
View file @
a2f6d521
...
...
@@ -86,7 +86,7 @@ class BenchmarkTest(unittest.TestCase):
self
.
check_results_dict_not_empty
(
results
.
time_inference_result
)
self
.
check_results_dict_not_empty
(
results
.
memory_inference_result
)
def
test_inference_no_model_no_architec
uter
s
(
self
):
def
test_inference_no_model_no_architec
ture
s
(
self
):
MODEL_ID
=
"sshleifer/tiny-gpt2"
config
=
AutoConfig
.
from_pretrained
(
MODEL_ID
)
# set architectures equal to `None`
...
...
@@ -119,7 +119,7 @@ class BenchmarkTest(unittest.TestCase):
self
.
check_results_dict_not_empty
(
results
.
time_train_result
)
self
.
check_results_dict_not_empty
(
results
.
memory_train_result
)
@
unittest
.
skipIf
(
torch_device
==
"cpu"
,
"Cant do half precision"
)
@
unittest
.
skipIf
(
torch_device
==
"cpu"
,
"Can
'
t do half precision"
)
def
test_train_no_configs_fp16
(
self
):
MODEL_ID
=
"sshleifer/tiny-gpt2"
benchmark_args
=
PyTorchBenchmarkArguments
(
...
...
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