arXiv(opens in a new tab)cs.DCOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.07516

NCCL M2N: A Layout- and Topology-Aware Collective for Distributed Tensor Resharding

Kaushik Kandadi, Youngeun Kwon, Sreeram Potluri, Ching-Hsiang Chu, Ke Wen, Pouya Kousha, Sangkug Lym, Nitin Nitin, Manjunath Gorentla Venkata

Kaushik Kandadi, Youngeun Kwon, Sreeram Potluri, Ching-Hsiang Chu, Ke Wen, Pouya Kousha, Sangkug Lym, Nitin Nitin, Manjunath Gorentla Venkata NVIDIA Corporation

{kkandadisure, youngeunk, spotluri, chichu, kwen, pkousha, slym, nitin, manjunath}@nvidia.com

Abstract—Distributed deep learning training partitions tensors across a process mesh according to a parallelism configuration, producing a corresponding sharding and replication layout. Reinforcement learning with verifiable rewards (RLVR) often uses different layouts for policy training and rollout generation; crossing this boundary requires resharding from one layout to another: the M-to-N layout redistribution problem, in which M source ranks collectively hold a global tensor in one layout and N destination ranks need it in another. This pattern is absent from today's collective libraries: flat direct sends duplicate every source contribution across destination replicas, while gather-then-broadcast concentrates traffic at one root and over-delivers the full tensor. These workarounds are costly: with legacy all-gather plus broadcast, RL weight sync accounts for 29.4% of the reported RL step time for DeepSeek-V3 at 256 GPUs.

We present NCCL M2N, a collective primitive implemented in NCCL Extensions for cross-layout sharded-tensor transfer. It automatically derives the transfer schedule from the layout endpoints. Compared with flat direct sends and gather-then-broadcast, the collective provides: (1) layout-derived traffic — only bytes required by the destination layout are transferred; (2) load-balanced NIC usage — source contributions are distributed across eligible destination leaders; and (3) topology-aware routing — replicated fan-out stays within an NVLink domain while a pipelined ring carries one copy between domains.

We evaluate NCCL M2N on up to 256 GB200 GPUs in an NVL72 cluster with NDR InfiniBand. On a single FFN-MoE layer transfer, NCCL M2N achieves up to 7.9×7.9 \times speedup over flat direct sends (9.8 ms vs. 77.3 ms), closely tracking the aggregate data-movement bound. In a non-colocated DeepSeek-V3 NeMo-RL run, NCCL M2N reduces the reported weight-sync time from 5.78 s to 2.77 s (2.09×), reducing step time by 12.7% over legacy all-gather plus broadcast.

Index Terms—collective communication, distributed deep learning, reinforcement learning, sharded tensor, resharding, NCCL, GPU interconnect

I. INTRODUCTION

Distributed deep learning training partitions model tensors across graphics processing units (GPUs) using various parallelism strategies such as data parallelism (DP), tensor parallelism (TP), pipeline parallelism (PP), and expert parallelism (EP) [1]–[3] to leverage the high-performance computing power of GPU clusters. As a result, these choices define each tensor's layout: how the data are sharded or replicated across the GPUs in the so-called process mesh. Modern frameworks expose this abstraction as distributed tensors, including PyTorch DTENSOR [4], GSPMD (general and scalable parallelization for machine-learning computation

TABLE I LEGACY ALL-GATHER-PLUS-BROADCAST WEIGHT-SYNC COST AS A FRACTION OF REPORTED RL STEP TIME.

ModelScaleRefit share
DeepSeek-V3256 GPUs29.4%

graphs) [5], and Alpa [6]. Application code can then reason about a tensor's global shape while the runtime manages local placement.

Modern large language model (LLM) workflows routinely require resharding tensors from one layout to another as parallelism changes across phases. In such an M-to-N layout reshard operation, M source ranks collectively hold a tensor in one layout and N destination ranks require it in another. The runtime must derive the overlapping tensor regions, deliver each region to every required replica, and coordinate ranks that do not belong to the same process group. RLVR-style training exposes this operation directly: it alternates rollout generation and policy updates, often using different parallel layouts for the generator and trainer. After each update, policy weights must be resharded and transferred across the process-group boundary before the next rollout begins. We refer to this synchronization phase as weight refit. Recent frameworks (NeMo-RL [7], OpenRLHF [8], and HybridFlow/verl [9]) expose such a phase. The RL weight refit step, which transfers updated policy weights from trainer to generator after each training step, is the most costly instance of this pattern. It becomes one of the major performance bottlenecks as it sits directly on the critical path, where generators cannot begin the next rollout batch until new weights arrive. Our profiling of DeepSeek-V3 at 256 GPUs showed that legacy all-gather plus broadcast weight sync accounted for 29.4% of the reported RL step time (Table I), a substantial share of the end-to-end step.

Despite this cost, today's communication stack does not express this cross-group resharding operation natively. The resulting workarounds expose two primary limitations:

(i) flat direct sends duplicate every source contribution across destination replicas; and

(ii) gather-then-broadcast avoids source-side duplication but concentrates traffic at one root and over-delivers the full tensor, wasting network bandwidth.

To address these problems, this paper proposes a layout-derived reshard collective primitive and a topology-aware routing optimization. The collective derives one global transfer schedule from the source and destination layouts, including exact overlap regions, replica ownership, and disjoint process groups. The route sends one copy of each contribution per destination NVLink domain, balances injection across eligible NICs, forwards copies between domains, and performs replica fan-out locally over NVLink. These choices remove replica-multiplied network traffic while preserving the semantics of M-to-N layout changes expressible by the supported descriptors (§III, §V).

This paper makes the following contributions.

(1) A first-class M-to-N reshard collective primitive with mesh-and-placement descriptors. It derives exact transfer regions across tensor dimensions, mismatched replica counts, cross-dimension sharding, and disjoint trainer/roll-out process groups (Sections §III, §IV).

(2) A topology-aware routing optimization that removes inter-node replica redundancy, balances NIC injection under shard imbalance, and performs local fan-out over NVLink while forwarding one copy across domains (Section §V).

(3) An evaluation of the hierarchical route on an NVIDIA GB200 NVL72 cluster. The measured route achieved up to a 7.9×7.9\times speedup for a single FFN-MoE layer transfer (9.8 ms versus 77.3 ms). In a separate non-colocated 256-GPU DeepSeek-V3 NeMo-RL run, NCCL M2N reduced the reported weight-sync time by 2.09×2.09\times and reduced step time by 12.7% over legacy all-gather plus broadcast (Section §VI).

References (22)