Debarshi Das

Explainer

NCCL vs NIXL: which bytes each one moves in LLM inference

NCCL vs NIXL in LLM inference: NCCL collectives for tensor and expert parallelism, NIXL transfers for KV cache state, which vLLM and SGLang backends use each, and how each library is growing into the other's job.

By Debarshi Das. Published . Updated .

9 min read

  • LLM inference
  • NCCL
  • NIXL
  • GPU networking
  • KV cache
  • Disaggregated serving

People ask whether an inference stack should use NCCL or NIXL, as if one could replace the other. In a serving engine today, both run at once. They move different bytes for different reasons.

Inference moves bytes between GPUs for two jobs. The first is parallel compute. A model too large or too slow for one GPU is split across several, and each forward pass combines the pieces' results. The second is state movement. A request's KV cache leaves the GPU that computed it, for another GPU, host memory, a disk or a network store.

NCCL was built for the first job, and NIXL for the second. Over the last year, each library has added features that reach into the other's job. So the useful question is which job a given byte is doing, and which library each engine uses for it.

Two jobs with different shapes

On a network graph the two jobs look alike: bytes leave one GPU's memory and arrive in another's. They differ in almost everything else.

The two reasons bytes cross between GPUs during inference.
Parallel computeState movement
ExamplesTensor-parallel all-reduce, expert-parallel dispatch and combinePrefill-to-decode KV handoff, offload to host memory or disk, a shared KV store
Who takes partA fixed group of GPUs, all at the same stepAny two parties, each when it is ready
How oftenEvery layer of every forward passAbout once per request, or once per eviction
Memory involvedGPU memoryGPU memory, host memory, files, block devices, object stores
On the critical pathAlways: the next layer waits for itOften hidden: overlapped with compute, or before the first token
When a peer failsThe whole group stopsOne transfer fails, and the request can recompute

The last row matters most in production. A collective needs every member to arrive. A transfer involves two parties, and either one can fail without stopping anyone else.

What NCCL is for

NCCL, the NVIDIA Collective Communications Library, implements collectives over NVLink, PCIe, InfiniBand and RoCE: all-reduce, all-gather, reduce-scatter, all-to-all and broadcast. It has also had point-to-point send and receive for years. A communicator names a fixed group of ranks, and every rank calls the same operation in the same order.

Inference calls it on the hot path. Under Megatron-style tensor parallelism, each transformer layer ends its attention block and its MLP block with an all-reduce. A 61-layer model therefore runs 122 all-reduces per forward pass, while its KV cache crosses to a decode GPU once per request. Under expert parallelism, each mixture-of-experts layer sends every token to the GPUs that hold its experts and brings the results back. Those two steps, dispatch and combine, are both all-to-all patterns.

Two GPUs: 122 NCCL all-reduces build one 61-layer pass in lockstep; one KV cache crosses once over NIXL.Hover a part to see its name
Two GPUs, two jobs: over NCCL they meet in an all-reduce twice per layer, 122 times in one 61-layer pass; over NIXL one KV cache crosses once per request.

NCCL is not the only library on that path. For small all-reduces inside one NVLink domain, vLLM tries its own kernels first: quick-reduce, a custom all-reduce, symmetric memory and FlashInfer. It falls back to NCCL through PyNcclCommunicator. SGLang has a custom all-reduce and MSCCL++ beside NCCL in the same way.

What NIXL is for

NIXL, the NVIDIA Inference Xfer Library, is part of the NVIDIA Dynamo project and moves data between agents. An agent registers memory and describes it as lists of buffers. It exchanges that description with a peer, then posts a read or a write between the two lists. No third party has to take part.

Its memory types show what it was built for: GPU memory, host memory, block devices, objects and files. One API sits over many backends, chosen per transfer. At NIXL 1.5.2, the plugins cover UCX and Libfabric for RDMA and EFA, UCCL, GPUDirect Storage, POSIX files, 3FS, DAOS, Redis, S3-style object stores, Azure Blob, Mooncake and GPUDirect-TCPXO, among others. NIXL 1.0, released in March 2026, marked its API as stable.

Six layer boards named LINK up to DYNAMO, every status lamp lit blue, and the KV cache at the bottom on the link.Hover a part to see its name
Six layers: Dynamo routes and plans, the engine runs the model, the connector hands off the cache, NIXL chooses how it moves, and the transport and the link carry the bytes.

Which engine uses which, today

The libraries vLLM and SGLang offer for each job, at the commits in the references.

JobvLLMSGLang
Tensor-parallel all-reduceCustom kernels for small messages, NCCL otherwiseCustom all-reduce, MSCCL++ or NCCL
Expert-parallel all-to-all

Default depends on the GPU: allgather and reduce-scatter on Hopper, FlashInfer on Blackwell systems. DeepEP, MoRI, MoonEP or NIXL-EP by choice

DeepEP, Mooncake, NIXL, MoRI, FlashInfer or MegaMoE by choice
Prefill-to-decode KV handoffNIXL, Mooncake or MoRI-IO connectorsMooncake, NIXL, MoRI or Ascend
Offload to lower tiersNative connectors, LMCache, Mooncake StoreHiCache, with NIXL as one storage backend

Both engines keep NCCL under tensor parallelism, and both now accept NIXL as one choice for expert-parallel all-to-all. For KV handoff, NIXL is one of three or four backends in each engine, beside Mooncake. TensorRT-LLM goes further: its disaggregated-serving guide names NIXL as the backend to set, and its C++ cache transceiver is deprecated as of version 1.4.

NCCL is moving toward state

NCCL's release notes for the last eighteen months show a pattern. Each release adds a way to move data that is not a classic collective.

NCCL features that reach past collectives, by the release that added them.
ReleaseWhat it added
2.27.3

Symmetric memory windows (ncclCommWindowRegister) and communicator shrinking (ncclCommShrink)

2.28.3, October 2025An experimental device API: communication called from inside an application kernel
2.28.7, October 2025GPU-initiated networking (GIN): a kernel posts network operations without the CPU
2.29.2, December 2025One-sided host APIs, and ncclCommGrow to add ranks back after a failure
2.30.3, April 2026Elastic buffers, and GIN timeouts and resource sharing
NCCL EP 0.1.0, June 2026A separate extension for mixture-of-experts dispatch and combine
2.30.7, June 2026All-gather and all-to-all that use copy engines instead of GPU cores
2.31.2, August 2026Device-side put, get and reduce on registered windows; an EFA backend for GIN
2.32.3, September 2026GIN over TCP sockets

One-sided put and get is how state moves: one party writes into another's memory, and the other does not take part. Growing and shrinking a communicator lets a group survive a lost member. Those are the two properties the parallel-compute column of the first table lacked.

NIXL is moving toward compute

NIXL moved the other way. Version 0.6 previewed a device API, so that a GPU kernel can post transfers itself. Version 0.10 introduced its second version, and version 1.0 finalized it. Version 1.5 opened it to Python and Rust. Version 1.1, in May 2026, added a high-throughput dispatch and combine path for its expert-parallel example, NIXL-EP. vLLM now offers nixl_ep among more than a dozen expert-parallel all-to-all backends, and SGLang accepts nixl there too.

So both libraries now offer mixture-of-experts dispatch, and expert parallelism is where the two jobs meet. Dispatch looks like a collective, because every GPU sends to every other GPU in the same layer. It also looks like state movement, because each GPU sends a different, data-dependent amount to each peer, which suits a one-sided write into the peer's buffer.

Neither library invented this. DeepEP, built on NVSHMEM and InfiniBand GPUDirect Async, showed GPU-initiated dispatch first. NCCL's GIN and NIXL's device API are both catching up to that design.

The network card is shared

On many GPU servers, NCCL's collectives and NIXL's KV transfers leave through the same network cards. Neither library schedules around the other's traffic. A large KV handoff can therefore share a link with a decode step's all-to-all.

NCCL lets you put its traffic in its own InfiniBand traffic class with NCCL_IB_TC, and since 2.30.7 its GIN traffic with NCCL_GIN_IB_TC. With a matching switch policy, collective traffic and bulk KV transfers can sit in separate queues. Whether that matters on your cluster is a measurement: run the decode step with and without KV transfers on the same cards.

Where to draw the line

Start from what the byte is for.

  1. Every rank must arrive at the same step: tensor-parallel reductions and gathers. Use NCCL, or the engine's custom kernels for small messages inside one NVLink domain.
  2. Two parties exchange state when each is ready, across memory kinds: KV handoff, offload, a shared store. Use NIXL or Mooncake. Both handle host memory, and a failed transfer does not stop a group.
  3. Expert-parallel dispatch and combine: measure. The choice now spans NCCL EP, NIXL-EP, DeepEP, FlashInfer and vendor libraries. The winner depends on message size, GPU cores used, NVLink domain size and the network.
  4. Anything that shares a network card with a collective: give it its own traffic class, or measure what it costs the decode step.

How to check which path you got

A library that cannot use the fast path often takes a slow one without an error. Check before you trust a number.

A KV cache has crossed to the decode GPU over RDMA; the same cache over TCP waits at the prefill card in ember. 98 s.Hover a part to see its name
The same KV cache on two paths: over RDMA it has reached the decode GPU, and over TCP it has barely left.
  • Run with NCCL_DEBUG=INFO and read which transport each NCCL channel chose.
  • Measure NIXL's pairwise rate with nixlbench from the NIXL repository, and compare it with the bandwidth your engine achieves for KV transfers. NIXL exports transfer-time histograms to Prometheus since version 1.5.
  • Read the network cards' RDMA byte counters during a run. KV bytes that should cross RDMA and do not are a fallback.
  • For storage tiers, run gdscheck -p and confirm that GPUDirect Storage is not in compatibility mode.

Questions engineers ask

What is NIXL?

NIXL is NVIDIA's inference transfer library. It moves buffers between agents across GPU memory, host memory, files, block devices and object stores, over backends such as UCX, Libfabric and GPUDirect Storage. Disaggregated serving uses it to move the KV cache from prefill to decode.

Can NCCL replace NIXL for KV transfer?

It is getting closer: one-sided put and get and device-initiated networking were the parts it lacked. It still works between ranks of one group, in GPU memory. KV offload also needs host memory, files and object stores, and peers that come and go.

Can NIXL replace NCCL for tensor parallelism?

Not today. A tensor-parallel all-reduce on every layer needs collective algorithms tuned per topology, such as rings, trees and NVLink SHARP. NIXL moves buffers between two agents. It does not implement reductions.

What is the difference between NIXL and UCX?

UCX is one of NIXL's backends. NIXL adds the agent model, memory registration across memory kinds, and other backends behind the same API, so an engine can move KV to a GPU, a file or an object store with one call.

Is NIXL only for NVIDIA GPUs?

No. NIXL 1.3 added AMD ROCm support for MI300X, MI325X, MI350X and MI355X, and its Libfabric backend serves AWS EFA.

References

Choose a style to copy