Contents
Chapter 1

Anatomy of a GPU Cluster

From one streaming multiprocessor to a thousand-GPU fabric

Before you can run, tune or secure a cluster you need a mental model of what's inside it. This chapter walks up the hierarchy: the GPU and its SMs, the memory that feeds them, the links between GPUs in a server, and the fabric between servers. Keep one idea in mind throughout: every level is roughly an order of magnitude slower than the one below it, and almost every design decision maps onto that ladder.

1.1GPU

A CPU spends its transistors making one thread fast: deep caches, branch prediction, out-of-order execution. A GPU spends them on many lanes of arithmetic. It hides memory latency by keeping thousands of threads in flight and switching between them for free.

For ML and HPC that trade is ideal. The work is mostly dense linear algebra, the same operation over huge arrays. A data-center GPU such as the H100 pairs ~130 streaming multiprocessors with tensor cores and 80 GB of HBM at several TB/s.

What makes a GPU fast in practice

  • Enough parallel work to fill every SM (see Occupancy).
  • Arithmetic intensity high enough to be compute-bound, not memory-bound (see Roofline model).
  • Data that stays on the device. PCIe transfers are ~50× slower than HBM.

In a cluster, the GPU is one node in a hierarchy: GPU → NVLink within a server → InfiniBand & RoCE between servers. Most cluster engineering is about keeping that hierarchy busy.

Checkpoint+50 XP30 XP if you need a retry
How does a GPU mainly hide memory latency?
Roughly how much slower is PCIe Gen5 (~64 GB/s) than an H100's HBM (~3,350 GB/s)?

1.2Streaming Multiprocessor (SM)

An SM is roughly what a "core" is on a CPU, but built for throughput. Each SM has warp schedulers, a large register file, configurable shared memory / L1 and execution units: FP32/INT "CUDA cores", special-function units and tensor cores.

A kernel launch is split into thread blocks. Each block lands on one SM and stays there. The SM interleaves the warps of all resident blocks every cycle, so when one warp waits on memory another issues.

Why you care as an operator

  • SM count × clock sets peak FLOP/s. A GPU throttled to 55% clock (thermal or power) delivers ~55% of the math. See Power & thermals.
  • DCGM_FI_PROF_SM_ACTIVE and SM_OCCUPANCY (from DCGM) tell you whether SMs are actually busy. "GPU utilization" in nvidia-smi only means some kernel was running, not that every SM was.
Checkpoint+50 XP30 XP if you need a retry
nvidia-smi reports 100% GPU-Util. What does that actually guarantee?
An H100 is thermally throttled to 55% of its max SM clock. Roughly what percent of its peak FLOP/s can it deliver?
%

1.3HBM & the memory hierarchy

High Bandwidth Memory stacks DRAM dies beside the GPU on a silicon interposer. An H100 SXM has 80 GB at ~3.35 TB/s. Below it sit L2 (tens of MB), per-SM shared memory/L1 and registers, each smaller and faster.

Capacity is the first wall in large-model training. Mixed-precision Adam needs ~16 bytes per parameter (weights, gradients, FP32 master copy and two moments), before activations. A 7B model needs ~107 GB of state alone, more than one GPU holds. That's why ZeRO/FSDP, Tensor parallelism and Activation checkpointing exist.

Bandwidth is the second wall. Any kernel with low arithmetic intensity (elementwise ops, norms, small matmuls) is limited by HBM bandwidth, not FLOPs. See Roofline model.

Try the calculator below: change the model, ZeRO stage and parallelism and watch the per-GPU footprint against the 80 GB line.

LIVE Training memory calculator
weights 13.4 GBgradients 13.4 GBoptimizer 5.0 GBactivations 36.5 GBframework 3.0 GB
80 GB HBM
Per GPU
71.3 GB
Verdict
fits
Data parallel
dp = 16
Params / GPU
6.70 B

Per-GPU memory for mixed-precision Adam, sequence length 4096, flash attention. Activations use the Korthikanti et al. estimate.

Checkpoint+50 XP30 XP if you need a retry
Mixed-precision Adam needs ~16 bytes per parameter. How many GB of state does a 7-billion-parameter model need, before activations?
GB
A kernel does one addition for every 8 bytes it reads from memory. What limits its speed on an H100?

