Skip to content
Inference Academy

Multi-GPU interconnects: PCIe, NVLink, NVSwitch and InfiniBand

How GPUs talk to each other inside a server and across a cluster: PCIe, NVLink and NVSwitch for scale-up, InfiniBand, RoCE and RDMA for scale-out, the collectives that run over them (all-reduce, all-to-all) and why latency, not bandwidth, decides small messages. A runnable cost model shows what each link costs tensor parallelism, MoE expert parallelism and KV-cache transfer, and how to map each kind of parallelism onto the right fabric.

By

20 min · verified 2026-116 animated diagramsPro
Share

One GPU stops being enough as soon as the weights, the KV cache or the traffic outgrow it. From then on, every design choice in serving depends on one question: how fast can these GPUs talk to each other? This lesson covers the links that answer it (PCIe, NVLink, NVSwitch, InfiniBand and RoCE), the communication patterns that run over them, and a cost model you can run to see what each link costs real serving work.

You need Python 3 and nothing else. Numbers in the model are rough planning figures, not measurements; the last section shows how to measure your own.

#Why GPUs talk at all

Each way of splitting work across GPUs (model parallelism) has its own traffic:

Parallelism What crosses the link How often Size
Tensor (TP) All-reduce of activations Twice per layer, every step Small: batch × hidden × 2 bytes
Expert (EP) All-to-all: tokens out to experts, results back Twice per MoE layer, every step Medium: tokens × top-k × hidden
Pipeline (PP) Activations to the next stage Once per stage boundary Small
Disaggregated prefill/decode The KV cache of each prompt Once per request Large: often over 1 GB
Data parallel (replicas) Nothing per token Never None

Two things follow. Tensor and expert parallelism put communication inside every decode step, so it adds straight to time per output token. Pipeline and data parallelism barely talk, so they tolerate slow links. The whole job of mapping a model onto hardware is putting the chatty traffic on the fast links.

#Two networks, not one

A modern GPU cluster has two separate fabrics:

  • Scale-up: NVLink and NVSwitch (or AMD Infinity Fabric, Google ICI, UALink). Joins GPUs into one domain where any GPU can read and write another's memory directly at hundreds of GB/s to TB/s. Inside one server (8 GPUs) or one rack (72 GPUs).
  • Scale-out: InfiniBand or Ethernet with RDMA. Joins servers through a network card (NIC) per GPU and layers of switches. Reaches thousands of GPUs, at a tenth of the bandwidth or less.

Below both sits PCIe, the general-purpose bus every GPU has, which connects it to the CPU, the NICs and (on machines without NVLink) to other GPUs.

The bandwidth ladder: one KV cache, seven links
Animated
HBM (on the GPU)8,000 GB/s
NVLink 5900 GB/s
NVLink 4450 GB/s
InfiniBand XDR (800 Gb/s)100 GB/s
PCIe Gen5 x1650 GB/s
InfiniBand NDR (400 Gb/s)50 GB/s
25 Gb Ethernet3.1 GB/s

Send one 1.31 GB KV cache down each link

That is a 4,000-token prompt for a 70B-class model, the payload a prefill worker hands to a decode worker. Watch how long each link takes.

