~/satyajit

PyTorch 2.15: NCCL communicators are now built up front, and a group can lose a rank and keep going

mdjsonmcp

2026-10-31 · 21 min · pytorch · distributed-training · nccl · fsdp · torch-compile · apple-silicon

Why read this

Hightop 30%

Explains the NCCL default switch from communicators up, runs the reconfigure lifecycle on CPU, and times five MPS speedups on two official wheels.

  • A guide you can follow today
  • Original analysis
  • Runs on a laptop CPU

Developer tools & infraBSD-3-ClausePractitioner roundup

How this was scored
Is it new?
1 of 3: An incremental tweak
Can I trust it?
2 of 3: Measures key facts from files, code or configs
Can I run it?
2 of 3: Open code or weights with real limits
Will I understand it?
2 of 3: Mechanism from first principles with figures
Can I act on it?
3 of 3: A decision guide a practitioner can follow today
Will it last?
2 of 3: A reference for a year or more
Does it affect many?
2 of 3: A widely used model, tool or lab release
Only here?
2 of 3: A teardown or measurement few others did

Score 70 of 100, ranked 166 of 773 rated articles. Each question is answered 0–3 by hand, and a 3 is rare. How articles are scored

PyTorch 2.15 came out on 28 October. The release blog counts 3,117 commits from 583 contributors, and its first item is the one that changes jobs people already run: every process group created with backend="nccl" now gets a rewritten NCCL implementation. The blog gives that change three short paragraphs. The full release notes give it a page, and the pull requests behind it give the rest, including a bug report from vLLM that shows what the switch costs.

The first version of this article read only the blog and called the NCCL change untestable. That was half right. The NCCL path needs NVIDIA GPUs, but the reconfiguration contract it implements is shared with gloo, which runs on a laptop. So this rewrite does three jobs: it explains what a communicator is and why building it eagerly matters, it walks one group through a rank failure on four real CPU processes, and it times the release's Apple Silicon numbers on an M1 Max, the one set of claims this machine can check directly.

PyTorch 2.15 release highlights graphic listing six items: rewritten NCCL backend becomes the default; one-sided transports with a NIXL backend; finer memory and communication control in FSDP2 and pipelining; faster NVFP4 LLM decoding on NVIDIA Blackwell GPUs; FP8 and faster decode on Apple Silicon; broader platform support.
The six highlights, in the order PyTorch ranks them (PyTorch 2.15 release blog, header graphic).
pytorch/pytorch@c12abc6 · snapshot 2026-11-23

Tensors and Dynamic neural networks in Python with strong GPU acceleration

stars
105.8K
tracked files
22,761
license
custom
branch
main
forks
30.7K
open issues
18.6K
tests
12626 files
source
175.0 MB
commit date
2026-11-23
source by language
Python117.7 MBC++47.1 MBCuda4.5 MBC1.9 MBObjective-C++1.6 MBMetal1.2 MBCMake980.1 kB
autograddeep-learninggpumachine-learningneural-networknumpypythontensor

GitHub REST API, 2026-11-23 — branch, commit, commitDate, createdAt, description, forks, homepage, license, openIssues, pushedAt, stars, topics

local clone, 2026-10-31 at c12abc6 — fileCount, hasTests, licenseFile, shallow, testFileCount

shallow clone: counts describe the pinned tree, not the history

A process group is a list of names; a communicator is the wiring

Distributed training starts with N processes, usually one per GPU, that need to agree on numbers. Each has a rank from 0 to N−1. To sum gradients across all of them you call dist.all_reduce(tensor), and every rank gets the same total back.

A process group is PyTorch's object for "these ranks, talking together". init_process_group makes the default one with every rank in it, and new_group makes subsets: a tensor-parallel group of 8, a data-parallel group of 64, a pipeline pair. Large jobs make dozens. The group itself is cheap. It holds the member list, a key-value store (usually a TCP server on rank 0) that members use to find each other, and a pointer to a backend that does the actual moving of bytes.

