articleApr 22, 2024Closed access

PyTorch 2: Faster Machine Learning Through Dynamic Python Bytecode Transformation and Graph Compilation

Alpha Omega Alpha Medical Honor Society · Menlo School · +3 more institutions

Indexed incrossref

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…

Citation impact

554
total citations
FWCI
253.59
Percentile
100%
References
19
Citations per year

Authors

49

Topics & keywords

Keywords
  • Computer science
  • Python (programming language)
  • Compiler
  • Programming language
  • Parallel computing
  • Bytecode
  • Speedup
  • Graph
No related works found for this paper.