跳到主内容
精选88PyTorch 博客(RSS)产品发布/更新

PyTorch 2.14 发布:NVGEMM、分布式容错与 Apple

PyTorch 2.14 Release Blog

原文
发到 X
推荐理由

PyTorch 框架重大版本更新,NVGEMM 与分布式容错机制落地对训练稳定性与性能有实质提升,建议相关团队评估升级。

We are excited to announce the release of PyTorch® 2.14 (release notes)!

我们很高兴地宣布 PyTorch® 2.14(发布说明)的发布!

The PyTorch 2.14 release features the following changes:

PyTorch 2.14 版本包含以下更改:

  • NVGEMM brings CuTeDSL-generated CUTLASS kernels to Inductor, with epilogue fusion, scaled and NVFP4 GEMM, and grouped-reduction epilogues autotuned alongside Triton and ATen
  • A new nccl2 backend for PyTorch Distributed, ported from torchcomms, implementing the full collective contract with nonblocking communicators and eager communicator splitting
  • Fault tolerance becomes a first-class c10d concept, with in-place process-group reconfiguration, one-sided RMA windows, and a Flight Recorder that works for any backend rather than only NCCL
  • Apple Silicon gains native linear algebra, including Jacobi-kernel SVD, eigh, QR and Cholesky, alongside a five-part reduction rewrite and a further MPSGraph to Metal kernel migration
  • torch.switch generalizes torch.cond to multi-way branching, and torch.while_loop can now be captured in a CUDA graph
  • Declarative dynamic shapes via @dynamic_spec, shared across torch.compile, torch.export and make_fx
  • Broader platform support: ROCm 7.14 wheels are produced from the TheRock pip SDK, Intel XPU adds native graph capture, and Inductor targets Rubin (sm_107)
  • Experimental torch.compile support for complex-valued tensors: Opt-in support decomposes supported complex operations into real and imaginary computations, enabling compiler backends to optimize more complex-number workloads.
  • NVGEMM 将 CuTeDSL 生成的 CUTLASS 内核引入 Inductor,支持尾融合、缩放和 NVFP4 GEMM,以及分组归约尾部的自动调优,与 Triton 和 ATen 并行进行
  • 为 PyTorch Distributed 引入了新的 nccl2 后端,从 torchcomms 移植而来,实现了完整的集体通信契约,包括非阻塞通信器和即时通信器拆分
  • 容错成为 c10d 的一等概念,支持就地进程组重新配置、单侧 RMA 窗口,以及适用于任何后端而非仅 NCCL 的飞行记录仪(Flight Recorder)
  • Apple Silicon 获得原生线性代数支持,包括 Jacobi 核 SVD、eigh、QR 和 Cholesky,同时进行了五部分归约重写,并进一步将 MPSGraph 迁移至 Metal 内核
  • torch.switch 将 torch.cond 推广到多路分支,torch.while_loop 现在可以在 CUDA 图中被捕获
  • 通过 @dynamic_spec 实现声明式动态形状,在 torch.compile、torch.export 和 make_fx 之间共享
  • 更广泛的平台支持:ROCm 7.14 wheel 由 TheRock pip SDK 生成,Intel XPU 添加原生图捕获,Inductor 目标为 Rubin (sm_107)
  • 实验性 torch.compile 对复数张量的支持:可选支持将受支持的复数运算分解为实部和虚部计算,使编译器后端能够优化更复杂的复数工作负载。

This release is composed of 2,995 commits from 487 contributors since PyTorch 2.13. We want to sincerely thank our dedicated community for your contributions. As always, we encourage you to try these out and report any issues as we improve 2.14. More information about how to get started with the PyTorch 2-series can be found at our Getting Started page.

自 PyTorch 2.13 以来,此版本由来自 487 位贡献者的 2,995 次提交组成。我们衷心感谢我们敬业社区的贡献。一如既往,我们鼓励您尝试这些新功能,并在我们改进 2.14 时报告任何问题。有关如何开始使用 PyTorch 2 系列的更多信息,请参阅我们的入门页面。

Bring any questions you may have about this release to our Q&A Webinar. It will be on Thursday, September 17, 2026 and will feature Andrey Talman (Meta), Natalia Gimelshein (Meta), Joe Spisak (Reflection AI), and Chris Gottbrath (Gottbrath Tech, moderator) who will share an overview of the 2.14 release and provide answers to community questions about PyTorch and the new capabilities in this release. Register today.

将您关于此发布的任何问题带到我们的 Q&A 网络研讨会。它将于 2026 年 9 月 17 日星期四举行,Andrey Talman(Meta)、Natalia Gimelshein(Meta)、Joe Spisak(Reflection AI)和 Chris Gottbrath(Gottbrath Tech,主持人)将分享 2.14 版本的概述,并回答社区关于 PyTorch 和本版本中新功能的提问。立即注册。

Connect with the global PyTorch community at the upcoming PyTorch Conference North America October 20-21, 2026, in San Jose, CA. Explore what’s new with PyTorch framework with sessions spanning compiler and runtime work, distributed communication, device portability, release engineering, CI, observability, accelerator integration, contributor infrastructure, and much more. PyTorch Conference is the place for engineers, researchers and maintainers solving real problems in training, inference, kernels, applications and responsible AI to convene.

