AI Infra
0%
Part IX · Chapter 62

Accelerators and Networking

AuthorChangkun Ou
Reading time~12 min

A training run lives or dies on bandwidth, not peak FLOPs. The useful view is a bandwidth hierarchy: the high-bandwidth memory (HBM) sitting beside the accelerator die feeds a chip; NVLink and NVSwitch connect accelerators inside a node; and InfiniBand or RoCE carry bytes between nodes. That hierarchy explains why a tensor-parallel group almost never spills past the NVLink boundary, why data and pipeline parallelism can cross the network, and how model FLOPs utilization measures whether the hardware floor is being used.

A run that the spec sheet cannot explain

Picture a frontier run spread across thousands of accelerators for weeks. The spec sheet promises a peak arithmetic rate, and the run delivers a fraction of it. The missing factor is rarely the matrix-multiply units sitting idle for want of work. It is the bytes those units wait on: how fast a chip reaches its own memory, the rate at which two chips in a chassis can talk, and what a message costs to travel between two chassis across the hall. Those three numbers differ by more than an order of magnitude each step out, and a parallelism axis that needs more talking than its tier can afford stalls the whole collective, the coordinated cross-device communication operation it depends on.

So the spec sheet's peak FLOPs is the wrong place to start. The right place is the hierarchy of bandwidth tiers underneath it, because every layout decision is a question of which tier a given exchange can afford. Here the hardware floor means the accelerators, the interconnect hierarchy, and the single number, MFU, that says whether the floor is being used. The parallelism algorithms built on top belong to Chapter 10; cluster orchestration, checkpointing, and the data plane belong to Chapter 65.

Three tiers of bandwidth

The machine is a hierarchy of bandwidth tiers, and tracing a byte from the die outward shows why each tier exists and what it can host.

The innermost tier is a chip and its memory. An accelerator pairs a large matrix-multiply throughput with HBM sitting next to the die. The forward and backward matmuls are fed from HBM, so HBM bandwidth, not raw FLOPs, often sets the achievable rate for a kernel.

Drag the ceiling to see why a kernel that does little work per byte fetched stays bandwidth-bound and never reaches the peak FLOPs the spec sheet promises.

Figure 62.1. A kernel ramps with how much arithmetic it does per byte it pulls from HBM, then flattens once it hits the hardware's peak FLOPs ceiling.

The next tier is intra-node: the few accelerators inside one chassis. On NVIDIA hardware these are wired with NVLink, a dedicated chip-to-chip fabric, and NVSwitch, which lets every accelerator in the node reach every other at full NVLink bandwidth rather than over the slower PCIe bus. This tier is where the most communication-hungry axis can live, because NVLink bandwidth is high enough to hide a collective behind compute. Whether a collective hides at all is a ratio, as Figure 62.2 sketches: as long as a step does more compute than communication the collective vanishes entirely under it, and the inter-node network falls short precisely because its bytes are dear enough to leave some communication exposed.

2026-06-21T21:26:43.288040 image/svg+xml Matplotlib v3.11.0, https://matplotlib.org/
Figure 62.2. Schematic of how much of a collective hides under compute as a function of the compute-to-communication ratio, after Shoeybi et al. (2019) and Narayanan et al. (2021). The NVLink tier sits where the ratio is high and the collective vanishes entirely; the inter-node network sits where bytes are dearer, so some communication stays exposed.

The outermost tier is inter-node: chassis talking to chassis across a datacenter network. Here the fabric is InfiniBand or RoCE (RDMA over Converged Ethernet), wired in a topology such as a fat-tree or a rail-optimized layout, with a network interface card (NIC) per accelerator setting the per-device injection bandwidth. This tier is an order of magnitude slower per byte than NVLink, so only axes that communicate sparingly can afford to span it.

