LazyTensor: combining eager execution with domain-specific compilers
Alex Suhan, Davide Libenzi, Ailing Zhang, Parker Schuh, Brennan Saeta,, Jie Young Sohn, and Denys Shabalin

TL;DR
LazyTensor enables the use of domain-specific compilers with the ease and expressivity of eager ML frameworks, supporting multiple hardware and language platforms without sacrificing performance.
Contribution
It introduces LazyTensor, a technique that combines eager execution with domain-specific compiler IRs, overcoming the language subset problem and demonstrating broad applicability.
Findings
Supports PyTorch on Cloud TPUs
Used by Swift for TensorFlow across CPUs, GPUs, and TPUs
Demonstrates generality across tensor implementations and hardware
Abstract
Domain-specific optimizing compilers have demonstrated significant performance and portability benefits, but require programs to be represented in their specialized IRs. Existing frontends to these compilers suffer from the "language subset problem" where some host language features are unsupported in the subset of the user's program that interacts with the domain-specific compiler. By contrast, define-by-run ML frameworks-colloquially called "eager" mode-are popular due to their ease of use and expressivity, where the full power of the host programming language can be used. LazyTensor is a technique to target domain specific compilers without sacrificing define-by-run ergonomics. Initially developed to support PyTorch on Cloud TPUs, the technique, along with a substantially shared implementation, has been used by Swift for TensorFlow across CPUs, GPUs, and TPUs, demonstrating the…
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.
Taxonomy
TopicsParallel Computing and Optimization Techniques · Advanced Neural Network Applications · Adversarial Robustness in Machine Learning
