News Developer Tools

Google makes TorchTPU open source for native PyTorch on TPUs

Google's TorchTPU, built with Meta's PyTorch team, lets existing PyTorch workloads run on Google TPUs with minimal code changes and torch.compile support.

Google has released TorchTPU, its software stack for running PyTorch code natively on Google TPUs, as open source on GitHub. Google announced the release at PyTorch Conference 2026. TPUs are Google's custom chips for AI workloads, and they now join GPUs and CPUs as a native option for PyTorch, the widely used machine learning framework.

Google says TorchTPU was co-developed with the PyTorch team at Meta. It lets existing PyTorch workloads run on TPUs with minimal code changes, using familiar APIs. Developers can debug models in eager mode, which runs code step by step, then switch to torch.compile to improve TPU utilization and reduce memory overhead.

Google also worked with Hugging Face so popular open-weight models on the Hugging Face Hub run natively on TorchTPU. In Transformers v5, deploying a model to TPUs takes one setting, device_map="tpu". The Diffusers library runs on TPUs with eager mode, torch.compile and tensor parallelism, which spreads large generative models across several accelerators. Google built nightly testing pipelines for the Transformers suite on TPU infrastructure.

Google says TorchTPU is integrated with serving engines including vLLM and SGLang, paired with Kubernetes-based routing across TPUs and GPUs to improve throughput per dollar.

Source: Google Cloud announcement.