Animation time is scaled (PCIe's 26 ms takes 3 seconds). Bandwidth per GPU, per direction.

Link Per GPU, per direction Notes
HBM (B200, for comparison) about 8,000 GB/s Memory on the GPU itself
NVLink 5 (B200, GB200) 900 GB/s 1.8 TB/s quoted as both directions
NVLink 4 (H100, H200) 450 GB/s 900 GB/s quoted
PCIe Gen5 x16 about 64 GB/s (about 50 in practice) Gen4 is half, Gen6 double
InfiniBand XDR / 800 Gb Ethernet 100 GB/s 800 Gb/s per NIC
InfiniBand NDR / 400 Gb Ethernet 50 GB/s 400 Gb/s per NIC, common with H100
25 Gb Ethernet about 3 GB/s Typical cloud VM networking

Watch the units. Network speeds are quoted in gigabits per second (Gb/s), memory and NVLink in gigabytes (GB/s). Divide network numbers by 8. And NVIDIA quotes NVLink as the sum of both directions: 900 GB/s on an H100 means 450 GB/s each way. Mixing these up is the most common sizing mistake in this area, and it is off by 8× or 2×.

#PCIe: the bus everyone has

PCIe is a tree. The CPU's root complex sits at the top; GPUs, NICs and drives hang off it, often through PCIe switches. Two GPUs under the same switch can send data peer-to-peer; two GPUs on different CPU sockets have to cross the link between sockets, which is slower and adds latency.

That is why the topology matrix matters:

bash
nvidia-smi topo -m
Code Meaning Speed
NV# Connected by # NVLinks Fastest
PIX / PXB Through one or several PCIe switches Good
PHB Through the CPU's PCIe host bridge Slower
SYS Across CPU sockets Slowest

Consumer GPUs (RTX 40 and 50 series) have no NVLink, and peer-to-peer over PCIe is often disabled on them, so traffic bounces through CPU memory. Tensor parallelism across them works, but pays a larger tax (multi-GPU placement).

NVLink is NVIDIA's point-to-point GPU link. Each GPU has many links (18 on H100 and B200), and each generation roughly doubles the bandwidth:

Generation GPU Per GPU, both directions
NVLink 3 A100 600 GB/s
NVLink 4 H100, H200 900 GB/s
NVLink 5 B200, GB200, GB300 1.8 TB/s
NVLink 6 Rubin (Vera Rubin NVL72) 3.6 TB/s

Links alone give you a mesh where some pairs are connected and others are not. NVSwitch chips fix that: every GPU connects all its links to the switches, and the switches connect every GPU to every other at full speed. That is the HGX/DGX 8-GPU board, and it is why tensor parallelism across all 8 works.

The rack-scale systems extend the same idea out of the box. In a GB200 NVL72, 72 GPUs in one rack connect through 9 NVLink switch trays, 130 TB/s in total, so any GPU reaches any other at 1.8 TB/s. Vera Rubin NVL72 doubles that to 3.6 TB/s per GPU and 260 TB/s per rack. To software it looks like one 72-GPU node. That matters most for MoE: a model with hundreds of experts can spread them over 72 GPUs without any expert traffic leaving NVLink.

Two more features to know:

  • NVLink SHARP (on NVSwitch since the third generation): the switch does the reduction itself, so an all-reduce sends each GPU's data into the switch once and gets the sum back, instead of passing it around a ring. NCCL calls this algorithm NVLS.
  • NVLink-C2C connects a Grace or Vera CPU to its GPUs at about 900 GB/s, so CPU memory becomes a usable overflow tier (GPU generations).
How GPUs are wired: from a PCIe tree to a rack-scale NVLink domain
Animated

Per GPU, each way

~50 GB/s

Path

4 hops

Shows as

SYS

link between CPU sockets (SYS)CPU 0CPU 1PCIe switchPCIe switchPCIe switchPCIe switchGPU 0GPU 1GPU 2GPU 3GPU 4GPU 5GPU 6GPU 7

PCIe only: a tree through the CPUs

GPU 0 to GPU 4 goes up through a PCIe switch, across the link between CPU sockets, and down again: about 50 GB/s at best, with latency at every hop. nvidia-smi topo -m shows this pair as SYS.

The moving dot is one transfer between two GPUs. Green links are NVLink, blue are the network, amber is PCIe.

#InfiniBand, RoCE and RDMA: the scale-out network

Between servers, data goes through network cards. The key technology is RDMA (remote direct memory access): the NIC reads and writes the remote machine's memory itself, without the remote CPU or operating system getting involved. Latency drops from tens of microseconds (TCP) to a few, and the CPUs stay free.

GPUDirect RDMA goes one step further: the NIC reads straight from GPU memory and writes straight into the remote GPU's memory. Without it, every transfer is copied into CPU memory on both sides first.

Cross-server transfer, with and without GPUDirect RDMA
Animated

Without GPUDirect: staged through CPU memory

▣ GPU A→PCIe→CPU RAM→NIC→Network→NIC→CPU RAM→PCIe→▣ GPU B

8 hops

With GPUDirect RDMA: NIC to GPU memory directly

▣ GPU A→NIC→Network→NIC→▣ GPU B

4 hops

Two ways to send GPU memory to another server

Top: the data is copied into CPU memory on both sides. Bottom: GPUDirect RDMA lets the network card read and write GPU memory directly.

Two fabrics carry RDMA:

  • InfiniBand was built for it. Its switches use credit-based flow control, so they never drop packets, and a central subnet manager computes routes. Generations: HDR (200 Gb/s), NDR (400 Gb/s, ConnectX-7, the usual H100 pairing), XDR (800 Gb/s, ConnectX-8, with GB300). Switches can also reduce in the network (SHARP), like NVLink SHARP.
  • RoCE v2 (RDMA over Converged Ethernet) runs the same RDMA verbs over Ethernet. Ethernet drops packets when congested, so it needs careful tuning (priority flow control, congestion notification) or vendor fabrics such as NVIDIA Spectrum-X. Many clouds and large labs now run AI back-end networks on Ethernet; the Ultra Ethernet Consortium's specification aims to make that standard.

For applications the two look the same: NCCL, NIXL and similar libraries use RDMA verbs on either.

#Rail-optimised networks

A GPU server for AI has one NIC per GPU, typically 8 × 400 Gb/s on an H100 node. The fabric is wired so GPU 0 of every server connects to the same leaf switch ("rail 0"), GPU 1 to rail 1, and so on. Traffic between same-numbered GPUs crosses one switch; traffic between different rails either goes up to the spine or, more often, NCCL first moves it over NVLink to the GPU on the right rail inside the server. That is why the two fabrics work as a pair.

Even so, compare the numbers: an H100 has 450 GB/s of NVLink per direction and 50 GB/s of NIC. Leaving the server costs about 9× in bandwidth, plus more latency per hop.

Pro content

Keep reading with Inference Academy Pro

Unlock the rest of this lesson, including 3 animated diagrams, plus every advanced lesson, hands-on lab, the larger playground models and completion certificates.

Still to come in this lesson

  1. Collectives: what actually runs on the links
  2. A cost model you can run
  3. Mapping parallelism onto the fabric
  4. Beyond NVIDIA
  5. Measure your own
  6. What you can now do
  7. Common mistakes
  8. Exercise
  9. Going deeper

You will be able to answer

  • What is the difference between a scale-up and a scale-out network?
  • A spec sheet says 400 Gb/s InfiniBand. How many gigabytes per second is that, per direction?
  • In the lesson's model, why does a one-shot all-reduce beat a ring all-reduce at batch 1 on 8 GPUs?
  • What does GPUDirect RDMA remove from a cross-node transfer?
  • You serve a 70B model with TP=8 on one HGX server, and need more throughput. What should cross the InfiniBand link?

Articles that build on this lesson

Preparing for an interview?