For NVIDIA GPUs the backend is NCCL, and the thing NCCL builds is a communicator (ncclComm_t). A communicator is the expensive part. To make one, rank 0 creates a unique id, publishes it through the store, and every member calls ncclCommInitRankConfig with it. That call is itself collective: all members must show up. NCCL then discovers the topology (NVLink, PCIe, InfiniBand), picks ring and tree layouts, opens connections to peers and allocates GPU buffers for staging data in flight. The buffers are the part that shows up in nvidia-smi.

Since all members must join, when you build the communicator is a design choice with consequences:

Write GG for the groups a process creates, UU for the ones that ever run a collective, c0c_0 for what a communicator allocates when it is built, and c1c_1 for its footprint after it has run. Then, per GPU,

Mlazy=U c1,Meager=G c0+U (c1−c0).M_{\text{lazy}} = U\,c_1, \qquad M_{\text{eager}} = G\,c_0 + U\,(c_1 - c_0).

The two agree once every group is used (U=GU = G). They differ by (G−U) c0(G - U)\,c_0 when some groups are made "just in case", which serving engines do all the time.

What backend="nccl" resolves to now

None of the four backend names is new. I installed torch==2.14.1 and torch==2.15.0 from PyPI side by side and read both wheels: nccl, nccl2, nccl-lazy and nccl-legacy are registered as entry points in both. What changed is one comparison in _register_builtin_nccl_backend. In 2.14.1 plain nccl builds the rewrite only if TORCH_DIST_USE_NCCL2 == "1". In 2.15.0 it builds the rewrite unless the variable is "0". Registration happens the first time a process asks for that name, so the variable has to be set on every rank before the first group is created.

The rewrite was ported from torchcomms, Meta's experimental communications library, whose README now says it is deprecated because its features have been upstreamed into torch.distributed. The release notes list what differs from the legacy backend in practice:

The legacy behaviour is on a one-release clock. The two supported choices are nccl, which is eager, and nccl-lazy, which builds one eager communicator for collectives and a separate lazily created two-rank communicator and stream for each send/recv peer pair, so point-to-point traffic to different peers can overlap. PR #193241 makes pipeline stages print a warning steering users to nccl-lazy, because pipeline parallelism is mostly point-to-point.

