What problem does it solve?
Debugging GPU out-of-memory failures and peak-memory regressions in Megatron Bridge training requires interpreting raw PyTorch CUDA memory snapshot pickles, which are opaque event logs that cannot be compared across runs without tooling.
Core Features & Use Cases
- Snapshot Overview: Parse a snapshot pickle to inspect allocator settings, segment totals, fragmentation, baseline memory, and top allocation sources by throughput.
- Two-Run Comparison: Diff two snapshots side-by-side and attribute the peak memory gap to specific source code locations, with automatic fallback to full-trace replay when step annotations are absent.
- Interactive Timeline: Generate a standalone HTML Plotly timeline that overlays two runs on one axis, with wall-clock and event-index x-axis modes.
- Use Case: You ran the same recipe with two parallelism configs and run B peaks 20 GiB higher; run compare_snapshots.py on both rank-0 pickles to see exactly which allocations (e.g., router_forward, mlp_forward) account for the difference.
Quick Start
Ask the assistant to analyze your Megatron Bridge memory snapshot pickle, for example to compare snapshot_0.pickle files from two runs and explain which allocations cause the peak memory difference.