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

PyTorch 2.15 发布:重写 NCCL 成默认,支持 CUDA 13

PyTorch 2.15 Release Blog

原文
发到 X
推荐理由

PyTorch 作为主流框架的重大版本更新,NCCL 重写默认化对大规模训练稳定性影响深远,建议开发者关注升级兼容性与性能收益。

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

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

The PyTorch 2.15 release features the following changes:

PyTorch 2.15 版本包含以下更改:

  • Rewritten NCCL backend becomes the default, with a flight recorder that dumps on hangs and TORCH_DIST_USE_NCCL2=0 or nccl-legacy as rollback paths
  • One-sided transports for torch.distributed, with a NIXL backend and CUDA-graph-capturable transfers
  • FSDP2 and pipelining gain finer memory and communication control, with fp32 for precision-sensitive parameters, CUDA-graph-captured gradient accumulation, and gradient reduction overlapped with compute
  • Faster 4-bit (NVFP4) LLM decoding on NVIDIA Blackwell GPUs through fewer, better-overlapped kernel launches in NVGEMM
  • Apple Silicon gains FP8 and faster decode, with float8_e4m3fn and _scaled_mm, a new grouped_mm with a decode fast path (1.32–1.34x tokens/s on MoE decode), and public torch.mps.Stream APIs
  • Broader platform support with FlyDSL kernels on AMD gfx950, Tensor Data Mover support for gfx1250 (MI450), ROCm 10.0 wheels, simpler SYCL kernel authoring and multi-GPU profiling on Intel GPUs, CUDA 13.2 as the default wheel with CUDA 13.4 alongside it, and torch.compile on Python 3.15
  • 重写后的 NCCL 后端成为默认选项,并配备在挂起时转储飞行记录器功能,同时提供 TORCH_DIST_USE_NCCL2=0 或 nccl-legacy 作为回滚路径
  • torch.distributed 的单边传输,支持 NIXL 后端和可捕获 CUDA 图的传输
  • FSDP2 和流水线化获得更精细的内存和通信控制,包括对精度敏感参数使用 fp32、可捕获 CUDA 图的梯度累积,以及梯度归约与计算重叠
  • 通过 NVGEMM 中更少且更好重叠的内核启动,在 NVIDIA Blackwell GPU 上实现更快的 4-bit (NVFP4) LLM 解码
  • Apple Silicon 获得 FP8 支持和更快解码,包括 float8_e4m3fn 和 _scaled_mm、带有快速解码路径的新 grouped_mm(MoE 解码速度提升 1.32–1.34x tokens/s),以及公开的 torch.mps.Stream API
  • 更广泛的平台支持:AMD gfx950 上的 FlyDSL 内核、gfx1250 (MI450) 的 Tensor Data Mover 支持、ROCm 10.0 wheels、简化的 SYCL 内核编写及 Intel GPU 上的多 GPU 分析、CUDA 13.2 作为默认 wheel 并与 CUDA 13.4 并存,以及在 Python 3.15 上支持 torch.compile

This release is composed of 3,117 commits from 583 contributors since PyTorch 2.14. 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.15. More information about how to get started with the PyTorch 2-series can be found at our Getting Started page.

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

Bring any questions you may have about PyTorch 2.15 to our Q&A webinar on Thursday, November 5, 2026, at 11 AM PT. Tristan Rice, Natalia Gimelshein, Huy Do, and Jane Xu (all Meta) will share an overview of the 2.15 release and answer community questions about PyTorch and the new capabilities in this release. Chris Gottbrath (Gottbrath Tech) will moderate. Register today.

如有任何关于 PyTorch 2.15 的问题,请参加我们于 2026 年 11 月 5 日(星期四)太平洋时间上午 11 点举行的 Q&A 网络研讨会。Tristan Rice、Natalia Gimelshein、Huy Do 和 Jane Xu(均为 Meta 员工)将概述 2.15 版本的发布内容,并回答社区关于 PyTorch 和本版本中新功能的提问。Chris Gottbrath(Gottbrath Tech)将担任主持人。立即注册。

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.13 landed FlexAttention on Apple Silicon, gave Inductor a CuTeDSL code path, and introduced torchcomms for large-cluster training. PyTorch 2.14 matured that path into NVGEMM, previewed the rewritten NCCL backend, and brought native linear algebra to Apple Silicon.

