Skip to content

TorchTPU: Google open-sources native PyTorch for TPUs

TorchTPU runs PyTorch natively on Google TPUs, passing 98% of 4,917 Hugging Face models tested. PyTorch/XLA is deprecated and archived on November 15.

By Tech AI Wire Team

3 min read

XLinkedIn
The google-pytorch/torch_tpu repository on GitHub, showing its folder list, recent commits, 4,465 commits and a link to torchtpu.readthedocs.io.

By the numbers

of 4,917 Hugging Face models passed Google's first test tier
98%
PyTorch core operations implemented
~450
the date the PyTorch/XLA repository is archived
Nov 15

Google open-sourced TorchTPU on October 20, 2026, a backend that runs PyTorch code natively on its TPU chips. It matters because it replaces PyTorch/XLA, the older and harder route to TPUs, which will be archived on November 15. Google says existing code should move with little more than a change of device name.

What TorchTPU is

TPUs are the AI chips Google designs and rents out through Google Cloud. PyTorch is the most widely used library for building and training AI models. Until now, PyTorch reached TPUs through PyTorch/XLA, which turns a model into a compiled graph before it runs.

TorchTPU makes the TPU a regular PyTorch device instead. "Porting a workload to TPU should be as simple as changing model.to("cuda") to model.to("tpu")," the team writes in the PyTorch blog announcement. Google built it with Meta's PyTorch team, starting in mid-2025.

The project's GitHub repository lists release 0.2.0 on PyPI, the Apache 2.0 license and Python 3.11 or newer. Crypto Briefing reports that the release spans four repositories and was unveiled at the PyTorch Conference. The blog names them as TorchTPU, vLLM-TorchTPU, SGLang-TorchTPU and TorchTitan, which cover the core backend, two serving engines and a training library.

How it runs code

TorchTPU implements about 450 ATen operations, the core math functions that every PyTorch model is built from. Code runs line by line in "eager" mode by default, as normal PyTorch does. The blog describes three eager modes:

ModeHow to turn it onWhat it does
StrictDefaultRuns each operation as written
DebugTORCH_TPU_LAUNCH_BLOCKING=1Waits for each operation, for easier debugging
DeferAndFuseTORCH_TPU_DEFER_AND_FUSE=1Batches operations together; "50% or more faster than Strict Eager"

For more speed, torch.compile(backend="tpu") turns a model into one TPU program. Custom chip code can be written with JAX's Pallas or with Helion. The blog lists integrations with vLLM, SGLang, TorchTitan, Ray and TorchRec. The blog also says some of the largest Google Cloud customers already use TorchTPU in production.

How well models run

Google's own tests are the only numbers so far. The blog reports these results:

TestResult
Hugging Face models run4,917, from 500+ model families
Passed the first test tier98% (4,821 of 4,917)
Output matched a GPU97% (638 of 657 checked)
Qwen3 235B training on 64 TPU v7 chips1,828 tokens/s in PyTorch, vs 1,937 in Google's JAX stack

Crypto Briefing cites Google's figure of 52% model FLOPs utilization when training Qwen 3 8B on up to 8,192 TPU v7x chips. That measure is the share of a chip's peak math the model actually uses.

PyTorch/XLA is being retired

The PyTorch/XLA repository now opens with a notice: "This project is deprecated and replaced by TorchTPU." It adds that the repository "will be archived on November 15, 2026," which makes it read-only. Its advice is to "start new PyTorch TPU workloads with TorchTPU and migrate existing PyTorch/XLA workloads." The last stable install it lists pins torch and torch_xla to 2.8.0.

The same day, Amazon's TorchNeuron backend for its Trainium chips entered public beta and dropped the same XLA approach. Both cloud providers now treat their AI chips as ordinary PyTorch devices.

What this means for developers

TorchTPU makes a TPU one more device string, which puts Google's chips in the same price comparison as GPUs.

  • Plan your PyTorch/XLA exit now. After November 15 the repository takes no fixes. Pin torch_xla 2.8.0 for running jobs, and test TorchTPU on a v6e machine, which the README suggests as the easiest start.
  • Check the 2% first. Google's own test still fails about one model in fifty. Run a short training or inference job on your exact model before planning a move.
  • Budget time for custom CUDA kernels. Hand-written GPU code does not carry over. It needs rewriting in Pallas or Helion, so price that work in.
  • Pin the version. This is release 0.2.0. Lock it in requirements files and recheck the results after each upgrade.
  • Benchmark it yourself. Every speed figure here comes from Google. Compare cost per token on your own workload, against GPUs and other clouds' chips.

Sources

  1. Introducing TorchTPU - PyTorch Blog
  2. google-pytorch/torch_tpu - GitHub
  3. pytorch/xla - GitHub
  4. Google open-sources TorchTPU to bring native PyTorch support to its TPUs - Crypto Briefing

Related articles

The weekly digest

One email every Friday with the week's top stories from all six desks: AI, dev tools, coding, the tech industry, startups and what's next. Free, no spam.

Unsubscribe anytime with one click.