读见

PyTorch Conference 2026:Google 与 Meta 开源 TorchTPU,为 TPU 提供原生 PyTorch 支持

原题PyTorch Conference 2026: Google and Meta Open-Source TorchTPU for Native PyTorch on TPUs

约 4 分钟约 963 字原文英文已翻译

推荐理由TorchTPU 把 TPU 接入 PyTorch 原生调度,帮助模型团队评估多硬件部署选择,区分直接运行与获得最佳性能所需的调优。

读前速览

4 个要点

Google 与 Meta 在 PyTorch Conference 2026 上开源了 TorchTPU,为 Google TPU 提供原生 PyTorch 后端,简化了模型迁移;与此同时 AWS 的相关发布也凸显出行业正加速迈向硬件多元化与原生 PyTorch 集成。

  1. Google 与 Meta 开源 TorchTPU,为 Google TPU 建立原生 PyTorch 后端。

    TorchTPU 通过 PrivateUse1 扩展点直接接入 PyTorch 的底层调度器,取代了旧的 PyTorch/XLA 桥接方案,只需更改设备目标即可完成模型移植,并支持与 Hugging Face、vLLM、SGLang 和 TorchTitan 的开箱即用集成。

  2. 一行代码改动即可立即运行,但要达到 TPU 峰值性能仍需额外优化。

    虽然将 model.to('cuda') 改为 model.to('tpu') 能让模型立刻跑起来,但针对 GPU 调优的形状、分片和算子等架构因素意味着团队必须投入进一步优化,并借助 Google 的 TPU 智能体套件等工具才能实现最大吞吐量。

  3. AWS 同期推出 TorchNeuron,凸显全行业推动硬件多元化与原生 PyTorch 支持的趋势。

    与 Google 的举措类似,AWS 面向 Trainium 芯片发布了公开测试版的 TorchNeuron,表明云厂商正通过 PyTorch 扩展来标准化定制硬件的集成,不过分析师指出优化层与厂商锁定问题依然存在。

  4. 智能体 token 消耗的爆发式增长,正推动对灵活、多芯片基础设施的需求。

    大会上公布的主题演讲数据显示,智能体的 token 消耗相对人类消耗已急剧攀升,给数据中心带来了巨大压力,需要支持高吞吐、硬件无关的机器学习工作负载。

完整摘要

在 PyTorch Conference North America 2026 上,Google 与 Meta 开源了 TorchTPU——一个面向 Google 张量处理单元(TPU)的原生 PyTorch 后端,旨在取代此前侵入性较强的 PyTorch/XLA 惰性张量桥接方案。TorchTPU 通过 PrivateUse1 扩展点直接接入 PyTorch 的底层调度器,开发者只需将 model.to('cuda') 改为 model.to('tpu') 即可完成模型移植,Hugging Face 模型、vLLM、SGLang 与 TorchTitan 均可开箱即用。Google 分享了扩展性测试结果,显示在超过 8,000 块 TPU 芯片时性能仍接近线性增长,同时推出了 TPU 智能体套件以帮助弥合优化差距。与此同时,AWS 宣布面向 Trainium 芯片的 TorchNeuron 进入公开测试阶段,反映出全行业向硬件多元化发展的趋势。不过,分析师与社区讨论指出,尽管这些后端提供了共同语言,优化层与硬件锁定仍掌握在厂商手中,实际落地仍需细致调优并依赖硬件可得性。

查看原文

在圣何塞举行的 2026 年 PyTorch 北美大会上,Google 和 Meta 开源了 TorchTPU,这是面向 Google 张量处理单元(TPU)的原生 PyTorch 后端。Meta 软件工程师 Zongwei Zhou 在 10 月 21 日的主题演讲中表示,Meta 于 2016 年创建了 PyTorch,并计划借助 TorchTPU 将规模更大的 LLM 工作负载迁移到 TPU 上。At PyTorch Conference North America 2026 in San Jose, Google and Meta open-sourced TorchTPU, a native PyTorch backend for Google's Tensor Processing Units (TPUs). Meta, which created PyTorch in 2016, plans to move larger-scale LLM workloads onto TPUs with it, Meta software engineer Zongwei Zhou said in the October 21 keynotes.

