cuda_record_memory_history {torch} | R Documentation |
Enable Recording of Memory Allocation Stack Traces
Description
Enables recording of stack traces associated with memory allocations, allowing users to identify the source of memory allocation in CUDA snapshots.
Usage
cuda_record_memory_history(
enabled,
context = "all",
stacks = "all",
max_entries = 1
)
Arguments
enabled |
Character or
|
context |
Character or
|
stacks |
Character. Defines the stack trace frames to include. Options:
|
max_entries |
Integer. The maximum number of allocation/free events to retain. |
Details
Alongside tracking stack traces for each current allocation and free event, this function can also keep a historical log of all allocation and free events.
Use cuda_memory_snapshot()
to retrieve recorded information. Visualization
can be performed using pytorch.org/memory_viz.
Value
None; function invoked for side effects.
Examples
if (torch_is_installed()) {
## Not run:
cuda_record_memory_history(enabled = 'all', context = 'all', stacks = 'all', max_entries = 10000)
## End(Not run)
}