Google released TorchTPU as an open source project on October 20, giving PyTorch developers a simpler way to run applications on its Tensor Processing Units. TechCrunch reports that the release follows Amazon’s TorchNeuron announcement, as both cloud providers try to attract applications built for Nvidia GPUs.
For developers, the useful change is concrete. Hugging Face’s integration lets Transformers and Diffusers users select TPU as a device while keeping their familiar model code. Its examples show a shorter migration path, alongside test failures and performance differences that still call for workload-specific trials.
What changes in existing applications
Previously, PyTorch users typically reached TPUs through PyTorch/XLA. Hugging Face describes problems with delayed execution, graph recompilation and debugging in that setup. Its Optimum TPU package helped run Hugging Face models there. With TorchTPU, the company says Transformers and Diffusers can run on TPUs without Optimum TPU.
TorchTPU adds a native PyTorch backend, with distributed training support, TPU-tuned Pallas kernels and integration with torch.compile. Hugging Face’s installation command runs on a TPU virtual machine and uses the CPU build of PyTorch, avoiding the larger CUDA package.
In its Transformers example, Hugging Face loads Qwen3.5-9B with device_map="tpu", then sends tokenized inputs to the same device. The model runs in eager mode by default. Developers can also compile it or use a distributed setup.
For Diffusers, the example moves a Stable Diffusion 3.5 Medium pipeline with pipe.to("tpu"). Compiled mode adds a compile call. The first invocation compiles the graph, and later calls with the same image size reuse it. Hugging Face also describes splitting supported models across chips with TensorParallelConfig when they are too large for one chip.
Those examples make a small device-setting change plausible for supported Hugging Face applications. They give developers specific models and execution modes to try before moving a broader application.
What the published results establish
Hugging Face reports that 96.5% of the Transformers tests that run on TPU pass. It says it has reported 34 issues to TorchTPU, with 19 fixed, and is working toward nightly TPU testing. That pass rate describes the tests run, rather than the share of all PyTorch applications that will work.
Its Diffusers examples also separate eager and compiled execution. On a Cloud TPU v6e-4, Qwen-Image-2.1 generated a 1024-by-1024 image in 3.5 seconds compiled versus 8.0 seconds eager. The setup used four chips, bfloat16 precision, batch size one and 40 steps.
That comparison measures two execution modes on TPU. Neither supplied source gives a matched Nvidia GPU cost comparison for this workload. The faster compiled result alone cannot establish savings from leaving Nvidia hardware.
Sources
- TechCrunch: Google has joined Amazon in attacking Nvidia’s stronghold with AI app developers
- Hugging Face: Hugging Face ❤️ TorchTPU: TPUs, Natively. Integration examples, test results and performance figures. Lead illustration credited to Hugging Face, from this post.





