[ckpt]: NCCL checkpoint engine broadcast optimization
Feature Request
Adding all the trainer GPUs (or possibly just the trainer GPUs located on the same node as the master GPU) to the broadcast group when broadcasting updated weights from the master trainer rank to the rollout ranks results in higher transfer bandwidth and lower end-to-end latency in the cases I've tested, without incurring drastic side effects.
Motivation
Below is the experiment that led me to this proposal.
I'm working with GH200 nodes connected as follows:
I laid out trainer and rollout in a 4x4 split — 4 trainer GPUs on one node, 4 rollout GPUs on another. With only the master sending weights to the rollout GPUs, NCCL broadcast bandwidth was capped at ~25 GB/s. However, each node has 4 NICs available, giving a bisection bandwidth of ~100 GB/s between the two nodes. After adding all the trainer GPUs (except the master) to the broadcast group as well, NCCL was able to make use of the remaining 3 NICs too, bringing the raw broadcast bandwidth of the operation to ~90 GB/s.
The measurements below include the changes introduced in #7083 and #7107, and a lean fix for the issue described in #7015. The trainer side runs FSDP2 for weight distribution.
The following table shows the time taken for a weight sync of Qwen2.5-14B-Instruct using the NCCL checkpoint engine:
| Configuration | Time taken per weight sync |
|---|---|
| Trainer ranks not included in the broadcast group | 1.5 s |
| Trainer ranks included in the broadcast group | 0.62 s |
Given this, I think it would be useful to add a mechanism to optionally include all trainer GPUs — or just the trainer GPUs co-located with the master's node — in the broadcast group.
Moreover, this change also fits easily in the current implementation.
Happy to hear any suggestions on this and to provide more information wherever needed.
Hi @parinayc20, I traced the current NCCL checkpoint path, and the reported result is consistent with its topology: build_topology() includes only trainer rank 0 in the collective, while the remaining trainer ranks consume the export generator without participating in the broadcast. NCCL therefore cannot use the other trainer-side GPUs/NICs as relay participants.
I would be happy to work on a focused implementation if you are not already preparing one:
- add an opt-in NCCL engine option, disabled by default, to include all trainer ranks;
- keep rank 0 as the sole source and let the additional trainer ranks participate passively in every bucket collective;
- leave the default topology and NIXL/HCCL/delta backends unchanged;
- add topology compatibility tests, multi-GPU correctness/hang tests, and a before/after bandwidth benchmark.
I suggest supporting all trainer ranks first. Selecting only ranks co-located with the source requires reliable placement metadata and can be a follow-up. Since #7107 is still open, I would rebase the implementation after its bucket changes settle.
@wuxibin89, would this opt-in scope be acceptable? @parinayc20, please let me know if you already have an implementation in progress.
Hi @parinayc20, thank you for documenting the GH200 topology and measurements. I completed a controlled reproduction of the opt-in all-trainer-rank topology against e357354528c01fc992d9d9e10f5cb1a0301faaf0 on a 2-node, 16-GPU H20/RDMA setup with Qwen3-30B-A3B. Rank 0 remained the only source, while the other trainer ranks participated passively in each bucket collective.
To reduce run-order and outlier effects, I used an A/B/B/A sequence with 20 samples per mode and checked exact weight equality for both the candidate and a final baseline run. All correctness checks passed and no collective hang occurred. The timing result was:
| Topology | Median | p95 |
|---|---|---|
| Current trainer-rank-0 topology | 15.85 s | 16.60 s |
| All trainer ranks | 307.73 s | 326.12 s |
I also separated the in-engine transfer interval from communicator teardown/rebuild. Rebuilding the larger communicator inflated the end-to-end number, but it does not explain the direction of the result: the candidate transfer interval itself was typically about 39-56 s, versus 6-8 s for the current topology. In this implementation, the per-bucket ordering needed to avoid conflicting collectives between the FSDP process group and the checkpoint NCCL group also removed the existing export/broadcast overlap.
I do not take this topology-specific negative result as contradicting your GH200 measurement; the implementation details and interconnect topology are materially different. To make the next comparison faithful, could you please share the patch or commit for the "lean fix" related to #7015 and clarify:
- whether all trainer ranks enter every checkpoint broadcast while FSDP2 export collectives are still active;
- how collective launch ordering is coordinated across the FSDP and checkpoint process groups without losing the export/broadcast pipeline;
- whether the checkpoint communicator remained persistent across the reported measurements.
These details would help me reproduce the same mechanism rather than infer it from the issue description. I will hold off on proposing the current candidate because its correctness is good but its performance is not. Thank you for any additional context you can provide.
Hey @kaining-never-stop,
I was actually trying to find a way to fuse the all-gather and broadcast operations to further reduce data movement, similar to what NCCL M2N does, before opening a PR.
That said, I already have a working implementation for the issue you mentioned. I also tested it with the Qwen3-30B-A3B model, and I consistently see the same performance improvements. The lean fix shouldn't change the relative speedup either.
I'll open a PR soon. Once it's up, could you try it on your machine and let me know if you observe similar numbers? That should make it easier to compare results and understand if there's any machine-specific difference.
Good job! That makes sense, waiting for you
Hi @parinayc20 @kaining-never-stop, we've been working on this same problem and just posted a design RFC with measurements (https://github.com/verl-project/verl/issues/7262) and a PR with the implementation and test evidence (https://github.com/verl-project/verl/pull/7263).
Short version: all trainer ranks send concurrently as active stripe owners. Each rank broadcasts its own stripe of one global bucket sequence on its own NCCL group, instead of joining passive ranks to a single source's broadcast group. We run it in production-scale RL (FSDP2 trainer plus disaggregated vLLM rollout) and measured 3.01s to 2.51s per weight sync on a 2-node setup where the stock engine is sender-NIC-bound. Topology validation goes up to 3 trainer nodes (S=24 senders).
To answer the three questions from the reproduction comment for our design:
-
Do all trainer ranks enter every checkpoint broadcast while FSDP export collectives are still active? Yes, but as active stripe owners rather than passive participants. Each rank broadcasts its own stripe on its own communicator, so no trainer rank ever participates in another trainer's broadcasts, and there is nothing to reconcile per bucket across the trainer group. (Every actor rank iterates the whole weight stream in both designs; that iteration drives the FSDP gathers and is mandatory either way.)
-
How is collective launch ordering coordinated across the FSDP and checkpoint groups without losing the export/broadcast pipeline? Bulk-synchronous phase barriers on a dedicated senders-only group pin the enqueue order of engine collectives to fixed points in every rank's collective sequence, which satisfies NCCL's cross-communicator ordering requirement. Execution is not serialized: comm streams are non-blocking with respect to the default stream and completion is tracked with per-transfer CUDA events, so the export keeps running underneath. Synchronization granularity is the phase (up to S buckets), not the bucket. Our read of your ~19x result is that ordering got enforced by serialization instead of at enqueue time, and the overlap went with it. Your root-cause analysis matches what we hit in our own failed iterations before settling on the phase discipline.
-
Did the checkpoint communicator stay persistent across the measurements? Yes. Communicators persist across rounds by default;
rebuild_group=Trueis opt-in and covered by a dedicated correctness test case.
The full mechanism, the deadlock classes we hit along the way, benchmark methodology, and limitations are in the RFC; the code and tests are in the PR and runnable today. Feedback welcome on either. @parinayc20, your GH200 numbers show how much headroom exists when one sender's NIC share is the bottleneck. Once your PR is up we'd be glad to run both mechanisms on the same hardware and compare notes.
@kaining-never-stop @savaresejeremy I have added my RFC with measurements for both the Qwen3-30B-A3B and Qwen3.5-27B models on my hardware. Feel free to check it out and run the measurements on your respective hardware. Feedback welcome on any aspect of this PR.