在2026年10月20日至21日于加利福尼亚州圣何塞举行的即将到来的PyTorch北美大会上,与全球PyTorch社区建立联系。通过涵盖编译器与运行时工作、分布式通信、设备可移植性、发布工程、CI(持续集成)、可观测性、加速器集成、贡献者基础设施等内容的会议,探索PyTorch框架的最新动态。PyTorch大会是工程师、研究人员和维护人员在训练、推理、内核、应用和负责任AI方面解决实际问题者的汇聚之地。

Throughout the 2.x series, PyTorch has been evolving from a research-first framework into a unified, hardware-agnostic platform for production training and inference at scale. PyTorch 2.12 added a device-agnostic torch.accelerator.Graph API and Microscaling quantization export support. PyTorch 2.13 landed FlexAttention on Apple Silicon, gave Inductor a CuTeDSL code path, and introduced torchcomms for large-cluster training.

在整个2.x系列中,PyTorch已从以研究为主的框架演变为用于大规模生产环境训练和推理的统一、硬件无关平台。PyTorch 2.12添加了设备无关的torch.accelerator.Graph API以及微缩放量化导出支持。PyTorch 2.13在Apple Silicon上引入了FlexAttention,为Inductor提供了CuTeDSL代码路径,并推出了用于大型集群训练的torchcomms。

PyTorch 2.14 builds directly on those threads. The CuTeDSL path matures into NVGEMM, a full GEMM backend with epilogue fusion and low-precision support. torchcomms lands in-tree as the nccl2 backend, with fault-tolerant reconfiguration and one-sided RMA windows raising fault tolerance from a backend detail to a c10d concept. Apple Silicon moves from attention kernels to native linear algebra, and dynamic shapes become declarative through a spec that travels across compile, export and tracing.

PyTorch 2.14直接建立在上述基础之上。CuTeDSL路径成熟为NVGEMM,这是一个带有尾融合和低精度支持的完整GEMM后端。torchcomms作为nccl2后端进入主仓库,其容错重新配置和单边RMA窗口将容错能力从后端细节提升为c10d概念。Apple Silicon从注意力内核转向原生线性代数,动态形状通过贯穿编译、导出和追踪的规范变得声明式化。

PyTorch 2.14 delivers meaningful improvements across performance, reliability, and hardware support. The release introduces NVGEMM, a new GPU math backend that automatically selects the fastest kernel for matrix operations — including support for lower-precision formats that reduce memory use during training and inference. For teams training across many machines, a redesigned distributed communication backend (nccl2) offers better scalability, while new fault-tolerance features allow training jobs to recover from node failures without restarting from scratch.

PyTorch 2.14在性能、可靠性和硬件支持方面带来了实质性的改进。该版本引入了NVGEMM,这是一种新的GPU数学后端,能够自动选择矩阵运算的最快内核——包括支持降低精度的格式,从而减少训练和推理过程中的内存使用。对于跨多台机器进行训练的团队,重新设计的分布式通信后端(nccl2)提供了更好的可扩展性,而新的容错功能允许训练任务在节点故障时恢复,而无需从头重启。

Apple Silicon users benefit from native linear-algebra routines (SVD, QR, Cholesky, and more) and a broad migration to hand-tuned Metal kernels that cut overhead on Mac GPUs. On the compiler side, new control-flow primitives (torch.switch, torch.while_loop) give model authors more flexibility when writing dynamic logic that still compiles efficiently, and a new @dynamic_spec decorator provides a single, clean way to declare which tensor dimensions can change at runtime — simplifying workflows across compilation, export, and tracing.

Apple Silicon 用户受益于原生的线性代数例程(SVD、QR、Cholesky 等)以及广泛迁移至手工调优的 Metal 内核,从而降低了 Mac GPU 上的开销。在编译器方面,新的控制流原语(torch.switch、torch.while_loop)为模型作者在编写动态逻辑时提供了更多灵活性,这些逻辑仍能高效编译;此外,新的 @dynamic_spec 装饰器提供了一种简洁统一的方式来声明哪些张量维度可以在运行时发生变化——简化了编译、导出和追踪 across 的工作流程。

Platform support expands to AMD ROCm 7.14, Intel XPU native graph capture, and NVIDIA’s next-generation Rubin architecture. Under the hood, the compiler now overlaps communication with computation by default, batches small GPU kernels more intelligently, and reduces per-call overhead — all of which add up to faster end-to-end model execution without any code changes from users.

平台支持扩展至 AMD ROCm 7.14、Intel XPU 原生图捕获,以及 NVIDIA 的下一代 Rubin 架构。在底层,编译器现在默认将通信与计算重叠,更智能地对小型 GPU 内核进行批处理,并减少每次调用的开销——所有这些改进共同实现了更快的端到端模型执行速度,而用户无需进行任何代码更改。

Performance Improvements

性能提升

Large MPS Op Migration to Native Metal

大型 MPS 算子迁移至原生 Metal

