parent
f3065abdb8
commit
a2f6d521c1
|
@ -165,7 +165,7 @@ class MemorySummary(NamedTuple):
|
||||||
- `sequential`: a list of `MemoryState` namedtuple (see below) computed from the provided `memory_trace`
|
- `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.
|
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
|
- `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)
|
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).
|
- `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).
|
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,
|
gpus_to_trace: Optional[List[int]] = None,
|
||||||
) -> MemoryTrace:
|
) -> MemoryTrace:
|
||||||
""" Setup line-by-line tracing to record rss mem (RAM) at each line of a module or sub-module.
|
""" 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
|
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).
|
"Resident Set Size” (the non-swapped physical memory the process is using).
|
||||||
See https://psutil.readthedocs.io/en/latest/#psutil.Process.memory_info
|
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`
|
- `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.
|
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
|
- `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)
|
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).
|
- `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).
|
Line with memory release (negative consumption) are ignored if `ignore_released_memory` is `True` (default).
|
||||||
|
|
|
@ -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.time_inference_result)
|
||||||
self.check_results_dict_not_empty(results.memory_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"
|
MODEL_ID = "sshleifer/tiny-gpt2"
|
||||||
config = AutoConfig.from_pretrained(MODEL_ID)
|
config = AutoConfig.from_pretrained(MODEL_ID)
|
||||||
# set architectures equal to `None`
|
# 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.time_train_result)
|
||||||
self.check_results_dict_not_empty(results.memory_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):
|
def test_train_no_configs_fp16(self):
|
||||||
MODEL_ID = "sshleifer/tiny-gpt2"
|
MODEL_ID = "sshleifer/tiny-gpt2"
|
||||||
benchmark_args = PyTorchBenchmarkArguments(
|
benchmark_args = PyTorchBenchmarkArguments(
|
||||||
|
|
Loading…
Reference in New Issue