The PR that flipped the default (#192281) carries a TorchTitan test matrix: ten training steps with the legacy and new backends gave identical loss and gradient norm, and eight parallelism layouts passed on 4 GPUs.

A table from the pull request. Deterministic parity between legacy NCCL and default nccl2 over 10 training steps, global_avg_loss, global_max_loss and grad_norm matched exactly: PASS. Then TP+FSDP, PP+FSDP, DDP, HSDP, CP, FSDP+CP, DeepSeek V3 with HSDP and expert parallelism, and Qwen3 MoE with FSDP, tensor and expert parallelism: all PASS.
The release-test matrix attached to the PR that made the rewrite the default, run on 4 GPUs with the variable unset (pytorch/pytorch PR #192281, description).

What eager creation costs

The release notes say each eagerly created communicator allocates about 200 MiB. The clearest measurement is in issue #199957, whose report says the switch broke vLLM's nightly CI with out-of-memory errors on H100s. vLLM's tensor-parallel-2 setup creates about ten groups (world, TP, PP, DP, EP and others, several with one rank), and the engine saw about 2.5 GiB less free memory per GPU with the new backend.

The issue text and its results table. On torch 2.15.0.dev20261002 with NCCL 2.30.7 on two H100 96GB GPUs and 9 groups: nccl2 default allocates +2080 MiB (231 MiB per group) after nine new_group calls and +4672 MiB after one all_reduce per group; legacy allocates +0 MiB then +4672 MiB; nccl2 with NCCL_COMM_SPLIT_SHARE_RESOURCES=1 allocates +1188 MiB (132 MiB per group) at both points.
Eager creation charges every group up front; the totals converge once all groups are used (pytorch/pytorch issue #199957, Results).

That table is the formula above with numbers in it: c0≈231c_0 \approx 231 MiB and c1≈519c_1 \approx 519 MiB per group on that machine (2080 and 4672 divided by 9). A follow-up in the same thread on GB200 measured 197 MiB per group. The slider below scales the H100 figures to other group counts, which assumes every group costs the same; that is my extrapolation, not a measurement.

One mechanism detail explains the second option. On the new backend, new_group normally builds a group by splitting the parent's communicator (ncclCommSplit) rather than bootstrapping from nothing, so an NCCL setting that lets split communicators share their parent's resources applies to every subgroup. There are three ways out, and they trade differently. nccl-legacy works today and disappears next release. NCCL_COMM_SPLIT_SHARE_RESOURCES=1 lets split communicators share buffers, which cut the issue's total to 1188 MiB whether or not the groups were used, at a possible cost to concurrency the reporter flagged as unmeasured. And 2.15 shipped a third, ProcessGroupNCCL.Options.lazy_init from PR #200020, which keeps the new backend but builds a group's communicator on its first operation. Its PR reports nine groups going from +1774 MiB to +0 MiB at new_group, with nothing changed after use. The issue is still open as I write, and the default stays eager.

Reconfiguration: losing a rank without losing the job

The second half of the headline is reconfiguration. In a classic job, one dead GPU kills everything: the survivors block in their next collective until a timeout, the launcher tears the job down, and it restarts from the last checkpoint. On thousands of GPUs that is a routine event, and the lost time adds up.

Reconfiguration keeps the surviving processes alive and rebuilds the communicator with a new member list. The API in 2.15 is three experimental functions in torch.distributed, documented under "Fault-tolerant reconfiguration":

PyTorch does not decide who is alive or tell the survivors. Something outside the group, a fault-tolerance controller such as torchft or your own rendezvous over the store, collects handles from the processes that are still answering and hands every one of them the same list.

For NCCL, a full reconfigure tears the old communicator down and runs a fresh ncclCommInitRankConfig on everyone, which is the same bootstrap as at startup. 2.15 adds an opt-in fast path (PR #199240), ported from torchcomms: with TORCH_NCCL2_RECONFIGURE_SHRINK_GROW=1 on every rank and NCCL 2.29 or newer, survivors keep their existing communicator and call ncclCommShrink(NCCL_SHRINK_ABORT) to cut the dead ranks out, and newcomers are added with ncclCommGrow. I checked the shipped v2.15.0 source (nccl2/ReconfigureNCCL.cpp) rather than trusting the PR text. The rule that decides the path depends only on the handle list, so every rank picks the same one:

  1. The quorum is the largest set of handles that share a previous generation uuid, and it needs at least two members.
  2. The quorum must come first in the list, in ascending old-rank order, because NCCL's shrink keeps survivors in order and grow appends joiners at the end. Any other order means a fresh init on every rank.
  3. A reconfigure with the same members and no joiners also uses fresh init, since the old communicator may already be revoked.

Reconfigure needs ncclCommRevoke, which the source gates at NCCL 2.28 for CUDA builds and RCCL 2.30.7 for ROCm (PR #194774, which explains that RCCL 2.30.4 hangs on the missing-rank path). The Linux CUDA wheel on PyPI depends on nvidia-nccl-cu13==2.30.7, so the default install clears both NCCL floors.

The same lifecycle, run on four CPU processes

The reconfigure contract is the same across backends; the NCCL source says its handle format and rank-assignment rule "match ProcessGroupGloo's reconfigure". Gloo runs on CPU, so I could drive it. Four processes started a group with enable_reconfigure=True, three of them formed generation 1, one died, the survivors shrank to generation 2, and the spare joined in generation 3. This is the core of the script:

dist.init_process_group("gloo", store=store, rank=wid, world_size=4,
                        enable_reconfigure=True, timeout=timedelta(seconds=5))
 
def gather_handles(store, tag, me, members):
    store.set(f"{tag}/{me}", dist._get_reconfigure_handle())
    return [store.get(f"{tag}/{m}").decode() for m in members]
 
h = gather_handles(store, "gen1", wid, [0, 1, 2])          # process 3 waits
dist._reconfigure(uuid=1, handles=h).wait()
x = torch.tensor([float(wid + 1)]); dist.all_reduce(x)     # 1 + 2 + 3
# process 2 calls os._exit(0); the others try one more all_reduce, which times out
h = gather_handles(store, "gen2", wid, [0, 1])
dist._reconfigure(uuid=2, handles=h).wait()                # 1 + 2
h = gather_handles(store, "gen3", wid, [0, 1, 3])          # process 3 joins as rank 2
dist._reconfigure(uuid=3, handles=h).wait()                # 1 + 2 + 4

And what it printed on 2.15.0 (2.14.1 printed the same):

[rank0] gen1 rank 0 size 3 all_reduce 6.0
[rank2] exiting (simulated failure)
[rank0] collective with dead peer failed after 5.0 s: RuntimeError ... Timed out waiting 5000ms
[rank0] gen2 (shrunk) rank 0 size 2 all_reduce 3.0
[rank3] gen3 (grown) rank 2 size 3 all_reduce 7.0
exit codes [0, 0, 0, 0]

Step through it, and flip the toggle to see what the NCCL fast path does differently at the shrink and grow steps:

What this run does and does not show: it shows the contract: handles, fresh uuids, position-as-rank, a spare becoming rank 2. It does not show the 2.15 change, because gloo's reconfigure behaves the same on 2.14.1; what 2.15 adds is the NCCL fast path and reconfigure on ROCm. And gloo always reconnects from scratch (about 2 ms on loopback here), so it is the analogue of NCCL's full re-init, never of shrink/grow.

My first attempt also hung, which is instructive. I had the survivors fire an asynchronous all_reduce at the dead peer and abandon it after a 3-second wait. The wait raised, the survivors went on to shrink, grow and print the right sums, and then neither of them exited: the launcher's 90-second join gave up on both with no error printed. The group's default timeout is 30 minutes (default_pg_timeout in the wheel), and my reading is that the abandoned operation was still holding the group until then. I changed both the call and the timeout at once, a blocking all_reduce instead of the abandoned one and a 5-second group timeout, so the transport itself failed the collective; after that every process exited with code 0. That is the shape of a real distributed hang: the rank that is stuck is not the one that failed, and nothing is printed.

The flight recorder, and why it gated the rollout

That is why the debugging half of the headline exists. The legacy backend records every collective in a ring buffer (the flight recorder) and can dump it when the watchdog sees a timeout. The rewrite had none. PR #192233 says that before it, the new backend "produced nothing at all when it hung, which was the operability regression blocking its rollout". It adds a backend-agnostic recorder fed from the c10d dispatcher hooks, so it also covers MPI and UCC. PR #199092 publishes watchdog health to the debug server, so one rank's timeout triggers a dump on every rank. And PR #192858 fixed a bug that would have attached no recorder at all to the default name once the default flipped, because one code path read the environment variable and another assumed plain nccl recorded itself.

Other fallout fixed before the release, which tells you what to test in your own stack: vLLM's probe for the communicator pointer called the legacy _comm_ptr() and broke (#198865), and the watchdog thread created a stray CUDA context on GPU 0 from every rank on the host, seven extra 522 MiB contexts per host on a 256-GPU TorchTitan run (#198339).

The rest of the breaking-changes list

The blog lists five backwards-incompatible changes. The release notes list 26, plus 8 deprecations, and the first version of this article repeated the blog's count. The ones most likely to bite, beyond NCCL:

Everything else the release names

The blog's fifteen feature sections cite 108 PR numbers between them, about 3.5% of the 3,117 commits, so the blog is a selection, and it spends its words on distributed work and Apple Silicon.

One-sided transports. torch.distributed._transport moves data by one side reading or writing the other's memory, with no matching receive and no process group, connecting peers through a store. NIXL is the first backend, and read_stream/write_stream enqueue transfers on a CUDA stream so they can be captured in a CUDA graph. This is the primitive for pushing a KV cache from a prefill machine to a decode machine. The _transport directory is in the 2.15.0 wheel and not in 2.14.1, and the leading underscore means what it usually does.

FSDP2 and pipelining. param_dtype_override_fn keeps chosen parameters, the blog names MoE router gates and norms, in fp32 while the rest trains in bf16, with one all-gather per fully_shard. Before, that meant splitting the module into separate FSDP units and paying for extra all-gathers. finalize_backward(async_op=True) lets gradient reduction overlap other compute, and pipelines allocate receive buffers just before each receive.

NVGEMM for NVFP4 decode. The CuTeDSL GEMM backend folds the NVFP4 dequantization scale into the GEMM, removing one pointwise launch per layer during decode on Blackwell. The blog gives no number for this, and I have no Blackwell GPU.

Platforms. FlyDSL GEMM templates on AMD gfx950 (ten flydsl files under torch/_inductor in 2.15.0, none in 2.14.1), Tensor Data Mover on gfx1250, ROCm 10.0 wheels built on AMD's TheRock packages, SYCL free-function kernels and cross-process events on Intel, and torch.compile on Python 3.15.

Checking the Apple Silicon numbers on an M1 Max

The MPS section is the only one with figures, and this machine has an Apple GPU, so these I could test. I took the exact shape and dtype from each PR's own table, ran both official wheels in separate processes, and alternated 2.14.1 and 2.15.0 for ten rounds each. Every process warmed up, then took 15 samples of 100 back-to-back calls followed by one torch.mps.synchronize(), so a sample measures throughput rather than one launch plus one sync. The full norm took 10 calls per sample, since on 2.14.1 each one took about 40 ms. I report the median of the ten per-process medians and the spread between the fastest and slowest process. The slow ops got fewer calls: upsample backward ten samples of two calls, and QR five single calls per process, in ten processes on 2.15.0 and three on 2.14.1, where one call takes 21 seconds.

One caveat on conditions: other jobs were rendering video on this GPU during parts of the run, and ioreg, sampled before each process, often showed the GPU near 100% busy. Spread captures some of that. It was large for the sub-30 µs F.linear calls on 2.14.1 (one process ran nearly 3x slower than the rest) and small everywhere else.

Op, PR shape2.14.12.15.0my speedupPR or blog
softmax 1x128256 fp32101.5 µs29.0 µs3.5x8.0x
F.linear 896 → 128, bf16 + bias22.3 µs11.7 µs1.9x5.05x
F.linear 896 → 896, bf16 + bias24.7 µs13.0 µs1.9x3.13x
vector_norm 4096x4096 bf1639,542 µs92.3 µs428x170x
upsample backward, bilinear, to 640x640112.4 ms19.25 ms5.8x21.7x
linalg.qr 512x512 fp3221,024 ms4.99 msabout 4,200xabout 4,700x

Every claim holds in direction, and the pattern in the gaps is consistent. Where the old path was a bad algorithm, the speedup survives or grows on older hardware: a full norm that took 39.5 ms now takes 92 µs, and QR on the GPU went from about 21 seconds to about 5 ms, which on this Mac is roughly the speed of the CPU path (4.8 to 6.6 ms). Two exploratory QR runs I did earlier, while the GPU was busy with other work, gave 0.7 to 5 seconds per call on 2.15.0; the ten clean processes ranged from 4.5 to 5.7 ms, so treat the QR figure as what an unloaded GPU does. Where the old path was a fine algorithm with high launch overhead, the gain shrinks: softmax and the small decode projections gain 2x to 3.5x here against 3x to 8x in the PRs. The F.linear PR reports its 1.23x as a geometric mean over 96 bf16 shapes; on the one 4096-wide shape I added, the gain was 1.1x with overlapping spreads, which is no gain I would claim. If you serve small models on an older Mac, expect the decode-loop gains to be modest and the linear-algebra ones to be large.

A torch.compile comparison I could not run

The first version of this piece timed torch.compile on a shared cloud VM and got medians that moved threefold between runs, which settles nothing. I wrote a better design for this Mac: per-wheel Inductor cache directories, the cold run reported separately, then ten warm processes per wheel, alternated, each recording Dynamo's frame counters to prove compilation happened. It never got as far as a timing. Both wheels died with a segmentation fault before printing any result, and one 2.15.0 attempt hung instead; I did not diagnose why, so I make no claim about either release from it. What would settle the question is that script on an idle Linux machine with a pinned clock, ten processes per wheel, with the spread reported. The release notes' compiler items, cached fusion search and lower per-call overhead in compiled code, are what it would test.

Seventeen probes on two wheels

The rest of what a laptop can see, re-run on the two macOS wheels:

Two of the "same" rows need a word. grouped_mm already ran on MPS in 2.14.1, so the probe only shows the call succeeds; the release notes list a native MPS implementation as new in 2.15 (PR #194933 reports 300.3 µs falling to 5.6 µs on one bf16 shape), plus the gemv decode path behind the blog's 1.32 to 1.34x MoE figure, which its PR measured on an M3 Ultra. I did not time grouped_mm. And the reconfigure contract behaves identically, which is why the CPU run above explains the mechanism but does not test the 2.15 change. One correction from the probes: the blog calls the new Intel MemPool policy non_split; the argument in the wheel is no_split.

What I would do with this release

If you run NCCL jobs, upgrade, but read your memory budget first. Count the groups your stack creates and multiply by roughly 200 MiB; if that number matters, set lazy_init on the groups you create speculatively rather than reaching for nccl-legacy, which has one release left. Use nccl-lazy for pipeline stages. Pass device_id to init_process_group instead of relying on set_device. Run one job with TORCH_DIST_USE_NCCL2=0 and one without, and diff the startup logs, since failures that used to appear at the first collective now appear at group creation.

Treat reconfigure as something to try, not something to build on yet. Every function in it has a leading underscore, and the fast path is opt-in for a reason: its correctness depends on rank order. Reconfigure itself is not new: my run worked the same on 2.14.1, and the rewrite already had a full re-init path. What 2.15 adds is the shrink/grow fast path, reconfigure on ROCm, and the default backend that carries it, which puts surviving a dead GPU without a restart within reach of stock PyTorch rather than a separate library.

Upgrade checkpoint readers before writers, set reduce_dtype explicitly in FSDP2, and if you are on a Mac, update: the MPS gains are real, and on an M1 Max some of them are larger than PyTorch claims. For profiling the CUDA side once you have a GPU, my torch.profiler walkthrough is the place to start; for how PyTorch now targets a very different accelerator, see TorchTPU.

Machine, wheels and scripts

Everything I ran used torch==2.14.1 and torch==2.15.0 from PyPI in two separate virtual environments, CPython 3.12.3, on an Apple M1 Max with 64 GB under macOS 26.6.2. No third-party code ran. The reconfigure run used gloo over loopback with four spawned processes and a TCP store. Source reading used the v2.15.0 tag of pytorch/pytorch (commit 31a77fc9) and the installed wheels' own Python files. Figures for NCCL memory, the TorchTitan matrix, the PR tables and every Blackwell, ROCm and Intel item are the authors' numbers, not mine.

Cite this article

For attribution, please use the following reference or BibTeX:

Satyajit Ghana, "PyTorch 2.15: NCCL communicators are now built up front, and a group can lose a rank and keep going", ai.satyajit.si, October 2026.

bibtex
@misc{ghana2026pytorch215,
  author = {Satyajit Ghana},
  title  = {PyTorch 2.15: NCCL communicators are now built up front, and a group can lose a rank and keep going},
  url    = {https://ai.satyajit.si/articles/pytorch-2-15},
  year   = {2026}
}
share