Continuing the migration begun in 2.13, a further set of MPS operators moved off Apple’s MPSGraph framework onto hand-written Metal compute kernels, including index_add, index_select, argmin, argmax, conv3d, median, nanmedian, linspace, arange, nan_to_num, log_sigmoid, sigmoid_backward, mish and GLU.

延续 2.13 版本开始的迁移工作,又一组 MPS 算子从 Apple 的 MPSGraph 框架迁移到手写的 Metal 计算内核上,包括 index_add、index_select、argmin、argmax、conv3d、median、nanmedian、linspace、arange、nan_to_num、log_sigmoid、sigmoid_backward、mish 和 GLU。

Reductions received a dedicated five-part rewrite covering full reductions, inner-dimension reductions, strided and batched outer reductions, small-dimension and narrow kernels, and the argmax and argmin split-K paths. The final part migrates min and max off MPSGraph. Skipping input up-casts and using vec4 loads removes work the MPSGraph path could not avoid.

归约操作经历了一次专门的五部分重写,涵盖完整归约、内维归约、带步长和批处理的 outer 归约、小维度和窄核归约,以及 argmax 和 argmin 的 split-K 路径。最后一部分将 min 和 max 从 MPSGraph 迁移出去。跳过输入向上转换并使用 vec4 加载,消除了 MPSGraph 路径无法避免的工作量。

The native Metal path eliminates MPSGraph’s per-op compilation cost and gives PyTorch direct control over thread dispatch and memory access patterns, reducing kernel launch latency across common training and inference workloads on Apple Silicon.

原生 Metal 路径消除了 MPSGraph 的每个算子编译成本,并使 PyTorch 能够直接控制线程分发和内存访问模式,从而降低了 Apple Silicon 上常见训练和推理工作负载中的内核启动延迟。

API Unstable

API 不稳定

(PR #191101, #191097, #191098, #191099 and #191100 by Irakli Salia, Hugging Face, #187109 and #188802 by Nikita Shulga, Thinking Machines Lab)

(PR #191101, #191097, #191098, #191099 和 #191100 by Irakli Salia, Hugging Face, #187109 and #188802 by Nikita Shulga, Thinking Machines Lab)

MPS Memory and Copy Paths

MPS 内存与拷贝路径

Long-running decode workloads grew the MPS caching allocator’s reserved footprint faster than necessary. The allocator now buckets large allocations to bound reserved memory and uses placement heaps to reduce fragmentation.

长时间运行的解码工作负载导致 MPS 缓存分配器的保留内存占用增长过快。现在,分配器将大型分配归类到桶中以限制保留内存,并使用放置堆来减少碎片。

Host and device transfers also got shorter paths. CPU to MPS copies blit directly from pinned buffers with event-deferred reclaim, contiguous same-dtype copies use a compute kernel instead of a graph, elementwise ops are vectorized on inner-contiguous sliced views, and cat gains a vectorized contiguous fast path for any dimension.

主机和设备传输的路径也缩短了。CPU 到 MPS 的拷贝直接从固定缓冲区进行 blit,并采用事件延迟回收;同类型连续拷贝使用计算内核而非图;元素级运算在内部连续的切片视图上向量化;cat 为任意维度获得了向量化的连续快速路径。

API Unstable

API 不稳定

(PR #187441 and #190438 by Irakli Salia, Hugging Face, #189512 and #188613 by Nikita Shulga, Thinking Machines Lab, #188483 and #188200 by Joona Havukainen, Apple)

(PR #187441 和 #190438 by Irakli Salia, Hugging Face, #189512 和 #188613 by Nikita Shulga, Thinking Machines Lab, #188483 和 #188200 by Joona Havukainen, Apple)

F.linear Decode Path on MPS

MPS 上的 F.linear 解码路径

Single-token decode passes a [B, 1, K] activation to F.linear, a shape that was falling off the fast path on MPS and costing an 8.5x slowdown on bf16 and fp16 according to the fix. The sequence-length-1 case is now routed correctly, and new GEMV kernels back the vector-matrix shapes that dominate autoregressive decoding. Together, the routing fix and new GEMV kernels close one of the largest remaining performance gaps between MPS and CUDA for autoregressive workloads.

单 token 解码将 [B, 1, K] 激活值传递给 F.linear,这种形状在 MPS 上原本会脱离快速路径,导致 bf16 和 fp16 出现 8.5 倍的 slowdown(根据修复方案)。序列长度为 1 的情况现在路由正确,新的 GEMV 内核支持占主导地位的自回归解码中的向量-矩阵形状。路由修复和新 GEMV 内核共同缩小了 MPS 与 CUDA 之间自回归工作负载中最大的剩余性能差距之一。

API Unstable

API 不稳定

(PR #189855 by Giovanni Versiglioni, Apple, #186927 by Irakli Salia, Hugging Face)

(PR #189855 by Giovanni Versiglioni, Apple, #186927 by Irakli Salia, Hugging Face)

Compute and Communication Overlap On By Default in Inductor

Inductor 默认开启计算与通信重叠

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

相似阅读

另一事件,读法相近