PyTorch 2: Faster Machine Learning Through Dynamic Python Bytecode Transformation and Graph Compilation
Abstract
This paper introduces two extensions to the popular PyTorch machine learning framework, TorchDynamo and TorchInductor, which implement the torch.compile feature released in PyTorch 2. TorchDynamo is a Python-level just-in-time (JIT) compiler that enables graph compilation in PyTorch programs without sacrificing the flexibility of Python. It achieves this by dynamically modifying Python bytecode before execution and extracting sequences of PyTorch operations into an FX graph, which is then JIT compiled using one of many extensible backends. TorchInductor is the default compiler backend for TorchDynamo, which translates PyTorch programs into OpenAI's Triton for GPUs and C++ for CPUs. Results show that TorchDynamo is able to capture graphs more robustly than prior approaches while adding minimal overhead, and TorchInductor is able to provide a 2.27× inference and 1.41× training geometric mean speedup on an NVIDIA A100 GPU across 180+ real-world models, which outperforms six other compilers. These extensions provide a new way to apply optimizations through compilers in eager mode frameworks like PyTorch.
Integrity signals
Registry
Cites
Statistics
Claims the paper makes
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
On an NVIDIA L20, MiniTriton outperforms PyTorch eager and torch.compile in geometric mean over its core benchmark suite.
“On an NVIDIA L20, MiniTriton outperforms PyTorch eager [89] and torch.compile[5] in geometric mean over its core benchmark suite.”
From Kimi K3: Open Frontier Intelligence (2026) · cites this paper as [5]
No citation lists for this paper
No citation lists for this paper yet — checked again daily.
References 19 · Cited by 737
- Authors
- Ansel, J., Yang, E., He, H., Gimelshein, N., Jain, A., Voznesensky, M., Bao, B., Bell, P., Berard, D., Burovski, E., Chauhan, G., Chourdia, A., Constable, W., Desmaison, A., DeVito, Z., Ellison, E., Feng, W., Gong, J., Gschwind, M., Hirsh, B., Huang, S., Kalambarkar, K., Kirsch, L., Lazos, M., Lezcano, M., Liang, Y., Liang, J., Lu, Y., Luk, C. K., Maher, B., Pan, Y., Puhrsch, C., Reso, M., Saroufim, M., Siraichi, M. Y., Suk, H., Zhang, S., Suo, M., Tillet, P., Zhao, X., Wang, E., Zhou, K., Zou, R., Wang, X., Mathews, A., Wen, W., Chanan, G., Wu, P., & Chintala, S.
- Affiliations
- Meta (United States) (US)
- OpenAI (United States) (US)
- Quansight (United States) (US)
- Intel (United States) (US)
- Quansight, Austin, TX, USA
- University of Michigan (US)
- ORCID
- Ansel, Jason
- Yang, Edward
- He, Horace
- Gimelshein, Natalia
- Jain, Animesh
- Voznesensky, Michael
- Bao, Bin
- Bell, Peter
- Berard, David
- Burovski, Evgeni
- Chauhan, Geeta
- Chourdia, Anjali
- Constable, Will
- Desmaison, Alban
- DeVito, Zachary
- Ellison, Elias
- Feng, Will
- Gong, Jiong
- Gschwind, Michael
- Hirsh, Brian
- Huang, Sherlock
- Kalambarkar, Kshiteej
- Kirsch, Laurent
- Lazos, Michael
- Lezcano, Mario
- Liang, Yanbo
- Liang, Jason
- Lu, Yinghai
- Luk, C. K.
- Maher, Bert
- Pan, Yunjie
- Puhrsch, Christian
- Reso, Matthias
- Saroufim, Mark
- Siraichi, Marcos Yukio
- Suk, Helen
- Zhang, Shunting
- Suo, Michael
- Tillet, Phil
- Zhao, Xu
- Wang, Eikan
- Zhou, Keren
- Zou, Richard
- Wang, Xiaodong
- Mathews, Ajit
- Wen, William
- Chanan, Gregory
- Wu, Peng
- Chintala, Soumith
- Venue
- Proceedings of the 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 2
- Publisher
- ACM
- Published
- 2024-04-27
- Pages
- 929-947
- OpenAlex
- W4394998532
- Cited by
- 737
- References
- 19
- Citations by year
- 2026: 272 · 2025: 375 · 2024: 90
- FWCI
- 224.30
- Type
- conference paper
- Language
- en
- Open access
- closed
- Locations
- International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS) (publishedVersion)
- Topics
- Physical Sciences › Computer Science › Hardware and Architecture › Parallel Computing and Optimization Techniques
- Physical Sciences › Computer Science › Artificial Intelligence › Logic, programming, and type systems
- Physical Sciences › Computer Science › Computer Vision and Pattern Recognition › Advanced Neural Network Applications
- Keywords
- just-in-time compilation, Triton, compiler backend, inference acceleration, training acceleration
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review