AI Racks Explained
← /learn · 09

Training clusters

How a training job's tensor, pipeline and data parallelism land on NVLink domains and the network, and how often a large job is interrupted.

Check yourself ↓ three questions and what to remember, at the end

Loading the animation…

Concept

A model too large for one GPU is split three ways (Training, chapters 11 and 12 explain each). Tensor parallelism splits every layer across a few GPUs, which then all-reduce their partial results twice per layer, every micro-batch. Pipeline parallelism gives each group of layers to a different set of GPUs and passes activations from stage to stage. Data parallelism runs copies of the whole arrangement on different data and averages their gradients once a step, which can overlap with the backward pass. The traffic falls in that order. Narayanan et al. (2021) give the rule for servers of gg GPUs: tensor parallelism up to degree gg, inside the server's NVLink domain, then pipeline parallelism across servers; data parallelism, the lightest, goes outermost.

The animation places a small job, one tensor-parallel group per frame, in the order Llama 3's training used: tensor-parallel ranks innermost, then pipeline stage, then replica. Each line joins a group to the stage before it: green when the activations stay on NVLink, dashed blue when they cross the network.

Llama 3 405B, re-housed. One stage of Llama 3 405B's pre-training ran on 16,384 H100 GPUs as TP 8 × PP 16 × DP 128, eight GPUs to an NVLink server. On those servers, all 2,048 tensor-parallel groups fit inside one server, and every one of the 1,920 pipeline hops crosses the network (1,920). Laid out the same way on NVL72 racks, the job fills 228 racks and only 213 of the pipeline hops cross a rack boundary; the rest move to NVLink. The data-parallel gradient averaging crosses the network either way (128 of 128 groups). This is an illustration of the layout rule, not a description of any real deployment.

Interruptions. At this scale, failure is routine. Over a 54-day period of Llama 3 405B pre-training Meta counted 419 unexpected interruptions; about 78% were confirmed or suspected hardware issues, and GPU issues alone were 58.7% (the paper's Table 5). In synchronous training one failed GPU stops the whole job, which restarts from its last checkpoint. As one rate, that is 0.00002 interruptions per GPU-hour, so a job of 16,384 GPUs is interrupted every 11,100 s on average. Young's rule (1974) sets the checkpoint interval at 2 δM\sqrt{2\,\delta M} for a save time δ\delta and mean time between failures MM: with a 60 s save, every 1,160 s, losing about 10% of the time. At 100,000 GPUs that rises to 26%, which is why fast checkpointing, quick restart and automatic diagnosis matter as much as the GPUs (Training, chapter 15).

GPUsInterruptions a dayMean time betweenCheckpoint everyTime lost
1,0240.485178,000 s4,620 s2.6%
4,0961.9444,500 s2,310 s5.2%
16,3847.7611,100 s1,160 s10.4%
100,00047.41,820 s468 s25.6%

Maths

With NN GPUs failing independently at λ\lambda per GPU-hour, the job's mean time between interruptions is M=1/(λN)M = 1/(\lambda N). A checkpoint every τ\tau that takes δ\delta to write loses, to first order, δ/τ\delta/\tau to saving and τ/2M\tau/2M to recomputing the work since the last checkpoint:

lost≈δτ+τ2M,d lostdτ=0  ⇒  τ∗=2 δM.\text{lost} \approx \frac{\delta}{\tau} + \frac{\tau}{2M}, \qquad \frac{d\,\text{lost}}{d\tau} = 0 \;\Rightarrow\; \tau^{*} = \sqrt{2\,\delta M}.

From the Llama 3 record, λ=419/(16,384×54×24)\lambda = 419 / (16{,}384 \times 54 \times 24) per GPU-hour.

Code

Young's interval, cut from src/lib/racks/model.ts:

const lam = failureRate() / 3600;
const mtbf = 1 / (lam * nGpus);
const tau = Math.sqrt(2 * saveS * mtbf);

Check yourself

Commit to an answer before you reveal it: a wrong guess you can explain teaches more than a right one you skimmed. Every number in the answers comes from the same tested model as the chapter’s.

Q1Which parallelism goes innermost, inside the NVLink domain?
Reveal the answer

Answer: Tensor parallelism

Tensor parallelism: it all-reduces twice per layer, every micro-batch. Pipeline stages go across servers; data parallelism, the lightest and most overlappable, goes outermost.

Three ways to split →

Pick one, then reveal.

Q2Llama 3 405B's TP 8 × PP 16 × DP 128 layout re-housed on NVL72 racks: how many of its pipeline hops still cross a rack boundary?
Reveal the answer

Answer: 213 (counted right within 10%)

213 of 1,920. On 8-GPU servers every one crossed the network; in 72-GPU domains most move to NVLink.

Llama 3 405B, re-housed →

Commit to a number, then reveal.

Q3A 16,384-GPU job at Llama 3's interruption rate, saving checkpoints in 60 s at Young's interval: what share of the time is lost?
Reveal the answer

Answer: 10% (counted right within ± 3%)

About 10%, interrupted every 11,100 s on average. At 100,000 GPUs it is 26%.

Interruptions →

Commit to a number, then reveal.