arXiv:2610.24161cs.AIOct 2026

Manuscript Offprint

arXiv:2610.24161

TorchTPU - A Hybrid Eager/Compiled Architecture for Native PyTorch Execution on TPU

Claudio Basile, Michael Voznesensky, Gunhyun Park, Ben Wilson, Parker Holloway, Zhanyong Wan, Vlad Belous, Manish Khanna, Paul Ganssle, Kevin Gleason, Andrew Dame, Brendan Folie, Bhavya Bahl, Haifeng Jin, Pedro Goncalves Mokarzel, Arian Arfaian, Luke Boyer, Chi Zhang, Yiling Yuan, Adam Mainz, Aditya Patel, Huangze Tang, Jay Gan, Lizzie Liang, Will Froom, Tushar Agarwal, Karlo Basioli, Theotime Combes, Emilio Cota, Minos Papadopoulos, Tudor Pipernea, Yarong Mu, Qi Zhou, Yaoshiang Ho, Aleksey Vlasenko, Alexander Brauckmann, Ziyin Huang, Jack Oh, Jerry Hsu, Tanvi Bajpai, Jialei Chen, Wenjun Gu, Chintan Shah, Chris Chan, Sayce Falk, Chris Jones, Rob Torres, Kat Ko, Lee Howes, Freya Azad, Andi Gavrilescu, Joe Pamer, Bill Jia

Claudio Basile, Michael Voznesensky, Gunhyun Park, Ben Wilson, Parker Holloway, Zhanyong Wan, Vlad Belous, Manish Khanna, Paul Ganssle, Kevin Gleason, Andrew Dame, Brendan Folie, Bhavya Bahl, Haifeng Jin, Pedro Goncalves Mokarzel, Arian Arfaian, Luke Boyer, Chi Zhang, Yiling Yuan, Adam Mainz, Aditya Patel, Huangze Tang, Jay Gan, Lizzie Liang, Will Froom, Tushar Agarwal, Karlo Basioli, Theotime Combes, Emilio Cota, Minos Papadopoulos, Tudor Pipernea, Yarong Mu, Qi Zhou, Yaoshiang Ho, Aleksey Vlasenko, Alexander Brauckmann, Ziyin Huang, Jack Oh, Jerry Hsu, Tanvi Bajpai, Jialei Chen, Wenjun Gu, Chintan Shah, Chris Chan, Sayce Falk, Chris Jones, Rob Torres, Kat Ko, Lee Howes, Freya Azad, Andi Gavrilescu, Joe Pamer, Bill Jia

Google

10/16/26

Abstract—TorchTPU is an open-source collaboration between Google and Meta that introduces a native and principled PyTorch backend for Google TPUs. It enables seamless out-of-the-box model execution and TPU migration while delivering industry-competitive inference and training performance through eager execution optimizations, torch.compile integration, and native hardware acceleration.

I. INTRODUCTION

Google TPUs have been used very successfully, both within and outside Google, to train and deploy large ML models at massive scale. They are specifically designed for ML and provide significant benefits in terms of performance, energy, and cost. While TPUs have historically been associated with TensorFlow [2] and JAX [4] ecosystems, TorchTPU is a new effort initiated at Google in mid-2025, in collaboration with the PyTorch Team at Meta, to run PyTorch [26] natively on TPUs.

To program Google’s TPU [14] at a level below the Python framework, developers utilize the XLA compiler stack [18]. In 2020, Google introduced the first compiled version of PyTorch for TPU, PyTorch/XLA, based on Lazy Tensors [31]. While foundational, this initial integration struggled to keep pace with the rapid, community-driven evolution of PyTorch. Crucially, PyTorch/XLA required intrusive source-code modifications to explicitly define compilable regions, suffered from severe compile-time latency, lacked support for PyTorch’s native imperative ("eager") execution mode, and lagged in supporting emerging distributed computing primitives within the PyTorch ecosystem. In contrast with previous efforts such as PyTorch/XLA and TorchAX, which shoehorn PyTorch into JAX’s modus operandi, TorchTPU was built as a principled TPU backend for PyTorch: eager execution is a top priority, and existing PyTorch workloads run out of the box with trivial code changes (e.g., .to("cuda") → .to("tpu").

More specifically, as we started TorchTPU we deliberately formulated a set of principles to follow:

• PyTorch Citizenship:

– No JAX dependencies in the runtime;

  • Solid eager mode;

  • Torch.compile() based on Torch Dynamo (not Lazy Tensor) and with similar performance to JAX compile;

– Wide support for PyTorch distributed idioms (DDP [19], FSDP [35], DTensor [27], ...) by providing TPU collectives at the lowest level in the PyTorch stack (e.g. Process Group API);

– Seamless integration into the PyTorch ecosystem;

  • Community engagement.

• Focus on the User:

– Porting a workload to TPU should be as simple as changing model.to("cuda") to model.to("tpu"). (One cannot achieve peak TPU performance with that simple change, since a model's shapes, sharding and ops may be skewed toward a GPU architecture; however, the model should run out of the box.)

– Provide user-friendly and actionable messages for runtime/compiler errors;

– Integrate with the tools and frameworks that the PyTorch community already uses (e.g., torch.profiler, DTensor, Ray).

• Improve the State of the Art:

– Build a solution that can compete with PyTorch on GPUs for large scale workloads;

– Introduce a JIT compilation approach for eager execution, with runtime optimizations that can bridge the performance gap between op-by-op execution and compiled execution;

– Improve the TPU programming stack by introducing bounded dynamism, by avoiding XLA recompilation due to shape changes, and by exploring dynamic TPU kernels that can be precompiled ahead of time.

TorchTPU is in active development, it is used in production for both inference and training workloads for some of the largest Google Cloud customers, and can be found as an Open Source project at https://github.com/google-pytorch/torch_tpu. At the time of this writing, we have:

• Added support for both eager and compiled modes, including a new DeferAndFuse eager mode;

• Added support for ~450 Aten ops (skipping ops with structural or composite delegates), including forward and backward pass for all Core ATen ops required for the major deep learning architectures;

• Added ability to author custom kernels via JAX/Pallas [11] and via Helion [28] DSL;

• Validated out-of-box execution on the 5,000 most downloaded Hugging Face [33] models, including:

– LLMs: LLaMA, DeepSeek, Mistral, Gemma, Qwen, GPT, OPT, BLOOM, Falcon, StableML

– Audio/Speech: Whisper, Wav2Vec2, HuBERT, MMS

– Vision: DinoV2, SigLIP, CLIP, Swin Transformer & ConvNeXt, ViT, ResNet & DETR

– Text Encoders & Search: BERT, ALBERT & Electra, RoBERTa, DeBERTa, T5, MT5 & Flan-T5

• Validated DTensor-based sharding;

• Validated multi-host inference (vLLM and SGLang) and fine-tuning / training workloads (TorchTitan), with Ray-based orchestration;

• Validated integration with vLLM [16], SGLang [36], TorchTitan [20], Ray [21], and TorchRec [10].

In the remainder of this document we discuss key aspects of the TorchTPU architecture and some initial results.

References (33)