Google open-sources TorchTPU, a native PyTorch back end for TPUs(github.com)
376 points by ilreb 5 days ago | 89 comments
tl;dr: Google has open-sourced TorchTPU, a native PyTorch backend for TPUs that provides custom ATen kernel implementations, a compilation cache for XLA computations, and support for data and tensor parallelism. It integrates with torch.compile() for graph-mode execution and ships with examples for models like Llama, Qwen, ResNet, and minGPT. Available via pip (torch_tpu 0.2.0) or buildable from source with Bazel, requiring Python 3.11+.
HN Discussion:
  • ↑Related open-source efforts for other accelerators (Tenstorrent, AWS Trainium) complement this release
  • ↑First-party PyTorch support on TPUs is a long-awaited improvement over fighting with XLA
  • ~This signals TensorFlow's demise and raises questions about JAX's future relevance
  • •Questions about TPU availability and accessibility outside of Google Cloud
  • •Broader market implications: edge inference shift and TPU commoditization will disrupt AI investments