TorchTPU is open-source software from Google and Meta's PyTorch team that lets PyTorch programs run directly on Google's TPU chips.
In plain words
TPUs are Google's own chips, built for the matrix maths at the heart of neural networks. Their software was made for TensorFlow and JAX first, so PyTorch users once had to go through PyTorch/XLA, which needed code changes and had no eager mode, where each line runs as soon as it is reached. TorchTPU adds the TPU as a normal PyTorch device, runs in eager mode first, and works with torch.compile. Hugging Face says Transformers and Diffusers now run on TPUs through it.
A quick example
Imagine a team that trains a model on GPUs with PyTorch and wants to try a TPU on Google Cloud. With TorchTPU installed, they move the model with a device name of tpu instead of cuda and run the same training script.
Where you'll meet it
- Training and serving PyTorch models on Google Cloud TPUs.
- Running Hugging Face models on TPUs without rewriting them.
Related
Sources
- DocsIntroducing TorchTPU, PyTorch · read 20 Oct 2026
- DocsHugging Face ❤️ TorchTPU: TPUs, Natively, Hugging Face · read 20 Oct 2026
- Docsgoogle-pytorch/torch_tpu, TorchTPU (GitHub) · read 20 Oct 2026
Checked by WhatIsAI against the sources above · 20 Oct 2026. A full five-minute explainer with a diagram may follow. Spotted an error? Report it.