All posts

Blog

Google open-sources TorchTPU to run PyTorch natively on its TPU chips

FindAmNow
GoogleGoogle CloudTPUPyTorchMetaAI chipsopen source

Google has released TorchTPU, an open-source backend built with Meta that lets PyTorch code run directly on Google's TPUs with small changes. It comes with TPU support for Hugging Face, vLLM, SGLang, TorchTitan and Ray, and follows Amazon's similar TorchNeuron release for Trainium.

Google has released TorchTPU as open source. It is a backend that lets developers run PyTorch, the most widely used toolkit for building AI models, directly on Google's own AI chips, called Tensor Processing Units (TPUs). Google announced it on 20 October 2026 at PyTorch Conference 2026, and says it built the software together with the PyTorch team at Meta.

What TorchTPU does

Most AI software today is written with NVIDIA's graphics chips (GPUs) in mind. TPUs have mostly been programmed through Google's own JAX and TensorFlow tools. An earlier bridge, PyTorch/XLA, existed, but the TorchTPU team's own blog post says it needed intrusive code changes, compiled slowly and did not support PyTorch's normal step-by-step ("eager") mode.

TorchTPU is meant to make the TPU a normal PyTorch device. According to the PyTorch blog post, moving a model can be as simple as changing .to("cuda") to .to("tpu"). The team adds that this gets a model running but will not reach peak TPU speed on its own, because models built for GPUs often need tuning.

Google says developers can debug in eager mode and then use torch.compile for production speed, and that PyTorch's standard tools for spreading work across many chips are supported. It is installed with pip install torch_tpu.

Tools that work with it

Google says it worked with several open-source projects so that common tools run on TPUs:

  • Hugging Face: in Transformers v5, sending a model to a TPU is now a matter of passing device_map="tpu", according to Google.
  • vLLM and SGLang, two popular serving engines, have new native PyTorch backends for TPUs, built with Inferact and RadixArk.
  • llm-d 1.0, released with Red Hat and IBM, for running inference across large fleets of TPUs and GPUs on Kubernetes.
  • TorchTitan, VeRL and Ray for large-scale training, reinforcement learning and job orchestration.

Google also said its on-device tool LiteRT (formerly TensorFlow Lite) is joining the PyTorch ecosystem, and that a TPU agent suite to help move PyTorch models onto TPUs is in early preview on GitHub.

Company claims on performance

The TorchTPU team says that, at the time of writing, about 98% of roughly 4,900 popular Hugging Face models it tested ran without crashing, and 97% of a smaller set matched GPU results numerically. Google says training through TorchTitan reached up to 52% model FLOPs utilisation on Qwen 3 8B and scaled across up to 8,192 of its Ironwood TPUs. The team also says TorchTPU is already used in production by some of Google Cloud's largest customers. These figures come from Google and have not been independently verified.

The wider contest

TechCrunch reported that the release puts Google alongside Amazon in trying to weaken NVIDIA's hold over AI developers. Amazon announced its own PyTorch backend, TorchNeuron, for its Trainium chips a day earlier. TechCrunch noted that Google says it worked directly with Meta, Hugging Face and serving-engine makers, but also cautioned that developers will not abandon NVIDIA hardware simply because moving away has become easier.

The project is not finished. The PyTorch blog lists work still under way, including better support for changing input sizes, more operators and low-precision formats for future TPU generations.

Why it matters

When the same PyTorch code can run on NVIDIA, Amazon and Google chips with small changes, companies can more easily compare prices and move workloads between clouds. For start-ups and research teams, including those in Africa who rent compute rather than buy it, more real choice of hardware could mean lower costs over time. Teams should benchmark their own models first, since Google's numbers come from its own tests.

Sources

Source