From a2f6d521c1d7ebd7e079bc62bee014c8d00b2547 Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Thu, 30 Jul 2020 14:18:27 -0700 Subject: [PATCH] typos (#6162) * 2 small typos * more typos * correct path --- src/transformers/benchmark/benchmark_utils.py | 6 +++--- tests/test_benchmark.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/transformers/benchmark/benchmark_utils.py b/src/transformers/benchmark/benchmark_utils.py index 757669e2b..99a76bd7f 100644 --- a/src/transformers/benchmark/benchmark_utils.py +++ b/src/transformers/benchmark/benchmark_utils.py @@ -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 repeated 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/benchmarks.py for a usage example. + See `../../../examples/benchmarking/` for usage examples. 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 repeated 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). diff --git a/tests/test_benchmark.py b/tests/test_benchmark.py index fb8e3ae24..127068ed9 100644 --- a/tests/test_benchmark.py +++ b/tests/test_benchmark.py @@ -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_architecuters(self): + def test_inference_no_model_no_architectures(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(