← Technology, Science & Infrastructure ▣ Distilled locally

Google Open-Sources TorchTPU, a Native PyTorch Backend for Cloud TPUs

By Asif Razzaq
October 20, 2026  ·  MarkTechPost ↗
Google Open-Sources TorchTPU, a Native PyTorch Backend for Cloud TPUs

Google has open-sourced TorchTPU, a native PyTorch backend for Cloud TPUs. It was co-developed with the PyTorch team at Meta and announced at PyTorch Conference 2026 on October 20, 2026. Existing PyTorch code targets a TPU through a standard torch.device("tpu"). TPUs now sit beside GPUs and CPUs as a native PyTorch device. Google team states that TorchTPU replaces PyTorch/XLA and recommends it for all new workloads.

TL;DR

What is TorchTPU?

TorchTPU is an open-source PyTorch backend from Google and Meta that runs PyTorch models natively on TPUs. It plugs in through PyTorch’s PrivateUse1 interface. Tensors are ordinary PyTorch tensors, with no subclasses or wrappers. It runs one process per device and preserves tensor views and in-place mutations.

The predecessor, PyTorch/XLA, recorded lazy-tensor graphs. Developers often added code to mark compilable regions. PyTorch/XLA also only supported pure SPMD code. TorchTPU also handles divergent MPMD execution.

How does TorchTPU execute PyTorch code?

TorchTPU ships 3 eager modes:

For peak speed, torch.compile(backend="tpu") captures the graph with TorchDynamo. It lowers through StableHLO to OpenXLA, which emits TPU machine code. Compiled executables are cached across processes, hosts and job restarts.

Custom Pallas kernels are callable as standard PyTorch functions. Prebuilt Tokamax kernels and Helion tile kernels also work.

Distribution uses the tpu_dist process group. It supports DDP, FSDP2 and DTensor, along with a topology-aware mesh for TPU interconnects.

How fast is TorchTPU?

All figures below are self-reported by Google and partners.

&&

What integrations ship with TorchTPU?

How does TorchTPU compare with PyTorch/XLA, TorchNeuron and JAX?

FeatureTorchTPU (repo)PyTorch/XLA (repo)TorchNeuron (AWS docs)JAX on TPU (Google docs)VendorGoogle + MetaGoogle / PyTorchAWSGoogleHardwareCloud TPU (v5e and later tested)Cloud TPUTrainium 2, Trainium 3Cloud TPUPyTorch devicetpuxlaneuronNot PyTorchBackend mechanismPrivateUse1Lazy-tensor graph recordingPrivateUse1Not applicableDefault executionEager (Strict, Debug, DeferAndFuse)Lazy tensorsEager plus torch.compileNot disclosedCompile pathTorchDynamo to StableHLO to XLAXLANeuron CompilerXLADistributed APIsDDP, FSDP2, DTensor, SPMD and MPMDPure SPMD onlyFSDP, DTensor, DDP, TPNot disclosedCustom kernelsPallas, Tokamax, HelionNot disclosedNKIPallasvLLM / SGLang servingvLLM-TorchTPU, SGLang-TorchTPUNot disclosedvLLM NeuronvLLM-JAX, SGLang-JAXStatusOpen source, v0.2.0Being replaced by TorchTPUPublic beta (Neuron 2.33)MaintainedLicenseApache 2.0Not disclosedNot disclosedNot disclosed

How do you install TorchTPU?

Install the package on a TPU VM, then pick the tpu device:

Copy CodeCopiedUse a different Browser
# pip install torch_tpu
import torch
device = torch.device("tpu")
x = torch.randn((4, 4), device=device)

The repo’s README pins torch_tpu==0.2.0 with the CPU PyTorch wheel index. Without it, pip pulls the CUDA build of torch. Full guides live at torchtpu.readthedocs.io.

Key Takeaways


Check out the GitHub repo, paper, docs and Google Cloud announcement. All credit goes to the researcher of this project. Also, feel free to follow us on Twitter and don’t forget to join our 150k+ML SubReddit and Subscribe to our Newsletter. Wait! are you on telegram? now you can join us on telegram as well.

Originally published by MarkTechPost ↗ · rebuilt here from its own full-text RSS feed · all rights remain with the publisher, please read and support them there.