Google and Meta Open-source TorchTPU to Bring Native PyTorch Support to Google TPUs

| Source: InfoQ AI/ML

Tags: TorchTPU, PyTorch, TPU, Google, Meta, Hugging Face

Google and Meta open-sourced TorchTPU, a native PyTorch backend for Google TPUs meant to replace clunky PyTorch/XLA with eager-first execution and small code swaps.

Details

InfoQ reports TorchTPU, an open-source Google–Meta project giving PyTorch a native TPU backend with eager and compiled paths, distributed support, and hardware-specific opts. Google says PyTorch/XLA (from 2020) forced intrusive compile regions, slow compiles, no true eager mode, and lagged distributed primitives. Migration guidance is mostly device="tpu" instead of cuda and tpu_dist instead of nccl, or torch.accelerator.current_accelerator. Three eager modes are described: strict, debug, and DeferAndFuse—the latter claimed 50%+ faster than strict eager with lower peak HBM. Google built a pipeline covering ~5,000 Hugging Face models across 500+ architectures on TPU gens from v5e. This matters for teams stuck between CUDA-centric PyTorch and TPU capacity.