posts

Hugging Face puts TPUs one device string away

Running a Hugging Face model on a Google TPU used to mean porting your PyTorch code to torch_xla or learning JAX. In Hugging Face's post on TorchTPU, dated October 20, 2026, the team says Transformers, Diffusers and the Kernels library now run on Google's native PyTorch back end, so loading a model onto a TPU means passing device_map="tpu". Optimum TPU, the adapter Hugging Face built to work around the old path, is no longer needed for Transformers and Diffusers.

Of the Transformers tests that run on TPU, 96.5% pass. The failures turned into 34 issues on the TorchTPU repo, 19 already fixed, and surfaced bugs in Transformers itself, such as one in StaticCache. A nightly TPU run on the public CI dashboard is still in progress. The headline kernel result (decoding 21.5x faster on Qwen3-30B-A3B at batch size 64) is measured against Hugging Face's own default implementation, not against a GPU, so it shows the kernel matters and says nothing about which chip to rent.

For teams whose stack is PyTorch from top to bottom, choosing an accelerator has mostly meant choosing NVIDIA. If that last 3.5% keeps shrinking, moving a workload to TPU becomes a pricing exercise instead of a porting project, and that changes the conversation in a GPU contract negotiation. TPUs only run on Google Cloud, so this adds a second supplier rather than independence. A credible second supplier is still more than most procurement teams have today.

Source: huggingface.co/blog/hf-torchtpu

← all posts