cluster_chip chip + HBM cluster_node intra-node (one chassis) cluster_cluster inter-node (across the hall) A accelerator die M high-bandwidth memory A->M HBM bandwidth G1 GPU A->G1 G2 GPU G1->G2 NVLink / NVSwitch N1 node G1->N1 N2 node N1->N2 InfiniBand / RoCE
Figure 62.3. The three bandwidth tiers of a training cluster. Each step outward, from HBM to NVLink to the inter-node network, drops roughly an order of magnitude in bandwidth per byte.
Figure 62.4. The same three tiers, now with a byte in flight on each lane. The HBM byte crosses on-package while the inter-node byte is still crawling, the order-of-magnitude drop per step that decides which parallelism axis can afford which tier. Relative speeds, illustrative.

Mapping parallelism onto the tiers

Once the tiers are fixed, the placement of each parallelism axis follows directly, and it follows from communication volume, not from taste. Tensor parallelism (TP) shards a single matmul across devices and exchanges activations, the intermediate values passed between devices, with an all-reduce, in which every device sums its partial result with all others, twice per layer, so it is the most bandwidth-hungry axis and is pinned to the NVLink tier inside a node (Shoeybi et al. 2019). Data and pipeline parallelism communicate far less per step, a gradient reduction once per step for DP and a single activation hand-off per stage boundary for PP, so they are the axes allowed to cross the inter-node network (Narayanan et al. 2021). Expert parallelism for MoE rides its own all-to-all group, treated in Chapter 9. The rule of thumb that follows, TP inside the node and DP/PP across nodes, is not a convention but a consequence of the bandwidth gap, as Figure 62.5 lays out.

axis_map cluster_axes parallelism axis (heaviest to lightest communication) TP TP two all-reduces per layer DP DP one gradient all-reduce per step NVLink NVLink tier intra-node, highest bandwidth TP->NVLink must stay inside PP PP one activation hand-off per stage Network inter-node network InfiniBand / RoCE, an order slower DP->Network can cross PP->Network can cross
Figure 62.5. Parallelism axes ordered by per-step communication volume, each landing on the cheapest tier that can still hide its collective under compute. The bandwidth gap, not convention, assigns TP to NVLink and DP/PP to the inter-node network.

The TPU detour: a torus instead of a switch

The tensor processing unit (TPU) pod is Google's accelerator cluster counterpart with a different JAX/XLA cost model, and it makes the point that the tier hierarchy above is one design choice rather than a law of nature. The chips connect through the inter-chip interconnect (ICI), the pod's internal inter-chip interconnect, and an optical circuit switch (OCS) into a torus topology rather than a switched fat-tree, so neighbor-to-neighbor bandwidth is plentiful and the sharding is co-designed with the torus shape through GSPMD-style annotations rather than mapped onto a fat-tree after the fact (Xu et al. 2021). The same byte that would cross a switch on a graphics processing unit (GPU) cluster, a cluster of graphics processors used as accelerators, travels to a physical neighbor on a TPU pod, which is why bandwidth there scales with locality.

MFU: what fraction of the hardware you actually used

The single number that tells you whether all of this is working is model FLOPs utilization. MFU is the FLOPs the model actually needs, divided by the peak FLOPs the hardware could deliver over the same wall-clock:

MFU=model FLOPs per steppeak hardware FLOPs×step time\mathrm{MFU} = \frac{\text{model FLOPs per step}}{\text{peak hardware FLOPs} \times \text{step time}}

The numerator is the useful arithmetic the model's forward and backward pass requires for one step. The denominator is the machine's theoretical arithmetic capacity over the wall-clock time that step actually took. MFU therefore counts only the useful arithmetic of the model. Its sibling, hardware FLOPs utilization (HFU), also counts work the hardware genuinely did but the model did not strictly need, most notably the extra forward passes of activation recomputation, which is why HFU exceeds MFU whenever recomputation is on. MFU answers the question the budget cares about: of the arithmetic I paid for, how much moved the model.

Why the tiers look the way they do

