AutoGraph: Imperative-style Coding with Graph-based Performance
Dan Moldovan, James M Decker, Fei Wang, Andrew A Johnson and, Brian K Lee, Zachary Nado, D Sculley, Tiark Rompf, Alexander B, Wiltschko

TL;DR
AutoGraph introduces a staged programming approach in Python that combines the ease of imperative coding with the efficiency of graph-based execution, enhancing TensorFlow's usability without sacrificing performance.
Contribution
It presents AutoGraph, a system that transforms imperative Python code into optimized graph representations using source code transformation and dynamic dispatch.
Findings
AutoGraph improves TensorFlow programming experience.
No performance loss compared to native TensorFlow graphs.
Backend agnostic design enables targeting different IRs.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
