Why it matters

Memory profiling prevents OOM crashes. Critical for large LLM training.

Advertisement

The architecture

Snapshot allocator; view timeline; find peak.

Attribute to modules and tensors.

Memory profiling flowSnapshot allocatortorch.cudaTimelinepeak vs steadyAttributemodules, tensorstorch.cuda.memory._record_memory_history + snapshot for detailed trace
Memory profiling flow.
Advertisement

How it works end to end

torch.cuda.memory._record_memory_history.

Export snapshot.

View in memory viz.