TechAILatest.newsTrackers

Open-source PyTorch backend for TPUs

TorchTPU

TorchTPU is an open-source PyTorch backend for Google's Tensor Processing Units that makes TPU a native PyTorch device. It provides ATen kernels for TPU, a compilation cache, torch.compile integration and distributed training support, and replaces the older PyTorch/XLA route for running Hugging Face transformers and diffusers models on Cloud TPUs.

Last reviewed 28 Oct 2026 · by Google

Facts at a glance

DeveloperGoogle (google-pytorch on GitHub)
TypePyTorch device backend for TPUs
LicenseApache 2.0
Python supportPython 3.11 and later source
Installpip install torch-tpu on a TPU VM source
Hugging Face supportTransformers, Diffusers and Kernels run natively, announced 20 October 2026 source

Questions people ask

How is TorchTPU different from PyTorch/XLA?
TorchTPU adds TPU as a native PyTorch device that runs in eager mode by default, while PyTorch/XLA used lazy tensors that could trigger graph recompilations, according to Hugging Face.
Do I still need Optimum TPU to run Hugging Face models on TPUs?
No. Hugging Face says Optimum TPU is no longer required to run models with Transformers and Diffusers now that TorchTPU provides native support.