在整个 2.x 系列中,PyTorch 正从以研究为主的框架演变为用于大规模生产训练和推理的统一、硬件无关的平台。PyTorch 2.13 在 Apple Silicon 上引入了 FlexAttention,为 Inductor 提供了 CuTeDSL 代码路径,并引入了用于大型集群训练的 torchcomms。PyTorch 2.14 将该路径成熟化为 NVGEMM,预览了重写后的 NCCL 后端,并为 Apple Silicon 带来了原生线性代数支持。

PyTorch 2.15 builds on that work. The rewritten NCCL backend now backs every nccl process group, NVGEMM is tuned for low-precision decode, Apple Silicon adds FP8 and decode-specific kernels, AMD support extends to new compiler DSLs and (preview support) for next Instinct generation, and Intel GPUs gain a simpler kernel programming model and deeper profiling.

PyTorch 2.15 在此基础上进行了构建。重写后的 NCCL 后端现在支持每个 nccl 进程组,NVGEMM 针对低精度解码进行了调优,Apple Silicon 添加了 FP8 和针对解码的内核,AMD 支持扩展至新的编译器 DSL 以及(预览支持)下一代 Instinct,Intel GPU 获得了更简单的内核编程模型和更深入的分析功能。

Distributed Training

分布式训练

The Rewritten NCCL Backend Becomes the Default

重写后的 NCCL 后端成为默认选项

When a model trains across many GPUs, those GPUs constantly exchange data through a communication backend, and on NVIDIA hardware that backend is NCCL. In PyTorch 2.15, every job that uses nccl runs on our rewritten backend by default.

当模型在多个 GPU 上训练时,这些 GPU 会通过通信后端不断交换数据,而在 NVIDIA 硬件上,该后端即为 NCCL。在 PyTorch 2.15 中,所有使用 nccl 的作业默认都在我们重写后的后端上运行。

PyTorch 2.14 previewed our rewritten NCCL backend, ported from torchcomms, as the opt-in nccl2 backend. In 2.15 it is the default for every nccl process group, with TORCH_DIST_USE_NCCL2=0 and the nccl-legacy backend name as rollback paths. Communicators are now created eagerly with the process group, and reconfiguration can opt into a shrink/grow fast path (NCCL 2.29 or newer) so surviving ranks skip a full bootstrap. Reconfigure for fault tolerance is also enabled on ROCm with RCCL 2.30.7.

PyTorch 2.15 预览版将源自 torchcomms 的重写 NCCL 后端作为可选的 nccl2 后端推出。在 2.15 版本中,它成为每个 nccl 进程组的默认后端,并提供了 TORCH_DIST_USE_NCCL2=0 和 nccl-legacy 后端名称作为回滚路径。通信器现在与进程组一起急切创建,重新配置可以选择启用收缩/扩展快速路径(NCCL 2.29 或更高版本),以便存活的秩跳过完整的引导过程。ROCm 上也启用了基于 RCCL 2.30.7 的容错重新配置。

To make the backend debuggable in production, a backend-agnostic flight recorder writes a post-mortem to disk when a collective hangs, and watchdog health is published to the debug server so a timeout on any rank triggers flight-recorder dumps from every rank. At cluster scale, a single stalled GPU can halt an entire training run, and finding the cause has often meant reproducing the failure by hand. The flight recorder captures what each rank was doing at the moment of the hang.

为了使后端在生产环境中可调试,一个与后端无关的飞行记录仪会在集合操作挂起时将事后记录写入磁盘,并将看门狗健康状况发布到调试服务器,这样任何秩上的超时都会触发所有秩的飞行记录仪转储。在集群规模下,单个停滞的 GPU 可能会阻止整个训练运行,而查找原因通常意味着需要手动重现故障。飞行记录仪捕获了每个秩在挂起时刻正在执行的操作。

API Unstable

API 不稳定

