chuchichaestli.utils.memory
Measuring the memory a device has allocated.
Functions:
| Name | Description |
|---|---|
peak_memory_allocated |
Return a device's peak allocated bytes since its reset, or |
reset_peak_memory |
Start a device's peak-memory counter afresh, if it keeps one. |
peak_memory_allocated
peak_memory_allocated(
device: torch.device | str,
) -> int | None
Return a device's peak allocated bytes since its reset, or None if unmeasured.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device
|
torch.device | str
|
The device to measure. |
required |
Source code in src/chuchichaestli/utils/memory.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 | |
reset_peak_memory
reset_peak_memory(device: torch.device | str) -> bool
Start a device's peak-memory counter afresh, if it keeps one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device
|
torch.device | str
|
The device to measure. |
required |
Source code in src/chuchichaestli/utils/memory.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |