Skip to content
DistML Course
Course contents
On this page

Part 1 · GPU Communication · Chapter 1

NVLink Scale-Up

Introduction

The GPU scale-up domain aims to connect dozens of GPUs with as much bandwidth as possible. Both NVIDIA and AMD GPUs have scale-up domains, but they implement different mechanisms under the hood.

  • In an NVIDIA NVSwitch system 1, each GPU connects to switches over NVLink. The switches give every GPU a path to every other GPU, so GPU A can use its full NVLink bandwidth to talk to GPU B (up to 450 GB/s in one direction on a DGX H100).
  • AMD’s eight-GPU MI300X platform 2 uses direct Infinity Fabric links. GPU A can talk to GPU B at up to 64 GB/s in one direction, and it can talk to all seven peers at the same time for a total of 7 × 64 = 448 GB/s.
  • AMD’s newer Helios platform uses a switched UALink-over-Ethernet fabric.

GPUs can read and write peer memory over the scale-up fabric just as they read and write their local memory. The table below shows the scale-up domain specs for different generations of GPUs. Note that the scale-up bandwidth figures in the table are per GPU, with read and write bandwidth combined. Take NVIDIA GB300 NVLink 5 3 as an example. It has 1.8 TB/s of bidirectional bandwidth per GPU, or 900 GB/s per direction. There are 18 links at 100 GB/s each, counting both directions. A copy from GPU 0 to GPU 1 therefore has a 900 GB/s ceiling.

Mentally, I usually think of NVLink 5 as dozens of RDMA NICs embedded around the edge of the GPU chip and using memory read/write semantics instead of RDMA messaging semantics. We will see a more literal version in Part 5 of the course: Meta’s MTIA 300 4 embeds RDMA NICs for scale-up and scale-out, and Microsoft’s Maia 200 5 integrates a NIC with a custom transport for Ethernet scale-up.

GPU in the specified systemHBM per GPUScale-up domainPeak send + receive per GPUGPUs in domainHow GPUs connect
A100 SXM40 or 80 GBDGX A100, NVLink 3600 GB/s8All-to-all via NVSwitch
H100 SXM80 GBDGX H100, NVLink 4900 GB/s8All-to-all via NVSwitch
B200 / B300 SXM180 / 288 GBHGX B200 / B300, NVLink 51.8 TB/s8All-to-all via NVSwitch
GB200 / GB300186 / 288 GBGB200 / GB300 NVL72, NVLink 51.8 TB/s72Rack-wide NVSwitch fabric
VR200 (Vera Rubin)288 GBVera Rubin NVL72, NVLink 63.0 TB/s72Rack-wide NVLink 6 switches
MI300X192 GBInstinct MI300X, Infinity Fabric896 GB/s8Seven direct peer links
MI350X288 GBInstinct MI350X, Infinity Fabric1,075.2 GB/s8Seven direct peer links
MI400 series (MI455X)432 GBAMD Helios3.6 TB/s72Switched UALink over Ethernet

Topology matters when interpreting the table. On MI300X, one peer gets one link, or 64 GB/s in one direction. Reaching the per-GPU total takes traffic to all seven peers. On GB300 NVL72, a single pair can use all 18 links through the switches. The Helios row describes the rack configuration, and the Rubin row uses NVIDIA’s NVL72 system specification.

Okay, enough talk. Let’s look at some code to set up the scale-up domain, transmit data with memory reads and writes, and finally handle the synchronization we need in real workloads.

Set up GPU IPC

Like CPU systems, GPUs have an IPC (interprocess communication) mechanism to enable communication between two GPUs. The GPUs may be used by the same process or by different processes. Suppose GPU 0 has just computed a tile in its own memory and we want GPU 1 to use it in its next matrix multiply. The following code snippet illustrates this example.

Let’s start on the receiving side. Process 1 calls cudaMalloc on GPU 1 and gets a pointer to the allocated memory, which we store in inbox. If we send that pointer directly to process 0 over a TCP socket, the address is invalid in process 0 because it has not been mapped into GPU 0’s address space. Instead, we will let process 1 export a CUDA IPC handle 6 for the allocation and send that handle to process 0, which then opens the handle to map the allocated memory region as peer_inbox. We can transfer the handle over a TCP socket, an MPI connection, or any other channel that can carry its opaque bytes.

// Receiver process, process 1, GPU 1
cudaSetDevice(1);
void* inbox;
cudaMalloc(&inbox, bytes);
cudaIpcMemHandle_t handle;
cudaIpcGetMemHandle(&handle, inbox);
send_handle_to_rank(0, handle);

// Sender process, process 0, GPU 0
cudaSetDevice(0);
cudaIpcMemHandle_t received = receive_handle_from_rank(1);
void* peer_inbox;
cudaIpcOpenMemHandle(&peer_inbox, received, cudaIpcMemLazyEnablePeerAccess);
// A kernel on GPU 0 can now store to peer_inbox.