TorchTPU 取代了 PyTorch/XLA——这是一个于 2020 年推出的惰性张量桥接层。据公告称,它“需要对源代码进行侵入式修改”。新后端旨在让模型移植变得简单到只需将 model.to("cuda") 改为 model.to("tpu")。Google Cloud 在公告中写道:“借助 TorchTPU,TPU 与 GPU 和 CPU 一样,成为 PyTorch 的原生选项。”该公告由核心机器学习/人工智能工程副总裁 Bill Jia 共同撰写。TorchTPU replaces PyTorch/XLA, a lazy-tensor bridge from 2020 that, according to the announcement, "required intrusive source-code modifications." The new backend aims to make porting a model as simple as changing model.to("cuda") to model.to("tpu"). "With TorchTPU, TPUs join GPUs and CPUs as a native option for PyTorch," Google Cloud wrote in its announcement, co-authored by Bill Jia, VP of engineering for Core ML/AI.

Jia 与 Zhou 共同发表了主题演讲《智能体时代的工作负载可移植性:将原生 PyTorch 带到云端 TPU》,此前的两场演讲则勾勒了需求背景。PyTorch 基金会执行董事 Mark Collier 表示,推理已超越训练,成为数据中心最大的工作负载,由此产生了“对 token 难以置信的巨大需求”。Collier 将社区的目标描述为:打造开源软件,让模型能够“在任何云端的任何芯片上运行,并连接到任何智能体”。基金会的主题演讲幻灯片展示了这一市场变化之迅速:DeepSeek 的 Flash 模型在 37 天内成本降低了 60%,Kimi K3 则在相同硬件上于 33 天内提速了 68%。Jia presented the keynote "Workload Fungibility in the Agentic Era: Bringing Native PyTorch to Cloud TPUs" with Zhou, after two talks that framed the demand. Mark Collier, executive director of the PyTorch Foundation, said inference has overtaken training as the largest data center workload, creating "an incredible hunger for tokens." Collier described the community's goal as open source software for models that "run on any chip in any cloud and connect to any agent." The Foundation's keynote slides showed how fast that market moves: DeepSeek's Flash model became 60% cheaper in 37 days, and Kimi K3 ran 68% faster on the same hardware in 33 days.

Agentic AI Foundation 执行董事 Mazin Gilbert 表示,智能体的令牌消耗量于 2026 年 2 月 6 日超过了人类。此后,智能体的令牌消耗量增长了 14 倍,而人类则增长了 2.8 倍。Gilbert 说:“所以,这基本上是一条正在爆炸式增长的曲棍球杆曲线。”从业者在重复使用这些数字前应先核实其适用范围,因为公开数据仅来自一个平台:OpenRouter。Mazin Gilbert, executive director of the Agentic AI Foundation, said agent token consumption passed human consumption on February 6, 2026. It has since grown 14-fold, against 2.8-fold for humans. "So this is basically a hockey stick that's exploding," said Gilbert. Practitioners should check the scope before reusing those numbers, because the public data comes from a single platform, OpenRouter.

发言者表示,由于 TorchTPU 接入了 PyTorch 的底层分发器,Hugging Face 模型无需额外配置即可使用。vLLM 和 SGLang 推理引擎可原生运行,而 TorchTitan 支持密集模型、混合专家模型和扩散模型的大规模训练。Ray 和 llm-d 可在 Kubernetes 上跨主机扩展 TPU 工作负载。共有四个代码仓库开源:TorchTPU、vLLM-TorchTPU、SGLang-TorchTPU 和 TorchTitan。Because TorchTPU plugs into PyTorch's low-level dispatcher, the speakers said, Hugging Face models worked with it out of the box. The vLLM and SGLang inference engines run natively, and TorchTitan supports dense, mixture-of-experts, and diffusion models for training at scale. Ray and llm-d scale TPU workloads across hosts on Kubernetes. Four repositories were open sourced: TorchTPU, vLLM-TorchTPU, SGLang-TorchTPU, and TorchTitan.

