torch.compile for training
Open
Performance
t-pytdensor
- Dominant language
- Python
- Stars
- 2k
- Forks
- 561
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 145
Description
**Is your feature request related to a problem? Please describe.**
We should leverage torch.compile for training and fprop.
**Describe the solution you'd like**
Ideally we should be able to torch compile all calls to hf model (`train`, `get_logprobs`). The compile cost should be paid once at the init.
FYI there is a known issue with torch.compile + FSDP + BF16 and torch.compile was failing (with torch 2.5.1).
**Describe alternatives you've considered**
thunder compiler: https://github.com/Lightning-AI/lightning-thunder/ (we should investigate perf benefits of thunder over native compile)
Contributor guide
Assessment
This issue has not been assessed yet.