Look at inbox and peer_inbox together. Both point into the same allocation on GPU 1. Process 1 uses the first pointer to read the tile. Process 0 uses the second to write it. So far, we’ve moved a handle across the socket and zero bytes of the tile. We can reuse this mapping for every tile. After the last transfer finishes, process 0 can call cudaIpcCloseMemHandle(peer_inbox) and tell process 1 it can free the buffer once its own work is done.

If our two GPUs are on different hosts in the same NVL72 rack, we can keep the same store in the kernel. What changes is how we obtain the peer pointer. The owner now creates an exportable allocation with cuMemCreate and shares a fabric handle (CU_MEM_HANDLE_TYPE_FABRIC). The sender imports it with cuMemImportFromShareableHandle, reserves and maps a virtual address, and grants GPU 0 access with cuMemSetAccess. With more peers, we can keep one mapped base pointer per rank. That’s how Hazy Research 7 lets a kernel find a remote tile using just a rank and an offset.

One important caveat often gets missed in practice. You can call cudaIpcGetMemHandle on any valid GPU memory address to get a handle, even if that address is at an offset within a region allocated by cudaMalloc. When the receiving process opens the handle, peer_inbox points to the base of that allocation rather than to the address at the original offset. We usually use cuMemGetAddressRange to find the base address and size in bytes of the allocation containing a given pointer.

Transmitting the data

Now we can pass peer_inbox to a kernel on GPU 0. Let’s cast it to the tile’s element type. If a thread has already computed its output in a register called result, the send is just peer_inbox[i] = result. That store crosses NVLink and lands in GPU 1’s memory.

  • If the tile starts in HBM, the thread also needs to load the data. Here’s the register copy from our benchmark, with src on GPU 0 and dst on GPU 1. Read the first loop from the perspective of two neighboring lanes. At the same j, they load adjacent 16-byte vectors. Now follow just one lane through all eight iterations. It can issue eight independent loads before the second loop needs any of the results. That’s how we keep more bytes in flight.
  • If our GEMM already has a whole tile in shared memory, we can use the Tensor Memory Accelerator (TMA). One thread can issue a bulk store from shared memory to peer_inbox, leaving the other threads free to work. A consumer can do the reverse with a TMA load from peer memory into its local shared memory.
  • For a whole contiguous tensor already sitting in HBM, we can also ask the copy engine (DMA) to do the work without using any SMs. From the host, we enqueue cudaMemcpyPeerAsync(dst, 1, src, 0, bytes, stream), which leaves the SMs available for our GEMM. Usually, only the host can invoke the DMA engine, but CUDA 13.5 8 (November 4, 2026) supports invoking it from a device kernel.
// src and dst are uint4 pointers. base indexes a full block-sized tile.
uint4 value[8];
#pragma unroll
for (int j = 0; j < 8; ++j)
  value[j] = src[base + j * blockDim.x + threadIdx.x];
#pragma unroll
for (int j = 0; j < 8; ++j)
  dst[base + j * blockDim.x + threadIdx.x] = value[j];

So how many SMs should we give the copy kernel? This depends on the specific GPU generation. Let’s try a 256 MiB push from HBM on one GB300 GPU to HBM on another over NVLink 5 (1.8 TB/s bidirectional bandwidth). We timed copies with CUDA events on the sender’s stream and limited each SM to one resident block, so launching 16 blocks gave the copy kernel 16 SMs. Each point below is the median of five batches of eight copies after warm-up. We checked the destination after every configuration. CUDA benchmark · Results

One-way bandwidth between two GB300 GPUs. Register and TMA copies both reach about 700 GB/s at 16 SMs and plateau. The copy engine reaches 768 GB/s.

Let’s start at 16 SMs. The register copy delivers 697 GB/s, and TMA delivers 699 GB/s. Now follow both curves all the way to 152 SMs. They end around 706 GB/s. At 16 SMs, we can leave the other 136 available for compute. If we can submit the whole transfer from the host, we can reach 768 GB/s on the dashed line with zero copy-kernel SMs. All three fall short of the 900 GB/s one-way link rate. This is because packet headers take up wire bandwidth, while the copy engine has smaller packet headers than the other two copy mechanisms.

Synchronization

We now turn to synchronization, the most complex topic in scale-up domain communication. Synchronization lets one GPU tell its peers when data is ready or has been fully consumed, so they can take the next step, such as consuming the data or reusing the buffer.

Suppose GPU 0 wants to send matrix tiles (blocks of elements) to GPU 1 for a matrix multiply. GPU 1 allocates a buffer called inbox with room for one tile. GPU 0 writes to it through peer_inbox. If GPU 1 reads while GPU 0 is replacing tile 1 with tile 2, it can get half of each, which causes correctness issues. To avoid this issue, we can use two counters, both initially zero. GPU 1 owns ready, which GPU 0 increments after writing a tile. GPU 0 owns consumed, which GPU 1 increments after its last read.

GPU 0 (sender)                        GPU 1 (receiver)
Write tile 1, increment ready.    →   Wait for ready == 1, then read tile 1.
Wait for consumed == 1.           ←   Finish reading, then increment consumed.
Write tile 2, increment ready.    →   Wait for ready == 2, then read tile 2.

