TPU as a device
Hugging Face has moved its libraries onto TorchTPU, a native PyTorch backend that makes a Google TPU “just another device”, it said on 20 October. Transformers, Diffusers and Kernels now run on TPU natively, and the company’s earlier bridge, Optimum TPU, is no longer required for Hugging Face models.
In practice that means loading a model in Transformers v5 with device_map="tpu", and sending a Diffusers pipeline to the accelerator with pipe.to("tpu"). Models run eagerly by default, with torch.compile optional, and TensorParallelConfig shards large models across chips while they load. Installation is pip install torch-tpu against the CPU PyTorch index, which avoids pulling the much larger CUDA build.
The route this replaces is PyTorch/XLA, which reached TPUs through lazy tensors and could trigger graph recompilations. The post does not explain how TorchTPU relates internally to PyTorch/XLA.

The numbers
The headline figures are for kernels rather than for the backend itself. On a TPU v6e-8 decoding at batch 64, Hugging Face reports the Hub’s ragged-dot kernel — a mixture-of-experts kernel from the Tokamax set, written in Pallas — running 21.5 times faster on Qwen3-30B-A3B and 12.8 times faster on Gemma 4 26B-A4B.
The image and video figures are more modest and come from a Cloud TPU v6e-4 at tensor parallelism 4, bf16, batch size 1. Qwen-Image-2.1 at 1024×1024 over 40 steps takes 3.5 seconds compiled against 8.0 seconds eager. A 1344×768 video run over 49 steps takes 188 seconds compiled against 262 eager. Compilation is not free: the first call at each image size pays a compile cost.
What still does not work
The post is specific about the gaps, which is the useful part. Of the tests that run on TPU, 96.5% pass. Nightly TPU continuous integration is still being set up, and integration with the Transformers CI dashboard is described as a work in progress. Some pipelines have no built-in tensor-parallel support and need a hand-written tp_plan. And of 34 issues reported against the TorchTPU repository, 19 are fixed.

Why it matters
The practical question for anyone renting accelerators is whether moving a workload off Nvidia costs engineering time. Until now, using TPUs from PyTorch meant a different execution model and, for Hugging Face models, a separate library. A native device backend removes that as a reason not to try, which makes the comparison a question of price and availability rather than of porting effort.
It is worth noting what this is not. These are Hugging Face’s own benchmark runs on Google’s hardware, published by Hugging Face. The 21.5× figure is a kernel speedup on one model at one batch size, not a claim about TPUs against GPUs overall.
What to watch
The number to follow is the test pass rate. 96.5% with nightly CI not yet running is an early-stage figure, and the gap between it and the CUDA path is the honest measure of how finished this is. The other is the issue count: 19 of 34 closed is a repository still in motion.