The interconnect tiers are the product of the bandwidth gap widening faster than any single fabric could close it. Early multi-GPU training leaned on PCIe, which was already too slow for sharding a matmul, so NVLink and then NVSwitch were introduced precisely to make the intra-node tier fast enough to host tensor parallelism (Shoeybi et al. 2019). The accelerator families also moved the precision floor: each generation has widened the set of formats the matmul units execute natively, with Hopper-class and newer hardware adding fp8, which lets the same silicon deliver more matmul throughput per byte moved (Micikevicius et al. 2022) (the kernel-level consequences are in Chapter 34). On the network side, InfiniBand and RoCE converged on remote direct memory access (RDMA), which lets one machine move bytes into another's memory without routing through the CPU, and on rail-optimized topologies that give each accelerator a dedicated path to its peer on other nodes, so the inter-node tier could grow without every flow contending for the same switch ports. TPU pods evolved along a parallel track entirely, choosing a torus over a switched fabric so that bandwidth scales with locality.

What's contested

The intra-node versus inter-node boundary that this chapter is built on is itself moving. The scale-up domain, the set of accelerators that can reach each other at NVLink-class bandwidth, has been expanding past a single chassis toward rack-scale fabrics. As that domain grows, the maximum affordable tensor-parallel degree grows with it, and the long-standing rule that TP stays inside one small node weakens. Whether the future is ever-larger scale-up domains that let TP span a rack, or a continued reliance on the cheaper inter-node network with parallelism axes that tolerate it, is unsettled and vendor-dependent. The boundary is a property of this year's hardware, not a law.

What each axis costs

Every parallelism axis buys a different resource and pays in a different currency, and the interconnect tier sets the exchange rate.

  • Tensor parallelism against bandwidth. TP cuts per-device memory and latency but spends intra-node bandwidth on two all-reduces per layer. That spend is affordable only on NVLink, so the TP degree caps at the NVLink domain. Push it past the node and the all-reduce falls onto the inter-node network, where it cannot hide under compute and shows up as lost MFU. Figure 62.6 makes the cliff visible: MFU holds a plateau while TP fits inside the NVLink domain, then falls away the moment the degree spills onto the inter-node network.
2026-06-21T21:26:42.774412 image/svg+xml Matplotlib v3.11.0, https://matplotlib.org/
Figure 62.6. Schematic of model FLOPs utilization as the tensor-parallel degree grows, after Shoeybi et al. (2019) and Narayanan et al. (2021). MFU holds a plateau while TP fits inside the NVLink domain, then falls off a cliff once the all-reduce spills onto the inter-node network an order of magnitude slower per byte.

Change nvlink_size and slowdown and watch where the plateau breaks and how steep the cliff becomes.

import numpy as np
import matplotlib.pyplot as plt
nvlink_size = 8       # accelerators reachable at NVLink bandwidth
peak = 0.55           # MFU plateau when communication hides under compute
slowdown = 10.0       # inter-node bytes are this many times dearer than NVLink
tp = np.arange(1, 33)
# fraction of the step lost to exposed (un-hidden) all-reduce once TP spills
comm = np.where(tp <= nvlink_size, 0.0, (tp - nvlink_size) / tp * (1 - 1 / slowdown))
mfu = peak * (1 - comm)
plt.plot(tp, mfu, marker='o')
plt.axvline(nvlink_size, ls='--', color='gray', label='NVLink boundary')
plt.xlabel('tensor-parallel degree'); plt.ylabel('MFU')
plt.ylim(0, 0.6); plt.legend(); plt.title('TP past the node falls off a cliff')
print('MFU at TP=8:', round(mfu[7], 3), ' at TP=16:', round(mfu[15], 3))
plt.show()
  • Pipeline parallelism against the bubble. PP is bandwidth-cheap, a single activation hand-off per stage boundary, so it crosses nodes comfortably, but it pays a pipeline bubble at the fill and drain of each step.
  • MFU against memory. Recomputation lets a bigger model or longer sequence fit by redoing forward work in the backward pass, which raises HFU but lowers MFU. The number you optimize depends on whether memory or throughput is the binding constraint.
Constraint arrow

This is the clearest case in the book of a lower layer dictating an upper one. The interconnect bandwidth gap, NVLink an order of magnitude faster per byte than InfiniBand or RoCE, is what sets the maximum tensor-parallel degree that Chapter 10 can choose. A parallelism layout is not picked on the whiteboard and then mapped to hardware. It is the hardware tier that decides which axis is allowed where, and TP staying inside the NVLink boundary is the direct imprint of that decision on the algorithm above it.

Where MFU becomes visible

The collectives that move bytes across these tiers are provided by NCCL on NVIDIA hardware (RCCL on AMD), which maps each collective onto the topology, choosing a ring or a tree and routing it over NVLink or the network depending on where the ranks sit (NVIDIA 2024). A practitioner rarely calls it directly; the parallelism framework does. What the practitioner reads is the per-step profile, because MFU is diagnosed from a timeline, not from the loss curve. Exposed communication that did not hide under compute, an oversized pipeline bubble, too much recomputation, and unfused kernels each take a slice of the gap between achieved and peak FLOPs, and the timeline is where each slice is visible.

Figure 62.7 reads the timeline as a descent from peak FLOPs down to MFU. Idle time, where a device waited on exposed communication or sat in a pipeline bubble, is pure loss. Of the FLOPs the hardware then actually ran, recomputation did work the model did not strictly need: that work lifts HFU above MFU, but only the useful arithmetic counts toward the true figure.

flops_gap peak peak hardware FLOPs busy busy FLOPs (device not idle) peak->busy minus idle idle idle loss exposed communication + pipeline bubble peak->idle hfu HFU: all FLOPs the hardware ran busy->hfu mfu MFU: useful model FLOPs only hfu->mfu minus extra work recomp recomputation + unfused kernels ran but not strictly needed hfu->recomp
Figure 62.7. The per-step timeline descends from peak FLOPs to MFU. Exposed communication and the pipeline bubble are idle loss; recomputation and unfused kernels are work the hardware ran, which is why HFU sits above MFU.

Further reading

  • Shoeybi et al., “Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism,” 2019. arXiv:1909.08053
    Megatron-LM introduces a simple intra-layer tensor parallelism approach for PyTorch transformers, scaling GPT-2 and BERT models to 8.3 billion parameters across 512 GPUs with 76
  • Narayanan et al., “Efficient Large-Scale Language Model Training on GPU Clusters Using Megatron-LM” (PTD-P 3D parallelism), 2021. arXiv:2104.04473
    Megatron-LM combines tensor parallelism, pipeline parallelism, and data parallelism (PTD-P) with a novel interleaved pipeline schedule to train trillion-parameter language models at 502 petaFLOP/s on 3072 GPUs.
  • Micikevicius et al., “FP8 Formats for Deep Learning,” 2022. arXiv:2209.05433
    This paper proposes an FP8 binary interchange format with two encodings, E4M3 and E5M2, and demonstrates that FP8 training matches 16-bit quality across CNNs, RNNs, and Transformers up to 175B parameters.
  • NVIDIA, “NCCL: NVIDIA Collective Communications Library” (optimized inter-GPU collective primitives (all-reduce, all-gather, reduce-scatter, all-to-all) over NVLink/PCIe/InfiniBand; engineering library, not a single canonical paper), 2024. github.com
    NCCL is NVIDIA's open-source library providing optimized collective communication primitives for multi-GPU systems.
  • Xu et al., “GSPMD: General and Scalable Parallelization for ML Computation Graphs” (XLA/TPU sharding annotations underlying JAX pjit), 2021. arXiv:2105.04663
    GSPMD is a compiler-based automatic parallelization system that uses tensor sharding annotations to express data parallelism, 张量并行, and 流水线并行 uniformly, achieving 50-62

Comments

Log in to comment