Skip to main content
Back

NVIDIA's NCCL EP Unifies Fragmented MoE Communication Into One Open Library

NVIDIA folds MoE dispatch and combine kernels natively into NCCL, unifying training and inference expert parallelism under one API.

Pro

  • NVIDIA released NCCL EP, an expert-parallel MoE communication library built on NCCL's Device API.
  • Unified ncclEpDispatch and ncclEpCombine primitives replace mode-specific APIs used by DeepEP and pplx-kernels.
  • Low-Latency mode targets inference decode (1-128 tokens); High-Throughput mode targets training and prefill (4096+ tokens).
  • Optimized LL buffer layout cuts memory footprint by roughly 14x for 64 ranks, 512 experts, top-k 8.
  • Matches or beats DeepEP on dispatch throughput at 2-8 nodes; trails 5-12% on combine at smaller scales.
  • Ships with C and Python APIs plus integrations for vLLM and Megatron-LM.

Mixture-of-Experts models have made GPU communication the bottleneck of large model training and serving. Every forward pass through a MoE layer requires shuffling tokens across dozens or hundreds of GPUs based on gating decisions that change on every step. NVIDIA has now released NCCL EP, an expert-parallel communication library built directly on top of the NCCL Device API, aiming to consolidate a fragmented ecosystem of MoE kernels into the standard collective library everyone already uses.

Why MoE broke the collective communication model

Standard collectives like AllReduce assume every rank exchanges the same amount of data with every other rank. MoE dispatch and combine violate that assumption in every way that matters. Routing patterns change every forward pass based on learned gating decisions, each GPU pair exchanges different amounts of data depending on routing, popular hot experts receive more tokens creating asymmetric volumes, and the operations need fused compute like quantization and custom reductions.

To cope, teams built specialized libraries: DeepSeek's DeepEP, Perplexity's pplx-kernels, NVIDIA's own Hybrid-EP, Meta's NCCLX, AMD's MORI. Each one is fast, but they require separate communication stacks distinct from NCCL, expose mode-specific APIs that complicate integration, and force teams to maintain multiple runtime environments while giving up NCCL's topology awareness, elasticity, and fault tolerance.

NCCL EP architecture diagram

One API, two personalities

NCCL EP exposes just two primitives, ncclEpDispatch and ncclEpCombine, but internally supports two very different algorithms selected at group creation:

  • Low-Latency (LL) mode for inference decoding. Targets small batches of 1 to 128 tokens using direct all-to-all RDMA plus NVLink mesh connectivity with double-buffered communication for overlapping dispatch and combine phases. The LL kernel design is adapted from DeepEP.
  • High-Throughput (HT) mode for training and prefill. Targets large batches of 4096 or more tokens using hierarchical communication that aggregates tokens within NVLink domains before inter-node RDMA transmission. The HT kernel design is adapted from Hybrid-EP.

Both modes lean on the NCCL Device API introduced in NCCL 2.28, which lets GPU kernels initiate RDMA operations directly without CPU involvement through primitives like ncclGin_Put, ncclGin_Get, and ncclGin_SignalAdd for atomic remote counter increments. Intra-node traffic uses NVLink through direct load/store instructions on peer GPU memory pointers; inter-node traffic uses GPU-initiated networking (GIN) over RDMA. If NVLink isn't available, it falls back to PCIe.

The memory optimization worth reading the paper for

The most concrete algorithmic contribution is a rework of the LL communication buffer. In the original DeepEP design, the buffer for both dispatch and combine scales as O(E·B·P), where E is the number of experts, B is the batch size, and P is the per-token payload, and double buffering doubles that again. Since batch size B is reserved per expert but no expert actually receives all tokens, most of that memory sits idle.

NCCL EP restructures this by putting routing information in the message header instead of encoding it through buffer layout. A token is sent once per destination rank rather than once per expert, dropping the dispatch buffer to O(N·B·P). Combine goes even further to O(B·K·P) where K is the top-k value. For 64 ranks, 512 experts, and top-k of 8, this yields roughly a 14 times reduction in memory footprint.

How the kernels are structured

LL dispatch runs three steps across the SMs of a GPU: counting tokens per expert, packing token payloads and writing them directly into a peer's receive sub-region, then issuing an update-and-flush counter increment so the receiver knows data has arrived. For NVLink neighbors, the counter update uses store-release and load-acquire operations on shared memory; for RDMA peers, a zero-byte NCCL GIN put with signal-add serves the same purpose. Combine reverses the flow using cached routing info from the dispatch handle, with reduction groups of warps using Tensor Memory Accelerator loads to pull expert outputs into shared memory and pipeline the weighted sum.

The HT kernel is a persistent warp-specialized pipeline: one warp group reads tokens from local GPU memory into shared memory FIFOs using TMA, another handles inter-node communication (now via NCCL GIN instead of IBGDA), and a third writes tokens to destination buffers on all GPUs within the local node via NVLink. Combine adds hierarchical reduction warps that accumulate partial results within a node before crossing to remote nodes.

Results on H100

Evaluation ran on NVIDIA's EOS cluster with H100 80GB nodes connected by 8×400 Gbit/s InfiniBand. The head-to-head with DeepEP configured to use the same NCCL transport is close: for dispatch, NCCL EP matches or exceeds DeepEP at 2 to 8 nodes with a notable advantage at 64 GPUs while trailing by around 4% at single-node; for combine, it trails by 5 to 12% at 1 to 4 nodes and converges at 8 nodes.

LL dispatch throughput comparison across GPU counts

Note that NCCL EP reports host-side C API time including kernel launch overhead, whereas DeepEP reports GPU kernel execution time from PyTorch's Kineto profiler, so the effective NCCL EP kernel throughput is higher than shown.

End-to-end vLLM 0.10 serving with Qwen3-30B-A3B tells a slightly less flattering story: NCCL EP trails DeepEP (running its default NVSHMEM/IBGDA backend) by 7 to 10% in output throughput and 7 to 9% in inter-token latency across 8, 16, and 32 GPU configurations. The team attributes this to the LL combine gap and lists further optimization as ongoing work.

What to actually use it for

NCCL EP is already integrated as a backend in both vLLM (as nccl_high_throughput and nccl_low_latency) and Megatron-LM's Flex dispatcher. It ships in the NCCL GitHub repository with both a C API for framework developers and Python bindings via ctypes. The library is currently marked experimental, and HT-mode benchmarks plus Megatron-LM training numbers are still pending optimization.

The pitch is less about beating DeepEP on raw microbenchmarks and more about consolidation. If you already ship NCCL, you inherit MoE communication with topology detection, network plugin architecture, and fault handling baked in, without adding NVSHMEM, IBGDA configuration, or vendor-specific proxies to your deployment stack.