PyTorch Memory Trace Visualizer
v0.10.0Upload a PyTorch memory snapshot pickle file to visualize memory usage and gain insights
Upload Memory Snapshot
Drag and drop your PyTorch memory snapshot or profiler trace (.pickle, .pkl, or .json) here, or click to browse
JSON files: up to 1GB • Pickle files: no size limit • For larger JSON files, use scripts/extract_memory_data.py
How to generate a memory snapshot
Add this code to your PyTorch script:
import torch
# Enable memory history tracking
torch.cuda.memory._record_memory_history(
enabled=True,
max_entries=100000 # Adjust based on your needs
)
# Your PyTorch code here
model = YourModel()
# ... training or inference code ...
# Save the memory snapshot
torch.cuda.memory._dump_snapshot("memory_snapshot.pickle")
# Or export as JSON (for large snapshots)
torch.cuda.memory._dump_snapshot("memory_snapshot.json")The snapshot will be saved to your current directory. Upload it here to visualize memory usage patterns.