← AI news

Hugging Face adds native TPU support through TorchTPU

Brief by TrendCue AI · Dates refer to the original sources.

Hugging Face says its Transformers, Diffusers and Kernels libraries now run natively on Google TPUs through TorchTPU, a PyTorch backend. The integration removes the need for Optimum TPU when running Transformers and Diffusers models on the accelerators.

A native PyTorch backend

Previously, PyTorch users ran TPU workloads through PyTorch/XLA. Hugging Face says TorchTPU adds TPU as a PyTorch backend, with distributed training and torch.compile support. In Transformers v5, developers can load a model using device_map="tpu". Google says TorchTPU, co-developed with Meta’s PyTorch team, is open source on GitHub.

Hugging Face · Google Cloud

Diffusion workflows and constraints

Diffusers supports eager execution, compilation and tensor parallelism across TPU chips. Its documentation says compiled execution requires static shapes: the first call compiles, and a new image height or width triggers another compilation. The guide’s main version requires installation from source.

Hugging Face · Hugging Face

Testing remains in progress

Hugging Face says it is working to add nightly TPU testing for Transformers and publish the results. It reports that 96.5% of tests that run on TPU pass, while acknowledging that support is still a work in progress.

Hugging Face

Original sources

Original websites and X posts open in a new tab.

Community vote