# Hugging Face 推出 TorchTPU，让 PyTorch 原生运行于 Google Cloud TPU

> 全新 TorchTPU 软件包可让 PyTorch 代码直接在 Google Cloud TPU 上运行，无需使用 torch_xla 或 Optimum TPU。

Oossa · 2026-10-20 · https://oossa.com/zh/hugging-face-releases-torchtpu-for-native-pytorch-on-google-cloud-tpus

Hugging Face 宣布推出 TorchTPU。这是一款原生 PyTorch 后端，可像使用其他设备一样使用 TPU。只需运行一条 pip 命令即可安装；随后将 device_map="tpu"，就能在 TPU 上加载 Transformers 或 Diffusers 模型。该软件包还包含针对 TPU 调优的 Pallas 内核、分布式训练支持，以及可进一步提升速度的 torch.compile 集成。使用 Hugging Face 模型运行 TPU 时，不再需要 Optimum TPU。

## 事实

- 发布日期：2026-10-20（“Tue Oct 20 2026”）
- 软件包安装命令：pip install torch-tpu --extra-index-url https://download.pytorch.org/whl/cpu

## 为什么重要

PyTorch 开发者现在无需借助额外框架即可使用 Google Cloud TPU，从而简化大规模训练和推理。

## 来源与参考

1. [Hugging Face ❤️ TorchTPU: TPUs, Natively](https://huggingface.co/blog/hf-torchtpu) – Hugging Face, 2026-10-20
2. [Introducing TorchTPU](https://pytorch.org/blog/introducing-torchtpu/) – PyTorch
3. [Google unveils TorchTPU in a push to break Nvidia’s stranglehold on AI compute](https://siliconangle.com/2026/10/20/google-unveils-torchtpu-in-a-push-to-break-nvidias-stranglehold-on-ai-compute/) – SiliconANGLE, 2026-10-21

最后更新: 2026-10-21
