Google open-sources TorchTPU, letting PyTorch models run natively on TPUs
Google open-sources TorchTPU, a native PyTorch back end for TPUs
Google has released TorchTPU, an open-source PyTorch backend for Tensor Processing Units. It includes custom ATen kernels, a compilation cache for XLA computations, and support for distributed training via data and tensor parallelism. The project integrates with torch.compile() and ships examples for models like Llama, Qwen, ResNet, and minGPT. Installable via pip (version 0.2.0) or built from source with Bazel, it requires Python 3.11+ and is licensed under Apache 2.0.
This project provides a PyTorch backend for Google's Tensor Processing Units (TPUs), enabling users to run PyTorch models and operations on TPU devices.
- pcmoritz
For people interested in this: I've been working on an open-source libtpu implementation for https://tenstorrent.com/ accelerators as a side project, it can already run most of torchtpu, see https://github.com/pcmoritz/libtt (based on the tenstorrent software stack). It shows all the things involved in lowering torch to tile based accelerators.
- amelius
Soon to be written by AI anyway, so they might as well release it now.
- npalli
Interesting, Amazon doing the same for AWS Trainium.
- dalemhurley
Google and Apple are going to move consumers and ordinary business users to edge inference. This is more disruptive to the upcoming IPOs than most investors understand.
- fancyfredbot
Cool! XLA is pretty good + potentially a better compiler infrastructure than inductor which will lead to improved performance on all hardware.
Also I guess this is the final nail in the coffin of Tensorflow.