You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update on "[graph_trainer] Add torch.no_grad() and graph-based SAC to traced execution"
Execute traced graph under torch.no_grad() since it already contains
explicit backward ops (from torch.autograd.grad traced by make_fx).
Without this, PyTorch builds a redundant autograd graph keeping all
forward intermediates alive via grad_fn references.
Adds SAC option on aot_fx_trace on GraphTrainer.
Adds option to dump the peak memory from CUDA caching allocator.
Adds similar test as test_bitwise_equivalency.py for peak memory
Here is the run comparison between eager and aot_fx_trace with SAC
<img width="1114" height="455" alt="Screenshot 2026-04-14 at 1 18 41 PM" src="https://github.com/user-attachments/assets/bf4ffdd3-8783-47be-ac64-32587787591f" />
Llama3B 8b with dp=4 tp=2 on 10 step run before SAC
<img width="1728" height="585" alt="Screenshot 2026-04-14 at 10 39 41 PM" src="https://github.com/user-attachments/assets/d8a1fe31-bd91-41a4-8e6f-a0e738cc2b76" />
Llama3B 8b with dp=4 tp=2 on 10 step run after SAC
<img width="1728" height="552" alt="Screenshot 2026-04-14 at 10 39 26 PM" src="https://github.com/user-attachments/assets/273b6e65-c2a3-473b-a2db-53b67a95be3a" />
For Llama3 8B, from the step-30 rank0 memory snapshots:
- No SAC:
- end-of-step memory_allocated() = 14.99 GiB
GiB
- end-of-step memory_reserved() = 22.75 GiB
- SAC:
- end-of-step memory_allocated() = 14.99 GiB
GiB
- end-of-step memory_reserved() = 16.6 GiB
Deepseek3 16B before SAC
<img width="1728" height="600" alt="Screenshot 2026-04-14 at 10 54 31 PM" src="https://github.com/user-attachments/assets/61180fa4-debd-4c10-834e-e4936cfbd67e" />
Deepseek3 16B after SAC
<img width="1728" height="578" alt="Screenshot 2026-04-14 at 10 58 30 PM" src="https://github.com/user-attachments/assets/3e3b4e71-e13f-43b7-9404-ad9a0a04f75c" />
[ghstack-poisoned]
0 commit comments