State of torch.compile for training (August 2025) : ezyang’s blog
The purpose of this post is to sum up, in one place, the state of torch.compile for training as of August 2025. Nothing in here isn't something you might not already know about from elsewhere on the Internet, but we rarely put everything together in one place. The target audience for this document are teams who are evaluating the use of torch.compile for large scale training runs. First, the basics. torch.compile (also known as PT2) is a compiler for PyTorch eager programs for both inference and training workloads. Speedups from 1.5-2x compared to eager code are typical, and torch.compile also makes it possible to do global optimizations for memory (e.g., automatic activation checkpointing) and distributed communications (e.g., async tensor parallelism). The headline functionality of torch.compile is a decorator you can attach to a function to compile it: Here are some non-functional properties of compile which are important to know: For large scale training runs, torch.compile faces s
State of torch.compile for training (August 2025) August 13, 2025 The purpose of this post is to sum up, in one place, the state of torch.compile for training as of August 2025. Nothing in here isn't something you might not already know about from elsewhere on the Internet, but we rarely put everything together in one place. The target audience for this document are teams who are evaluating the use of torch.compile for large scale training runs. First, the basics. torch.compile (also known as PT2) is a compiler for PyTorch eager programs for both inference and training workloads. Speedups from
Explore this link on the map →saved by
related reading
- UW PLSE | How does torch.compile work?uwplse.org
- PyTorch internals : ezyang's blogblog.ezyang.com
- A friendly introduction to machine learning compilers and optimizershuyenchip.com
- TPU Deep Divehenryhmko.github.io
- the bug that taught me more about PyTorch than years of using it | Elana Simonelanapearl.github.io
- 👨👩👧👦 Distributed Training - Composerdocs.mosaicml.com
- Accelerating Generative AI with PyTorch II: GPT, Fast – PyTorchpytorch.org
- Making Deep Learning go Brrrr From First Principleshorace.io
- Current and New Activation Checkpointing Techniques in PyTorch – PyTorchpytorch.org
- Composer2.pdfcursor.com
- TorchScript: Tracing vs. Scripting - Yuxin's Blogppwwyyxx.com
- Mirage Persistent Kernel: A Compiler and Runtime for Mega-Kernelizing Tensor Programsarxiv.org