Hugging Face ❤️ TorchTPU: TPUs, Natively
Hugging Face ❤️ TorchTPU: TPUs, Natively
TorchTPU adds TPU as a native PyTorch backend, letting Transformers, Diffusers and Kernels run on TPU by sending models to "tpu" instead of going through torch_xla or JAX, and Optimum TPU is no longer required. The post shows loading a model with device_map="tpu", running Diffusers pipelines with pipe.to("tpu") plus optional torch.compile, and using Pallas kernels from the Kernels Hub, with reported speedups of 21.5× on Qwen3-30B-A3B and 12.8× on Gemma 4 26B-A4B at batch size 64. It also reports that 96.5% of tests run on TPU pass, with 34 issues filed on the TorchTPU repo and 19 already fixed.
It documents a new native PyTorch TPU backend and concrete usage patterns for the Hugging Face stack, useful for readers weighing TPU support.
Source: Hugging Face Blog · huggingface.co