(PRs #192281, #192895, #199240, #198865 and #198339 by Tristan Rice, Meta; #194774 by Chinmay Kuchinad, AMD; #192233 and #199092 by Tushar Jain, Meta; #192075 by Atharva Kshirsagar, Red Hat)

(由 Tristan Rice (Meta) 提交的 PR #192281、#192895、#199240、#198865 和 #198339;Chinmay Kuchinad (AMD) 提交的 #194774;Tushar Jain (Meta) 提交的 #192233 和 #199092;Atharva Kshirsagar (Red Hat) 提交的 #192075)

One-Sided Transports with a NIXL Backend

带有 NIXL 后端的单向传输

torch.distributed gains a Python transport API for one-sided data movement, with NIXL as the first backend. Transports connect to a peer through a store, without needing a process group or collectives, and Transport.read_stream/write_stream enqueue transfers on a CUDA stream so they can be captured with torch.cuda.graph.

torch.distributed 获得了一个用于单向数据传输的 Python 传输 API,NIXL 是第一个后端。传输通过存储连接到对等节点,无需进程组或集合操作,并且 Transport.read_stream/write_stream 在 CUDA 流上排队传输,因此可以使用 torch.cuda.graph 进行捕获。

API Unstable

API 不稳定

(PRs #195643, #197032, #198889 and #198918 by Tristan Rice, Meta)

(由 Tristan Rice (Meta) 提交的 PR #195643、#197032、#198889 和 #198918)

FSDP2 and Pipeline Parallelism: Memory and Communication Control

FSDP2 和流水线并行:内存与通信控制

FSDP2 now gives finer control over precision and capture. Precision-sensitive parameters, such as MoE router gates and norm weights, can stay in fp32 while the rest of the model trains in bf16, still with one all-gather per fully_shard (MixedPrecisionPolicy(param_dtype_override_fn=...)). A full gradient-accumulation step can now be captured in a single CUDA graph. Gradient precision can also be set per parameter. Gradients accumulate directly in .grad and follow each parameter’s grad_dtype, which changes the default behavior when reduce_dtype=None (see Deprecations and Backwards-Incompatible Changes).

FSDP2 现在可以更精细地控制精度和捕获。对于精度敏感的参数(如 MoE 路由器门控和归一化权重),可以保持 fp32 格式,而模型其余部分以 bf16 进行训练,每个 fully_shard 仍只需一次 all-gather(MixedPrecisionPolicy(param_dtype_override_fn=...))。现在可以将完整的梯度累积步骤捕获到单个 CUDA 图中。还可以为每个参数设置梯度精度。梯度直接累加到 .grad 中,并遵循每个参数的 grad_dtype,这在 reduce_dtype=None 时改变了默认行为(参见弃用和不兼容的更改)。

Pipeline parallelism now allocates receive buffers just before each receive instead of for every microbatch up front, and releases forward outputs once their sends complete. Schedules accept a max_outstanding_sends budget, and FSDP unshards are staggered across each rank’s startup bubble instead of all being issued at the start of a step. Each unique edge between pipeline-parallel ranks, as determined by the schedule, now gets a dedicated P2P communicator. FSDP reduce grads can now be overlapped with subsequent compute. These improvements make PyTorch pipelining cudagraphable, deterministic, with an optimized memory profile, and expose performance tuning knobs for minimizing exposed communication.

流水线并行现在改为在每个接收操作前分配接收缓冲区,而不是预先为每个微批次分配,并在发送完成后释放前向输出。调度程序接受 max_outstanding_sends 预算限制,FSDP unshard 操作会分散在每个 rank 的启动气泡中执行,而不是在步骤开始时全部发出。根据调度确定的流水线并行 rank 之间的每条唯一边,现在都拥有专用的 P2P 通信器。FSDP 的 reduce grads 现在可以与后续计算重叠。这些改进使得 PyTorch 流水线支持 cudagraphable、确定性执行,并具有优化的内存配置文件,同时暴露了用于最小化暴露通信的性能调整选项。

API Unstable

API 不稳定

(PRs #196640, #196724, #196727, #196641 and #196963 by Chien-Chin Huang, Meta; #196626 by Anshul Sinha, Meta; #198417 by Andrew Or, Apache Spark PMC); #194114 by Animesh Jain, Meta; #196463, #196464 and #196706 by Sanket Purandare, Meta)

(由 Chien-Chin Huang (Meta) 提交的 PRs #196640, #196724, #196727, #196641 和 #196963;Anshul Sinha (Meta) 提交的 #196626;Andrew Or (Apache Spark PMC) 提交的 #198417;Animesh Jain (Meta) 提交的 #194114;Sanket Purandare (Meta) 提交的 #196463, #196464 和 #196706)

Performance Improvements

性能改进

Faster MPS Kernels for Decode and Linear Algebra

解码和线性代数的更快 MPS 内核

Building on the 2.14 migration, more MPS operators move from MPSGraph to native Metal kernels. A single-row softmax over a 128,256-entry vocabulary drops by 8x, upsample backward is up to 21.7x faster, and reductions now share one set of kernels, making norm full reductions more than 100x faster.

基于 2.14 的迁移工作,更多 MPS 算子从 MPSGraph 迁移到原生 Metal 内核。对包含 128,256 个条目的词表进行单行 softmax 运算速度提升了 8 倍,上采样反向传播速度最高提升 21.7 倍,归约操作现在共享一套内核,使得完整归一化归约的速度提升了 100 倍以上。

For decode, F.linear now uses the existing gemv kernels (1.23x geometric-mean speedup, up to 5x on small projections), and the new MPS grouped_mm has a gemv path that gives 1.32–1.34x higher MoE decode throughput on an M3 Ultra. Several linear algebra solvers were also rewritten: QR of a 512 x 512 matrix falls from about 7 seconds to 1.5 ms, and triangular solves are now blocked.

对于解码操作,F.linear 现在使用现有的 gemv 内核(几何平均加速比为 1.23 倍,在小投影情况下最高加速 5 倍),新的 MPS grouped_mm 提供了 gemv 路径,在 M3 Ultra 上使 MoE 解码吞吐量提高了 1.32–1.34 倍。还重写了几个线性代数求解器:512 x 512 矩阵的 QR 分解时间从约 7 秒降至 1.5 毫秒,三角方程组求解现在采用了分块策略。

(PRs #196071, #199687, #198611, #198495, #194933, #198721, #198725, #198732, #195944 and #196900 by Irakli Salia, Hugging Face; #196922, #196241 and #195369 by Nikita Shulga, Thinking Machines Lab; #193153 by Sunghyun Choi, Tech University of Korea; #188473 by Shrivas Shankar, University of Wisconsin-Madison)

(PRs #196071、#199687、#198611、#198495、#194933、#198721、#198725、#198732、#195944 和 #196900,作者:Irakli Salia,Hugging Face;#196922、#196241 和 #195369,作者:Nikita Shulga,Thinking Machines Lab;#193153,作者:Sunghyun Choi,韩国科技大学;#188473,作者:Shrivas Shankar,威斯康星大学麦迪逊分校)

Core Features

核心功能

CUDA 13.2 by Default and CUDA 13.4 Wheels

默认 CUDA 13.2 及 CUDA 13.4 Wheels

The default PyTorch wheel moves to CUDA 13.2 (13.2.2 toolkit), with CUDA 13.4 GA wheels shipping alongside it for Linux x86_64, Linux aarch64 and Windows. The CUDA 13.4 wheels add experimental support for NVIDIA Rubin GPUs.

默认的 PyTorch wheel 已迁移至 CUDA 13.2(13.2.2 工具包),并随附提供适用于 Linux x86_64、Linux aarch64 和 Windows 的 CUDA 13.4 GA wheels。CUDA 13.4 wheels 增加了对 NVIDIA Rubin GPU 的实验性支持。

(PRs #198913 and #196014 by Andrey Talman, Meta; #194996 and #198843 by Ashish Karale, NVIDIA; #196560, #199269 and #196351 by Ting Lu, NVIDIA; #192653 by Wei Wang, NVIDIA; #186245 by Lakshay Garg, NVIDIA)

(PRs #198913 和 #196014,作者:Andrey Talman,Meta;#194996 和 #198843,作者:Ashish Karale,NVIDIA;#196560、#199269 和 #196351,作者:Ting Lu,NVIDIA;#192653,作者:Wei Wang,NVIDIA;#186245,作者:Lakshay Garg,NVIDIA)

ROCm 10.0 and TheRock Wheels

ROCm 10.0 与 TheRock Wheels

更进一步:量化金融体系

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

进入量化体系 →

相似阅读

关联信息,但可能不是同一事件