1.4PCIe

PCI Express connects GPUs to the host CPU, NICs and storage. A Gen5 x16 link moves ~64 GB/s per direction. Gen4 x16 moves ~32 GB/s. That's plenty for loading data, but slow for GPU-to-GPU traffic during training.

Why it matters

  • GPUs without NVLink (e.g. L40S) must do all peer traffic over PCIe, often through the CPU's root complex. Tensor parallelism suffers badly.
  • GPUDirect RDMA lets a NIC read and write GPU memory directly over PCIe, skipping host memory. Good servers pair each GPU with a NIC under the same PCIe switch. Check with nvidia-smi topo -m.
  • "Fallen off the bus" (Xid 79) is literally the GPU disappearing from PCIe.
Checkpoint+50 XP30 XP if you need a retry
`nvidia-smi topo -m` shows `SYS` between every pair of GPUs (no NVLink). Which parallelism suffers most?
Xid 79 says the GPU has "fallen off the bus". Which bus?

1.6NVSwitch

Without a switch, NVLink is point-to-point, so GPUs only connect to a few neighbors. NVSwitch builds a non-blocking crossbar: in an HGX H100 server, four NVSwitch chips connect all 8 GPUs all-to-all at full NVLink bandwidth.

Newer systems extend the NVLink domain beyond a server (e.g. NVL72 racks), so 72 GPUs act like one large tensor-parallel island. The rule from NVLink still applies: the bigger the NVLink domain, the larger the tensor-parallel or expert-parallel groups you can run without touching the slower scale-out network.

nvidia-smi topo -m shows NV18 (18 bonded links) between every GPU pair in an NVSwitch system.

Checkpoint+50 XP30 XP if you need a retry
What does NVSwitch add on top of point-to-point NVLink?
`nvidia-smi topo -m` shows `NV18` between every pair of GPUs. What does 18 mean?

1.7InfiniBand & RoCE

Between servers, GPUs talk over a scale-out network. Two families dominate:

  • InfiniBand (IB): a purpose-built RDMA fabric. NDR runs 400 Gb/s per port with very low latency and credit-based lossless flow control.
  • RoCE v2: RDMA over Converged Ethernet. Same verbs API over Ethernet. It needs careful configuration (PFC/ECN) to stay lossless, but it's cheaper and familiar to network teams.

Modern training servers attach one 400G NIC per GPU (rail-optimized), so each GPU gets ~50 GB/s of scale-out bandwidth via GPUDirect RDMA.

Ops checklist

  • ibstat should show every port Active / LinkUp at the expected rate.
  • NCCL logs NET/IB when it uses RDMA and NET/Socket when it fell back to TCP, a classic silent 10× slowdown (often from NCCL_IB_DISABLE=1 or a bad HCA config).
  • A port going down mid-job hangs collectives until the NCCL watchdog times out.
Checkpoint+50 XP30 XP if you need a retry
You see this in a multi-node job log. What's happening?
NCCL INFO NET/Socket : Using [0]eth0:10.0.1.12<0>
NCCL INFO NCCL_IB_DISABLE set by environment to 1.
In a rail-optimized H100 server, roughly how much scale-out bandwidth does each GPU get?

1.8Cluster topology

A GPU cluster network is usually a fat tree. Leaf switches connect servers, and spine switches connect leaves. If uplink capacity equals downlink capacity the fabric is non-blocking (1:1). Cheaper designs oversubscribe (e.g. 2:1), which is fine for web traffic and painful for all-reduce, where everyone transmits at once.

Rail-optimized designs wire NIC i of every server to the same leaf switch ("rail i"). NCCL's ring and tree algorithms then keep most traffic on one rail, one hop away.

Rules of thumb

Checkpoint+50 XP30 XP if you need a retry
Why does network oversubscription (e.g. 2:1) hurt training more than web traffic?
Order the bandwidth hierarchy, fastest first:
◆ Boss mission

Build the Pod

Spec a GPU pod that trains a 13B model in two weeks, within budget and the facility's power envelope.

🔒 Master 4 more section(s) in this chapter to unlock.Play anyway