In practice, the MSCCL++ semaphore implementation gives signal() release ordering and wait() acquire ordering, both at system scope. Once GPU 1 observes ready == 2, its subsequent reads see tile 2’s writes. If several threads in a block wrote the tile, we synchronize them before one signals. For TMA stores, we also wait for the stores to finish. A memory fence orders writes, but GPU 1 still needs a counter or flag to poll.

A counter works well when we need the whole tile. For smaller messages, we can mark each piece as it arrives.

  • LL8 packs a 4-byte value and a 4-byte message number, called an epoch, into one aligned 8-byte packet. GPU 1 reads both fields in one load, so it can distinguish (42, 1) from (42, 2) even when the value is unchanged.
  • LL128 uses one 8-byte epoch flag for 120 bytes of data in a 128-byte line. GPU 1 waits for the expected epoch before consuming the line. This relies on the link making all 120 data bytes visible by the time GPU 1 sees the new flag. This works because NVLink transmits data in units of at least 128 bytes.
  • A sentinel 9 is a value reserved to mean “empty.” For positive integers, we can reserve zero, consume each nonzero value, and reset the slot to zero. All three still need an acknowledgement or a schedule that prevents GPU 0 from overwriting unread data.

The following table shows the round-trip times we measured with one warp running on each GB300 as we sent 120 bytes each way (one LL128 line or 30 LL8 packets). GPU 1 received the full message before replying. Round-trip time (RTT) includes polling, payload checks, and sentinel resets, and excludes kernel launches. Both GB300 benchmarks report the median of five run averages, each over 8,192 round trips after 256 warm-ups. CUDA benchmark for all four protocols · Results

ApproachMeasured RTTHow GPU 1 detects arrivalTradeoff
Release/acquire counter8.30 µsready reaches the tile number.One separate signal covers a whole tile.
LL83.06 µsOne load returns a 4-byte value and its 4-byte epoch together.Each value is usable immediately. Half the packet carries data.
LL1283.42 µsAn 8-byte flag marks 120 bytes of data as ready.93.75% of the packet carries data. The path must make the data visible before or with the flag.
Sentinel4.86 µsA slot changes from “empty” to a valid value.No flag bytes. We need a spare bit pattern and must reset each slot after use.

Remark

The scale-up domain is what makes GPU communication distinct from traditional CPU communication. Compared to the scale-out domain or RDMA we’ll see later, the scale-up domain has enough flexibility and bandwidth to support complex, communication-heavy operations like MoE layers. You can see this in fused kernels and megakernels for MoE such as DeepGEMM/MegaMoE, DistMoE, and Mixture-of-Kittens. A kernel can dispatch tokens to peers, run the expert GEMMs as tiles arrive, and send the results back. Inside an NVL72 domain, that lets communication overlap with the work that delivers the compute FLOPs.

References

Footnotes

  1. NVIDIA. NVIDIA DGX H100/H200 User Guide, “Introduction to NVIDIA DGX H100/H200 Systems.” https://docs.nvidia.com/dgx/dgxh100-user-guide/introduction-to-dgxh100.html ↩

  2. AMD. AMD Instinct MI300X Platform. Data sheet. https://www.amd.com/content/dam/amd/en/documents/instinct-tech-docs/data-sheets/amd-instinct-mi300x-platform-data-sheet.pdf ↩

  3. NVIDIA. NVIDIA NVL72 AI Factory, “System Hardware & Components.” https://docs.nvidia.com/enterprise-reference-architectures/nvl72-ai-factory/latest/components.html ↩

  4. Engineering at Meta. MTIA 300: Meta’s First Training Chip with Built-in NICs and Communication-Offloading Engines. August 24, 2026. https://engineering.fb.com/2026/08/24/networking-traffic/mtia-300-meta-training-chip-built-in-nics/ ↩

  5. Scott Guthrie. Maia 200: The AI accelerator built for inference. Official Microsoft Blog, January 26, 2026. https://blogs.microsoft.com/blog/2026/01/26/maia-200-the-ai-accelerator-built-for-inference/ ↩

  6. NVIDIA. CUDA Programming Guide, “Interprocess Communication.” https://docs.nvidia.com/cuda/cuda-programming-guide/04-special-topics/inter-process-communication.html ↩

  7. Stuart Sul, Dylan Lim, Benjamin Spector, and Chris Ré. One Kernel for All Your GPUs. Hazy Research, September 22, 2025. https://hazyresearch.stanford.edu/blog/2025-09-22-pgl ↩

  8. Jonathan Bentz. NVIDIA CUDA 13.5 Brings NVIDIA Vera Rubin GA Support. NVIDIA Technical Blog, November 4, 2026. https://developer.nvidia.com/blog/nvidia-cuda-13-5-brings-nvidia-vera-rubin-ga-support/ ↩

  9. Siyuan Shen et al. Every Microsecond Matters: Achieving Near Speed-of-Light Latency in GPU Collectives. arXiv:2607.16100, 2026, §IV. https://arxiv.org/pdf/2607.16100 ↩