AutoGraph: Imperative-style Coding with Graph-based Performance
Not on the map. Why?
Abstract (arXiv)
There is a perceived trade-off between machine learning code that is easy to write, and machine learning code that is scalable or fast to execute. In machine learning, imperative style libraries like Autograd and PyTorch are easy to write, but suffer from high interpretive overhead and are not easily deployable in production or mobile settings. Graph-based libraries like TensorFlow and Theano benefit from whole-program optimization and can be deployed broadly, but make expressing complex models more cumbersome. We describe how the use of staged programming in Python, via source code transformation, offers a midpoint between these two library design patterns, capturing the benefits of both. A key insight is to delay all type-dependent decisions until runtime, via dynamic dispatch. We instantiate these principles in AutoGraph, a software system that improves the programming experience of the TensorFlow library, and demonstrate usability improvements with no loss in performance compared to native TensorFlow graphs. We also show that our system is backend agnostic, and demonstrate targeting an alternate IR with characteristics not found in TensorFlow graphs.
Key facts. Cited by 9 papers in the map (data through 7 Oct 2026). First posted on arXiv 16 Oct 2018.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 4; 2022: 2; 2023: 0; 2024: 0; 2025: 2; 2026: 1.
9 papers.
- 2021tf.data: A Machine Learning Data Processing Frameworkcited by 40
- 2021Torch.fx: Practical Program Capture and Transformation for Deep Learning in Pythoncited by 38
- 2021LazyTensor: combining eager execution with domain-specific compilerscited by 11
- 2022Challenges in Migrating Imperative Deep Learning Programs to Graph Execution: An Empirical Studycited by 2
- 2021Using Python for Model Inference in Deep Learningcited by 1
- 2022Terra: Imperative-Symbolic Co-Execution of Imperative Deep Learning Programscited by 1
- 2025GraphMend: Code Transformations for Fixing Graph Breaks in PyTorch 2cited by 1
- 2025Speculative Automated Refactoring of Imperative Deep Learning Programs to Graph Executioncited by 0
- 2026stratum: A System Infrastructure for Massive Agent-Centric ML Workloadscited by 0
- 2026stratum: A System Infrastructure for Massive Agent-Centric ML Workloads3 Mar 2026
- 2025GraphMend: Code Transformations for Fixing Graph Breaks in PyTorch 217 Sep 2025
- 2025Speculative Automated Refactoring of Imperative Deep Learning Programs to Graph Execution7 Apr 2025
- 2022Challenges in Migrating Imperative Deep Learning Programs to Graph Execution: An Empirical Study24 Jan 2022
- 2022Terra: Imperative-Symbolic Co-Execution of Imperative Deep Learning Programs23 Jan 2022
- 2021Torch.fx: Practical Program Capture and Transformation for Deep Learning in Python15 Dec 2021
- 2021Using Python for Model Inference in Deep Learning1 Apr 2021
- 2021LazyTensor: combining eager execution with domain-specific compilers26 Feb 2021
- 2021tf.data: A Machine Learning Data Processing Framework28 Jan 2021