Google and Meta have released TorchTPU, an open-source PyTorch backend designed to run models natively on Cloud TPUs. The system integrates via the PyTorch PrivateUse1 interface, allowing developers to use standard PyTorch tensors without wrappers or subclasses. It supports one process per device while maintaining tensor views and in-place mutations.
Unlike its predecessor PyTorch/XLA, which relied on lazy-tensor graphs and required manual marking of compilable regions, TorchTPU supports divergent MPMD execution. The backend utilizes torch.compile with the tpu backend, capturing graphs via TorchDynamo. These are lowered through StableHLO to OpenXLA to generate TPU machine code, with executables cached across hosts and job restarts.
The platform includes support for custom Pallas kernels, as well as prebuilt Tokamax and Helion tile kernels, which function as standard PyTorch calls. For distributed training, TorchTPU uses the tpu_dist process group. It provides compatibility with DDP, FSDP2, and DTensor, alongside a topology-aware mesh for TPU interconnects.
Users can install the library via pip, with the current version pinned at 0.2.0. The setup requires the CPU PyTorch wheel index to avoid pulling CUDA-based builds. Documentation and implementation guides are available on the project's ReadTheDocs page.