Jia 展示了超过 8,000 颗 TPU 芯片后近乎线性的扩展能力,随着集群规模增大,每颗芯片的吞吐量基本保持稳定。Google 公布的结果包括一次在 8,192 颗 TPU v7x 芯片上运行 Qwen3 235B 混合专家模型的测试,模型 FLOPs 利用率为 28%。公告坦言,这一行代码的改动只是一个起点:Jia showed near-linear scaling past 8,000 TPU chips, with per-chip throughput holding roughly constant as the cluster grew. Google's published results include a Qwen3 235B mixture-of-experts run on 8,192 TPU v7x chips at 28% model FLOPs utilization. The announcement is candid that the one-line change is only a starting point:

仅靠这一简单改动无法达到 TPU 的峰值性能,因为模型的形状、分片方式和运算可能更适配 GPU 架构;不过,模型应该可以开箱即用。

One cannot achieve peak TPU performance with that simple change, since a model's shapes, sharding and ops may be skewed toward a GPU architecture; however, the model should run out of the box.

谷歌对这一调优短板的解决方案是增加智能体。Jia 在演讲结尾宣布推出 TPU 智能体套件,该套件目前已在 GitHub 上开放预览,可接入编码框架,自动完成入门引导、诊断和性能调优。Google's answer to that tuning gap is more agents. Jia closed by announcing the TPU agent suite, now in preview on GitHub, which plugs into coding harnesses to automate onboarding, diagnostics, and performance tuning.

Zhou 表示,Meta 的 PyTorch 团队与 Google 共同开发了 TorchTPU,“旨在让 TPU 成为 PyTorch 的一等原生目标”,并指出生产环境对性能、可靠性和可维护性的需求。“这一切都是开源的,今天就已开放使用,而这仅仅是个开始,”Zhou 说。Meta 的 PyTorch 工程总监 Jana van Greunen 在 Google Cloud 的公告中阐述了开发动机:Zhou said Meta's PyTorch team co-developed TorchTPU with Google "to make TPU a first-class native PyTorch target," citing production needs for performance, reliability, and maintainability. "All of this is open source and available today and it is just a beginning," Zhou said. Jana van Greunen, director of PyTorch engineering at Meta, gave the motivation in Google Cloud's announcement:

在 Meta,推动 AI 前沿发展需要极大规模的算力和丰富多样的硬件。我们不能受限于单一的硬件架构。

At Meta, advancing the frontier of AI requires immense compute scale and deep hardware diversity. We cannot be constrained by a single hardware architecture.

谷歌并非唯一一家。10 月 20 日,AWS 将 TorchNeuron——面向其 Trainium 芯片的原生 PyTorch 后端——推入公开测试阶段,唯一需要改动的代码是 `.to('neuron')`。这两个后端都通过 PrivateUse1 注册,这是 PyTorch 为自定义硬件提供的扩展接口。TorchNeuron 的首个版本仍有不足:《The Next Web》报道称,它尚不支持动态输入形状,并且跳过了约 22,000 项 PyTorch 测试。在为 Forkast 撰写的一篇分析中,Blair Hayes 指出,锁定只是转移了,并未消失:Google was not alone. AWS put TorchNeuron, a native PyTorch backend for its Trainium chips, into public beta on October 20, with .to('neuron') as the only code change. Both backends register through PrivateUse1, PyTorch's extension point for custom hardware. TorchNeuron's first release has gaps: The Next Web reported that it does not yet support dynamic input shapes and skips about 22,000 PyTorch tests. In an analysis for Forkast, Blair Hayes argued that the lock-in has moved rather than disappeared:

虽然 PyTorch 扩展点为开发者提供了通用语言,但优化层和供应层仍牢牢掌握在供应商手中。

While the PyTorch extension point provides a common language for developers, the optimization and supply layers remain firmly under vendor control.

