Skip to content

[RFC]: nccl-m2n for sharding-aware weight transfer in vLLM RL #46439

Description

@kwen2501

Motivation.

Context

The vLLM Native RL blog (May 2026) introduces a weight synchronization API for RL training loops, where a trainer periodically pushes updated weights to a running inference engine. The API is abstract — vLLM defines a WeightTransferEngine interface and a WeightTransferEngineFactory registration point, so different transport backends can be plugged in without changing vLLM core. Two backends ship today: nccl (broadcast-based) and ipc (CUDA shared memory, same-node only). The blog also explicitly calls out issue #40828 — "sharding-aware, RDMA-native weight transfer" — as an open item that neither existing backend addresses. This RFC proposes nccl-m2n as a backend that provides those features.

What is nccl_m2n

A standalone library (repo) built on NCCL's device APIs that redistributes a tensor between two disjoint meshes — trainers and generators — potentially with different sharding/replication layouts. Single call (ncclReshard), zero-copy, one-sided, no host involvement.

The alignment is nearly exact

  1. nccl_m2n is literally the "sharding-aware, RDMA-native weight transfer" vLLM asked for
    The vLLM blog conclusion explicitly tracks issue feat: Integrate vLLM with Weight Propagation Interface (WPI) for Zero-Copy Weight Transfer #40828: "sharding-aware, RDMA-native weight transfer." nccl_m2n is that thing. The trainer and generator use completely different parallelism configs (e.g., trainer: EP=16, DP=2, PP=4 → generator: TP=8, EP=1, DP=16, PP=1), so tensors land on different ranks with different shard dimensions. vLLM's current NCCL backend just broadcasts each tensor as-is — it assumes compatible layouts. nccl_m2n handles the cross-dim resharding transparently.

  2. The perf numbers are already in hand, on the exact models vLLM cited
    We have end-to-end weight transfer latency on DeepSeek-V3 and Qwen3-235B — the same model family used in the Prime-RL validation in the vLLM blog — measured on GB200 NVL72.

    Model GPUs nccl-m2n Baseline (P2P) Speedup
    DeepSeek-V3 256 1.4 s 3.8 s 🟢 2.65×
    Qwen3-235B 128 1.0 s 2.2 s 🟢 2.20×

    In an async RL loop with ~2 second generation steps, the difference is between weight sync being on the critical path and being fully hidden.

  3. One-sided windows could eliminate the DPEP deadlock class entirely
    The vLLM blog spent significant effort on a two-phase pause/resume protocol to prevent deadlocks where inference ranks end up in mismatched NCCL collectives during weight updates. That problem exists because standard NCCL collectives require all ranks to enter at the same time. nccl_m2n's one-sided window API (ncclWindow_t) means the destination (inference) side doesn't need to actively enter a matching collective — the source pushes data via GIN puts. This is a fundamentally different concurrency model that could make the complex pause coordination unnecessary.

Image

Proposed Change.

It should be straightforward to use nccl-m2n functionality via vLLM's pluggable WeightTransferEngine.
The vLLM blog shows the abstraction is already designed for this:

  • WeightTransferEngineFactory.register_engine("my_backend", MyEngine).
  • nccl_m2n could be wrapped as a WeightTransferEngine with init_transfer_engine mapping to ncclM2nInit + window registration (ncclCommWindowRegister),
  • receive_weights maps to ncclReshardWithWindow
  • The trainer-side trainer_send_weights method in vLLM's API also maps cleanly — it's the source mesh side of the reshard.

Example nccl-m2n API:

ncclResult_t ncclReshardWithWindow(
    ncclComm_t                comm,    // contains all ranks (src + dst)
    ncclWindow_t              window,  // registered on comm
    const ncclDistTensor_t*   src,     // source-side descriptor
    const ncclDistTensor_t*   dst,     // destination-side descriptor
    cudaStream_t              stream   // explicit stream, or default-stream sentinel
);

Feedback Period.

One week

CC List.

vLLM RL: @hao-aaron @SumanthRH @kylesayrs @kouroshHakha
nccl-m2n: @spotluri @kaushik-ks @kingchc @pkousha @xiaofanl-nvidia

Any Other Things.

Similar usage

nccl-m2n in vllm-project/vime:

Co-design opportunity

The current vLLM NCCL backend does a simple broadcast (trainer rank 0 → all inference ranks, same tensor layout). nccl_m2n is more powerful but also needs more metadata from the caller — callers need to describe mesh topology for both sides. This requires vLLM to know the training parallelism layout, which it currently doesn't track. We wonder if it would be possible to extend the WeightTransferEngine to convey the sharding metadata.

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions