Hugging Face ❤️ TorchTPU: TPUs, Natively
- ID
- 37462
- Status
- summarized
- Published
- 20 Oct 2026, 8:00 AM
- Fetched
- 21 Oct 2026, 12:41 AM
- Provider
- Hugging Face Blog
- Category
- developer-ai
- Original URL
- https://huggingface.co/blog/hf-torchtpu
- Source URL
- https://huggingface.co/blog/feed.xml
Summary
- Score
- 5.5
- Created
- 21 Oct 2026, 12:41 AM
- Tags
- Audience
- developersai_ml_learners
What happened
Hugging Face published a walkthrough of TorchTPU, a native PyTorch backend that makes TPUs just another device target instead of requiring torch_xla or JAX. Transformers v5, Diffusers and Kernels now run natively on TPU — loading a model is `device_map="tpu"` (example given: Qwen/Qwen3.5-9B), and Optimum TPU is no longer required for inference or training. Install is a single command on a TPU VM: `pip install torch-tpu --extra-index-url https://download.pytorch.org/whl/cpu`, where the extra index pulls the smaller CPU build of torch instead of the much larger CUDA build.
Why it matters
If you have ever skipped TPUs because your stack was PyTorch and the torch_xla path meant lazy tensors, surprise graph recompilations and hard-to-reason-about debugging, this removes that migration tax: one pip flag and one `device_map` value, no Optimum TPU layer. The decision it changes is concrete — when comparing accelerator pricing for training or serving, TPUs are now a realistic option for an existing Hugging Face + PyTorch codebase, so benchmark against them before defaulting to GPUs. There is no Malaysia-specific hook in this post; treat it purely as an infrastructure-cost lever, and note the announcement shows only 3 upvotes, so real-world maturity is unproven.
Discussion angle
Has anyone actually moved a workload off CUDA for cost reasons — and does the eager-mode, no-lazy-tensor story hold up in practice, or does torch.compile on TPU just move the debugging pain somewhere else?