在 Hacker News 上,TorchTPU 发布帖获得了 379 点,欣慰之余也夹杂着实际层面的疑虑。“我还记得以前得费尽周折对付 XLA,才能让 PyTorch 在 TPU 上运行;看来我们终于有官方支持了!”一位评论者写道。其他人则问到底去哪儿才能买到 TPU。一位曾考察过 Google 本地部署 TPU 的公司员工态度更为冷淡:“我们评估过,但决定继续使用 Nvidia,至少再等一代产品。”On Hacker News, where the TorchTPU launch thread reached 379 points, relief mixed with practical doubts. "I remember the days when you had to fight XLA to make PyTorch run on TPUs, it seems we finally got first-party support!" wrote one commenter. Others asked where they could buy a TPU at all. A commenter whose company had looked at Google's on-premises TPUs was cooler: "We've evaluated them but decided to stick with Nvidia, at least for one more generation."

可移植性也是数据中心之外的一大卖点。在一场关于使用 ExecuTorch 部署机器人策略的专题分享中,Meta 的 Anthony Shoumikhin 和 Jacob Szwejbka 表示,策略从训练到部署在设备上都可以保持使用 PyTorch,无需经过转换工具链。同一套量化方案和算子图可以运行在多种目标平台上,从 NVIDIA Jetson 上的 TensorRT 到 Intel 上的 OpenVINO。Portability was also the pitch below the data center. In a session on deploying robot policies with ExecuTorch, Meta's Anthony Shoumikhin and Jacob Szwejbka argued that policies can stay in PyTorch from training to the device, with no conversion stack. The same quantization and operator graphs run on targets from TensorRT on NVIDIA Jetson to OpenVINO on Intel.

训练分论坛量化了成本方面的数据。在介绍 Miles 强化学习框架时,RadixArk 的 Yueming Yuan 表示,将两次对数概率计算融合到一个内核中,使这一步的速度提升了 10 倍以上。在一次大型运行中,Delta 更新将每次权重同步的数据传输量从 62 GB 降至不到 1 GB。The training breakouts put numbers on the cost side. Presenting the Miles reinforcement learning framework, Yueming Yuan of RadixArk said fusing two log-probability computations into one kernel made that step more than 10 times faster. Delta updates cut the data moved per weight sync from 62 GB to under 1 GB in one large run.

用于通过强化学习训练智能体的开放工具贯穿了多场讨论。Anyscale 的 SkyRL 将训练、推理和环境分离,并通过 Ray 对它们进行编排。Hugging Face 的 OpenEnv 于 10 月 22 日加入 Agentic AI Foundation,为每个强化学习环境提供统一的接口。Hugging Face 的 Sergio Paniego Blanco 使用 TRL 和 OpenEnv,通过四个编码智能体训练了一个小型 Liquid AI 模型,使其在留出任务上的得分从 42% 提升至 54%。Open tooling for training agents with RL ran through several sessions. Anyscale's SkyRL separates training, inference, and environments and orchestrates them with Ray. Hugging Face's OpenEnv, which joined the Agentic AI Foundation on October 22, gives every RL environment the same interface. Using TRL and OpenEnv, Hugging Face's Sergio Paniego Blanco trained a small Liquid AI model through four coding agents, raising its score on held-out tasks from 42% to 54%.

对于正在权衡是否迁移的团队来说,只需一行代码即可更改设备并运行模型,但这并不意味着模型已经过调优,因此应为分片和内核开发预留预算,并先确认 TPU 容量。有兴趣进一步了解的开发者可以阅读 TorchTPU 公告、TorchTPU 代码仓库,或 InfoQ 对 PyTorch Conference 2024 的报道。预计活动结束后两周内,会议录像会发布在 PyTorch Foundation 的 YouTube 频道上。For teams weighing a move, the one-line device change gets a model running, not tuned, so budget for sharding and kernel work and confirm TPU capacity first. Developers interested in learning more can read the TorchTPU announcement, the TorchTPU repository, or InfoQ's coverage of PyTorch Conference 2024. Session recordings are expected on the PyTorch Foundation's YouTube channel within two weeks of the event.

值得记下

借助 TorchTPU,TPU 与 GPU、CPU 一样成为 PyTorch 的原生选项
尽管 PyTorch 扩展点为开发者提供了共同语言,优化层与供应层仍牢牢掌握在厂商手中。
在 Meta,推动 AI 前沿需要巨大的算力规模与深度的硬件多元化。我们不能被单一硬件架构所束缚。