Lecture 14 · Running an AI/HPC Fleet

Scalable AI: Bridging Theory, Understanding, and Practice · Lecture 14。个人学习讲义与配套实验,按主题整理并持续修订。

课程源码 ZIP ↓

个人整理的学习笔记,非官方讲义;课程来源与整理说明见课程介绍。配套示例未逐一运行验证。

本篇目录

Maps to: UC Berkeley EE 290/194 Scalable AI, Fall 2026 Lecture 11, Building AI/HPC Systems for Pre-Training (guest lecture by Matt Nightingale and Sean Smith; slides lecture11.pdf): why pre-training needs a cluster; compute, network, storage and observability; cluster bring-up and validation (GEMM, NCCL and workload benchmarks); measuring success as an operator (efficiency cascade, DCGM counters, OFU, failure attribution, MTBI, goodput). Recommended reading: Hugging Face, The Ultra-Scale Playbook; SchedMD, Slurm Overview; NVIDIA, nccl-tests documentation (PERFORMANCE.md: algbw vs busbw); Wongpanich et al., Machine Learning Fleet Efficiency: Analyzing and Optimizing Large-Scale Google TPU Systems with ML Productivity Goodput (arXiv:2502.06982); Llama Team, The Llama 3 Herd of Models §3.3.4 (arXiv:2407.21783); Dixit et al., Silent Data Corruptions at Scale (arXiv:2102.11245); MLCommons Training benchmarks. Code: code/lecture14/ contains cluster_ops.py (scaling laws, NCCL-test parsing, efficiency cascade, DCGM counters, OFU, failure attribution, MTBI, goodput), scheduler.py (a Slurm-like cluster simulator with backfill, topology-aware placement, fair share, failures and health checks) and six demos. Two of the demos run real multi-process tests on your machine. Reading time: ~2 hours for the prose; ~1 minute to run all demos.


0. How to read this lecture

0.1 Learning goals

After this lecture you should be able to:

  1. Explain why pre-training needs a cluster. Use the memory and FLOP walls of one node, strong vs weak scaling (Amdahl vs Gustafson), and the bandwidth tiers that decide where each parallelism goes.
  2. Name the parts of a cluster. Scheduler, orchestrator, compute, network (scale-up, scale-out, fat tree, RDMA fabrics), storage tiers, observability, and the software stack (what a container can and cannot carry).
  3. Bring a cluster up. Know what a GEMM test, an NCCL test and an application test each catch. Read all_reduce_perf output (algbw vs busbw), and know how silent data corruption is detected.
  4. Measure success as an operator. Work the efficiency cascade from contract to tensor cores. Know what GPU_UTIL, SM_ACTIVE and TENSOR_ACTIVE actually measure, and use OFU, power and memory utilisation, and idle waste.
  5. Attribute failures and compute MTBI, and explain why “unknown” flatters it.
  6. Schedule a shared fleet. Explain gang scheduling, FIFO vs backfill, topology-aware placement, fair share and health checks, and their effect on scheduling goodput.

0.2 Prerequisites and scope

  • Prerequisites: Lecture 1 (the fleet simulator, failures and checkpointing); Lecture 2 (hardware specs, rooflines); Lectures 5–6 (collectives, data / tensor / pipeline parallelism); Lecture 9 (MFU, goodput, the checkpoint interval).
  • Scope: the operator’s view of a GPU cluster for pre-training.
  • Not in scope: data-centre power and cooling design; the network’s physical layer; inference serving fleets (Part IV).

0.3 Section → code map

SectionIdeaCode in code/lecture14/
§1why a cluster; scaling laws; bandwidth tiers; fabrics; storagecluster_ops.py, 01_why_a_cluster.py
§2what a cluster is: scheduler, stack, observability(prose)
§3bring-up: GEMM, silent data corruption, NCCL tests, weak scaling02_bring_up.py
§3.5stragglers and the counters that hide them03_stragglers_and_counters.py
§4measuring success: cascade, OFU, power, memory, idle waste04_utilization_metrics.py
§5failure attribution, MTBI, goodput05_failures_and_goodput.py
§6scheduling a shared fleetscheduler.py, 06_scheduling.py

0.4 Notation

  • NN = number of GPUs (or processors).
  • pp = parallel fraction of the work.
  • S(N)S(N) = speedup.
  • algbw / busbw = algorithm / bus bandwidth of a collective.
  • MTBI = mean time between interruptions (in GPU-hours).
  • OFU / MFU / HFU = overall / model / hardware FLOP utilisation.

1. Why a cluster, and what limits it

1.1 Two walls: memory and FLOPs

A single 8 × H100 node has 640 GB of HBM. A GB300 NVL4 tray has 1,152 GB. Demo 01 compares that with the training state of real models (weights + gradients + Adam = 16 bytes per parameter, before activations):

modeltraining statevs 8×H100vs GB300 trayone 8×H100 node at 40% MFU
Llama 3 8B128 GB0.2×0.1×7 years (15T tokens)
Llama 3 70B1.13 TB1.8×1.0×64 years
Llama 3.1 405B6.49 TB10.1×5.6×380 years (15.6T tokens)

Memory is the first wall. We already have the tools for it: tensor and pipeline parallelism, ZeRO/FSDP (Lectures 5–6). Even the 8B model fits a node only when sharded across its 8 GPUs (16 GB each, before activations).

FLOPs are the harder wall. No amount of memory makes one node train 405B in useful time. The only way out is more GPUs on the same job.

1.2 Strong vs weak scaling

HPC has two names for “more processors”:

  • Strong scaling (强扩展): fixed problem size. Amdahl’s law: if a fraction pp parallelises, S(N)=1/((1−p)+p/N)S(N) = 1/((1-p) + p/N), which can never exceed 1/(1−p)1/(1-p). Model parallelism on a fixed model is strong scaling, and it is usually limited by network bandwidth.
  • Weak scaling (弱扩展): the problem grows with NN. Gustafson’s law: S(N)=(1−p)+pNS(N) = (1-p) + pN, linear in NN. Data parallelism is weak scaling: each extra GPU processes its own share of more data.
ppAmdahl S(64)S(64)S(1024)S(1024)limitGustafson S(1024)S(1024)
0.9515.419.620973
0.9939.391.21001014
0.99960.250610001023

This is why a pre-training run keeps model parallelism inside the fastest domain and lets data parallelism span the cluster.

1.3 The bandwidth tiers

Per H100, one direction (demo 01):

tierbandwidthvs scale-out
HBM3 (on the GPU)3,350 GB/s67×
NVLink 4 (scale-up, inside the node)450 GB/s9×
InfiniBand NDR 400 Gb/s (scale-out)50 GB/s1×
PCIe Gen5 x16 (to the host)64 GB/s1.3×

The slide lists “HBM 3,350 GB/s (67×), NVLink 900 GB/s (18×), InfiniBand 400 GB/s (1×)”. The ratios only work if InfiniBand is 400 Gb/s = 50 GB/s and NVLink’s 900 GB/s counts both directions. Per direction, NVLink is 9× a 400 Gb/s NIC. Bits vs bytes and one vs two directions are the most common unit errors in cluster arithmetic (Lecture 1’s conventions table).

What it means: a tensor-parallel all-reduce of a 4096 × 8192 BF16 activation over 8 GPUs (bandwidth term only) takes 522 µs on NVLink and 4,698 µs over InfiniBand. TP stays inside the NVLink domain. That domain is 8 GPUs per tray, and on rack-scale systems (NVL72) 72 GPUs per rack. A larger scale-up domain is a larger strong-scaling budget.

1.4 The network: topologies and fabrics

A cluster’s network has two directions:

  • East–west traffic is GPU to GPU across nodes, and it decides scaling efficiency. All modern fabrics provide RDMA (remote direct memory access): the NIC reads and writes GPU memory directly, skipping the host OS (GPUDirect RDMA).
  • North–south traffic goes to external services over TCP.

The usual topology is a fat tree:

  • T0: endpoints (GPUs, NICs).
  • T1: leaf / top-of-rack switches.
  • T2: spine switches interconnecting the leaves.

Each GPU usually gets its own NIC, wired to its own “rail”. Rack-scale liquid-cooled systems use block topologies (fixed blocks of NVLink-connected GPUs) and dragonfly-like designs for very large scale.

The fabrics differ mostly in latency (slide figures, per GPU 200 GB/s-class):

  • InfiniBand: < 1 µs;
  • RoCEv2 (RDMA over Converged Ethernet): 2–5 µs;
  • AWS EFA: 10–15 µs.

Latency is multiplied by the number of sequential steps of a collective. Demo 01 models an all-reduce over 512 GPUs:

fabricring, 64 KBring, 256 MBtree, 64 KBtree, 256 MB
InfiniBand1.03 ms21.5 ms23 µs20.5 ms
RoCEv23.58 ms24.0 ms68 µs20.5 ms
EFA12.8 ms33.2 ms230 µs20.7 ms

A flat ring has 2(N−1)=1,0222(N-1) = 1{,}022 latency-bound steps; a tree or hierarchical scheme has about 2log⁡2N=182\log_2 N = 18. With trees, the fabrics differ only for small messages, which is why NCCL switches algorithms by message size and scale. Low latency matters most for small, frequent collectives: MoE all-to-all and tensor parallelism.

1.5 Storage tiers

The same training workflow touches several storage tiers (slide’s approximate per-node throughputs):

tierexamplesper nodebest for
local scratchnode NVMe, tmpfs~14 GB/stemporary data, caches, container builds
shared NFSZFS, NetApp0.5–2.5 GB/shome directories, shared datasets, ease of access
parallel file systemLustre, WEKA, VAST3–10 GB/s, scales outactive training data, checkpoints, heavy parallel I/O
object storeS3, GCS, Azure Blob0.1–0.5 GB/s, scales outdurable datasets, archives, cross-cluster sharing

Demo 01 times a Llama 3.1 405B checkpoint (14 bytes per parameter: BF16 weights, FP32 master and Adam): 5.68 TB.

  • One node writing it alone would need 6.8 min on local NVMe, 14.6 min on the parallel file system and 5.3 hours on an object store.
  • Spread over 2,048 nodes at the per-node rates it would take well under a second. But a parallel file system’s aggregate bandwidth caps that: 5.7 s at 1 TB/s.

The tier sets the checkpoint cost δ\delta, hence Lecture 9’s interval 2δτ\sqrt{2\delta\tau} and the goodput. Large runs checkpoint to local NVMe or host memory first and drain to shared storage asynchronously.


2. What a cluster is made of

2.1 The layers

A cluster is, bottom to top:

  • compute (GPU nodes);
  • networking (NVLink, InfiniBand / RoCE / EFA);
  • storage (NVMe, Lustre, object stores);
  • a cluster orchestrator (Kubernetes, or VMs / bare metal);
  • a scheduler that hands capacity to jobs (Slurm, or Volcano / Kai on Kubernetes).

Slurm is the HPC default. A head node runs slurmctld; every compute node runs slurmd. A job looks like this:

  1. srun -N 8 --gpus-per-node=8 allocates 8 nodes;
  2. each node starts one container;
  3. each container spawns 8 processes (ranks), one per GPU;
  4. PyTorch performs the rendezvous (torchrun --rdzv_backend=c10d).

The slide’s cluster principles:

  • all nodes are identical;
  • nobody has sudo;
  • capacity is allocated exclusively (single user, single job);
  • jobs read and write shared file systems, with no persistent local state;
  • nodes are fungible (kill and respawn);
  • workloads are containerised;
  • multi-node jobs run one process per GPU;
  • the network topology is known to the scheduler, so it can allocate within one NVLink domain.

Kubernetes was built for web services that scale up and down. For training it lacks:

  • gang scheduling (成组调度): all-or-nothing allocation of a job’s nodes. Volcano or Kai add it;
  • a simple job interface for users (SkyPilot, Lepton and others add it).

Its advantages: a modern, well-supported stack, resilience built into the architecture, and a natural fit for inference and heterogeneous jobs like RL, which mix CPU and GPU work.

2.2 The software stack: what a container can carry

layerexampleswho controls it
container imageyour job, PyTorch / JAX / Megatron / NeMo / vLLM, NCCL + its network plugin, CUDA user space (cuBLAS, cuDNN)the researcher; ships with the job
host user spacecontainer runtime (containerd / Enroot), scheduler agent (slurmd + Pyxis, or kubelet), RDMA user space (verbs, libfabric, UCX), telemetry (DCGM, node exporter)the node image
kernel spaceGPU driver (sets the CUDA version ceiling), RDMA NIC driver, GPUDirect RDMA (nvidia-peermem), storage clientsfixed per node image
host OSpinned kernel, cgroups v2, hugepages, IOMMUchosen once per cluster
compute servicebare metal vs VM with GPU passthroughthe cloud provider

The rule of thumb: user space can be containerised; anything that touches hardware cannot. The container toolkit is the seam: at container start it injects the driver’s user-space libraries and /dev/nvidia*. Mismatches below it (driver vs CUDA, NCCL vs its network plugin vs the fabric) are the usual cause of “code that runs fine on one GPU and hangs at 512”.

2.3 Observability

An OpenTelemetry collector runs on every node:

  • it scrapes Prometheus metrics (slurmd, the DCGM exporter, the node exporter);
  • it tails logs (kernel log, job logs);
  • it stamps everything with job ID, node and partition.

Metrics go to Prometheus, logs to Loki, events to ClickHouse, and job records (from sacct) to OpenSearch. Dashboards, alerting and failure attribution (§5) consume them.

One small mechanism makes per-job telemetry possible. The Slurm prolog writes the job ID into a file per GPU (/var/run/nvidia-dcgm-exporter/<gpu>). The DCGM exporter reads it (--hpc-job-mapping-dir) and adds an hpc_job label to every metric. The epilog clears the file when the job exits. That one file turns per-GPU telemetry into per-job telemetry.


3. Bringing a cluster up

3.1 The phases

phasetests
hardware validationDGEMM, cuBLAS matmul, NCCL, nvBandwidth, local-storage FIO
functional validationsystem checks, authentication, Slurm configuration, Enroot set-up, network-storage FIO, smoke tests (NCCL, nvBandwidth)
workload validationNCCL parameters, application (model) runs, proxies (MLPerf, HPL), storage tests, custom tests
→researcher onboarding

Each test catches what the previous one cannot.

3.2 The GEMM test: throughput, correctness, and the software path

A cuBLAS GEMM test runs large matrix multiplies and checks two things:

  • peak throughput against the datasheet, which also stresses power and thermals for throttling;
  • numerical correctness: wrong results from faulty arithmetic or memory, the hardware errors behind silent data corruption.

The slide’s example: 339 TFLOP/s in FP16 at 8192³ (98.2% of the stated maximum) and 0 residual errors over 1,000 iterations.

Demo 02 runs the same test on this laptop (best of 3):

precisionnnachievedmax ∣C−Cexact∣/(∣A∣∣B∣)\lvert C - C_{exact}\rvert / (\lvert A\rvert\lvert B\rvert)
FP32512 / 1024 / 40962.4 / 3.0 / 2.9 TFLOP/s3×10−73\times10^{-7} to 4×10−74\times10^{-7}
BF165120.004 TFLOP/s8×10−48\times10^{-4}
FP165120.004 TFLOP/s1×10−41\times10^{-4}

Two lessons came out of it, one of them by accident.

The test catches the software path. Our first version ran BF16 at 4096³ and did not finish in 10 minutes. This PyTorch build has no fast half-precision kernel for this CPU and falls back to a naive loop, several hundred times slower than FP32. On a GPU node the same symptom (one precision far below its datasheet ratio to the others) flags a wrong library, driver, clock or power setting before a researcher meets it.

“0 errors” means “within the tolerance of the format”. The error, measured in units of ∑k∣aik∣∣bkj∣\sum_k\lvert a_{ik}\rvert\lvert b_{kj}\rvert (the natural scale of rounding in a dot product), is a small multiple of machine epsilon in each format: FP32 6×10−86\times10^{-8}, BF16 4×10−34\times10^{-3}. A correctness test must set its tolerance per format.

3.3 Silent data corruption

Some failures produce no error at all: a GPU computes a wrong value, and the job keeps going. Meta and Google have documented silent data corruption at fleet scale (Dixit et al.). The classic cheap defence for matrix multiplies is algorithm-based fault tolerance (ABFT, Huang and Abraham 1984). The column sums of C=ABC = AB must equal (1⊤A)B(\mathbf{1}^\top A)B, and the row sums must equal A(B1)A(B\mathbf{1}). Two matrix-vector products predict every row and column sum, and a corrupted element shows up in exactly one of each, which locates it.

Demo 02 corrupts one element of a 1024³ FP32 product. The threshold is set at 10× the checksums’ own rounding noise on a clean result (6×10−96\times10^{-9} of ∑∣A∣∣B∣\sum\lvert A\rvert\lvert B\rvert):

corruption of C317,731C_{317,731}located?
sign flip (4.44 → −4.44)yes (row 317, column 731)
× 2, an exponent bit (4.44 → 8.89)yes
× 1.001, a low mantissa bit (change 0.0044; column threshold 0.042)no
10−610^{-6} relativeno

It raises no false alarms on the clean result, and costs 0.2% of the GEMM’s FLOPs at n=1024n = 1024. The smallest detectable corruption is set by the threshold, which is set by the precision, and corruptions below it are also too small to matter much.

3.4 NCCL tests

nccl-tests (all_reduce_perf, alltoall_perf) sweep message sizes and print, per size, the time, two bandwidths and an error count:

  • algbw = size / time: what the user sees.
  • busbw = algbw × 2(N−1)/N2(N-1)/N for all-reduce. A ring all-reduce makes every rank send and receive 2(N−1)/N2(N-1)/N of the data, so busbw is what each link actually carried, independent of NN. Compare busbw with the link speed.
  • #wrong: elements with the wrong value after the collective.

Demo 02 parses the slide’s output:

sizetimealgbwbusbwbusbw/algbw#wrong
268 MB1,097 µs244.7 GB/s428.2 GB/s1.7500
1.07 GB4,034 µs266.2 GB/s465.8 GB/s1.7500
17.2 GB62,561 µs274.6 GB/s480.6 GB/s1.7500

Three things can be read from it:

  • The number of GPUs. busbw/algbw = 1.750 = 2(N−1)/N2(N-1)/N, so N=8N = 8.
  • The fit. A latency + size/bandwidth fit gives about 148 µs and 275 GB/s algbw (482 GB/s busbw).
  • A puzzle in the busbw. It exceeds the 450 GB/s per-direction NVLink of an H100, which a ring cannot do. On H100 this implies in-switch reduction (NVLink SHARP, which halves the traffic). On a Blackwell node (900 GB/s per direction) it would be 53% of link speed. The slide does not say which system produced it. Reading busbw against the right link speed is the point of the test.

The same sweep on 4 real processes over this laptop’s loopback (demo 02, gloo):

size4 KB64 KB1 MB4 MB16 MB64 MB
time879 µs491 µs850 µs2.4 ms6.8 ms28.8 ms
busbw0.010.201.852.653.713.49 GB/s

The fit gives about 450 µs latency and 3.6 GB/s busbw, with #wrong = 0 at every size. Loopback TCP between processes is about 100× slower than NVLink, but the table is read the same way.

The slide’s other NCCL tests:

  • loopback checks the GPU-to-NIC path and rail alignment;
  • all-to-all stresses MoE token routing across rails.

3.5 Application tests, weak scaling, and stragglers

Microbenchmarks miss multi-node interactions: a slow GPU, a file-system lock, a bad image. Application tests run real pre-training workloads (dense 8B / 56B / Ultra-size models) from one rack up to the full cluster. They compare step time and TFLOP/s against statistical baselines, measure scaling efficiency, and look for stragglers. MLPerf Training adds an external reference: a fixed model, dataset and target quality, measured as time-to-train. MLPerf v6.0 published 95 systems from 24 organisations; closed-division numbers are tuned for weeks by vendor engineers, so treat them as a ceiling.

Weak scaling on this laptop (demo 02). Each process has fixed local work and all-reduces a gradient every step:

gradient1 process24
1 MB1.000.800.59
16 MB1.000.450.35

Efficiency is set by the ratio of communication to compute. A real cluster overlaps the all-reduce with the backward pass (Lecture 5), and the application test measures whether it actually does.

Stragglers (demo 03). A synchronous job runs at the speed of its slowest rank. Four real processes compute, then all-reduce. When rank 2 is throttled to 1.5× compute time:

rankcomputeall-reduce incl. waitingstep
011.1 ms6.1 ms17.0 ms
111.0 ms6.4 ms17.0 ms
2 (throttled)16.0 ms1.4 ms17.1 ms
311.1 ms6.4 ms17.1 ms

Every rank’s step grows from 13.6 to 17.1 ms. The healthy ranks finish and then wait about 6 ms inside the collective. The straggler is the rank that waits least: it arrives last. Step times, identical on every rank, cannot find it.

At scale, even healthy GPUs differ slightly, and synchronous training pays the maximum every step. Demo 03’s Monte Carlo of log-normal per-step jitter gives the throughput lost to waiting for the slowest:

GPUs1% jitter3% jitter
5123.0%8.6%
16,3843.9%11.4%

One GPU throttled to 80% speed costs 20% of the whole job. This is why operators hunt stragglers and keep spare nodes for hot swaps.


4. Measuring success as an operator

4.1 The efficiency cascade

stagemeaningslide’s fractionof subscribed
subscribednodes in the capacity reservation (what finance contracted for)100%100%
allocatablehealthy and schedulable (excludes down, drained, reserved)96%96.0%
occupiedassigned to a running job90%86.4%
utilizedGPU activity reported by DCGM80%69.1%

The losses multiply. Then ask what fraction of “utilized” is tensor math.

4.2 What the GPU counters measure

DCGM (Data Center GPU Manager) exports per-GPU counters:

countermeasuresblind to
GPU_UTIL (DCGM_FI_DEV_GPU_UTIL)% of time any kernel is runningwhat the SMs are doing
SM_ACTIVE (..._PROF_SM_ACTIVE)fraction of SMs with workwhether that work is matrix math
TENSOR_ACTIVE (..._PROF_PIPE_TENSOR_ACTIVE)fraction of time tensor pipes are busythe clock speed
DRAM_ACTIVE (..._PROF_DRAM_ACTIVE)fraction of peak HBM bandwidth in use
NVLINK_TX/RXbytes over NVLink

The slide’s illustrative values per phase (demo 03 reproduces them with dcgm_counters):

phaseGPU_UTILSM_ACTIVETENSOR_ACTIVEDRAM_ACTIVE
matmul-heavy step100%0.940.610.42
memory-bound kernels100%0.880.030.87
all-reduce in flight100%0.220.000.08
stalled on a straggler (NCCL spin-wait)100%0.180.000.02

The counter most people quote is the one that cannot see the problem. Applied to demo 03’s measured run, every rank shows GPU_UTIL 100%. Yet the healthy ranks’ TENSOR_ACTIVE is 0.39 against the straggler’s 0.56: the busiest-looking GPU is the slow one.

4.3 OFU, power, memory, idle waste

OFU (overall FLOP utilisation): tensor-pipe utilisation over allocated time, corrected for the clock.

OFU=mean over 30-s buckets of TENSOR_ACTIVE×min⁡(SM_CLOCK,peak clock)peak clock.\text{OFU} = \text{mean over 30-s buckets of } \text{TENSOR\_ACTIVE}\times\frac{\min(\text{SM\_CLOCK}, \text{peak clock})}{\text{peak clock}}.

It needs no knowledge of the model, so the operator can compute it for every job. The slide’s bands (GPU-hours weighted):

  • 40%+ is a well-tuned run;
  • 20% is the cluster-wide goal;
  • 9% is a low average;
  • below 5% means allocated but little tensor work.

Power utilisation = (power − idle baseline) / (rated − idle). It sees all the silicon (tensor, CUDA cores, memory, NVLink), so it complements the tensor-only OFU. Memory utilisation is the p95 of used / (used + free), robust to spikes. Idle waste counts 5-minute samples of a running job with GPU_UTIL exactly 0, summed over its GPUs.

Demo 04 computes all four from synthetic telemetry of a week of jobs. The job mix and levels are chosen to resemble the slide’s examples, not measured:

job typeGPU-hoursOFUmemory p95idle waste
pre-training (well tuned)63,34643.3%96%0%
fine-tuning, small model5,14417.2%43%5%
inference / evaluation2,7925.6%87%10%
RL rollouts (memory-bound)38,0827.9%99%2%
interactive / debugging5,3051.3%37%65%
data-loader-bound training15,00012.4%68%10%
fleet (GPU-hours weighted)129,66925.8%8.2%

How to read the table:

  • The fleet’s OFU is decided by its biggest jobs: pre-training carries 49% of the GPU-hours. The many small jobs decide how users experience the cluster.
  • Down the cascade: 69.1% × 25.8% = 17.8% of the contracted tensor throughput does matrix math. No single dashboard shows that number.
  • The power-vs-OFU quadrants diagnose:
    • OFU low, power high (32% of GPU-hours: RL rollouts, inference) means busy on non-tensor work, a kernel or batching problem;
    • OFU low, power low (20%: data-loader-bound, debugging) means allocated with no work, a scheduling or policy problem.
  • Memory p95 finds right-sizing candidates. Interactive sessions use 37% of an 80 GB GPU at p95; they would fit smaller, cheaper GPUs.
  • Idle waste finds GPUs held without use. 58% of it comes from interactive sessions.

4.4 OFU vs MFU vs HFU

  • MFU counts model FLOPs only (6N per token, Lecture 9). Papers report it.
  • HFU counts everything the hardware executed, including activation recomputation.
  • OFU sees every tensor-pipe cycle, so it tracks HFU.

For a Llama-3-70B-like run at 40% MFU with full recomputation (demo 04), the same run reads three ways:

  • 41.5% with attention FLOPs counted;
  • 54.9% HFU once the recomputed forward pass (8N) is included;
  • about 81M tokens per day per GPU, the business metric.

5. Failures, MTBI and goodput

5.1 Failure attribution

The key requirement for an operator is that the platform can answer why did this job fail? Every failed job should get exactly one outcome: user code, framework, infra software, infra hardware, or unknown. The user sees one line (“exit code 1”). The classifier sees four streams:

  • job logs (stdout / stderr);
  • system logs (journalctl);
  • the kernel log (dmesg, where the NVIDIA driver reports Xid errors);
  • scheduler records (sacct).

It orders the evidence in time and picks the first mover. The slide’s example:

  • an Xid in the kernel log at T−40 s;
  • an NCCL timeout across 511 ranks at T+0;
  • the job cancelled at T+2 s;
  • sacct FAILED at T+5 s.

That is a hardware failure. The NCCL timeout is a symptom.

Demo 05 tests a first-mover rules engine on 60 failed jobs with known causes. The share of jobs whose decisive evidence was captured is an assumption: 95% for user errors, 70% for hardware Xids. 15% of jobs also contain a harmless, much earlier traceback (a caught exception the user’s script printed hours before):

rules enginecorrectunknownwrong
first mover, all evidence75%18%7%
first mover, 5-minute window80%20%0%

Without a time window, the old harmless traceback becomes the “first mover” and a hardware failure is blamed on the user. Ordering by time needs a notion of recent. The unknowns are failures whose decisive log line was never captured. With the window, 9 of 20 true hardware failures land there.

5.2 MTBI, and why “unknown” flatters it

MTBF is component-centric: how long until a part breaks. MTBI is workload-centric: how long until a job is interrupted.

HW MTBI=occupied GPU-hoursdistinct jobs failed by hardware.\text{HW MTBI} = \frac{\text{occupied GPU-hours}}{\text{distinct jobs failed by hardware}}.

The slide’s example: 145,000 occupied GPU-hours in a week and 12 hardware failures give 12.1k GPU-hours. A 512-GPU run burns 512 GPU-hours an hour, so expect an interruption about every day.

Unknown quietly flatters you. A hardware failure never attributed to hardware never enters the denominator, but its GPU-hours still count in the numerator. Demo 05’s week:

counted as hardwarefailuresMTBI
true hardware failures207,250 GPU-h
attributed by the windowed rules1113,182 GPU-h (82% better-looking)

The unknown share is the number to drive down first.

5.3 From MTBI to runtime goodput

A job’s MTBF is the MTBI divided by its GPU count. With a 1-minute checkpoint, a 10-minute restart and Young’s interval, Lecture 1’s simulator gives (demo 05):

MTBIGPUsjob MTBFinterruptions / daycheckpoint intervalruntime goodput
7,250 GPU-h51214.2 h1.741 min94.1%
7,250 GPU-h16,3840.4 h547.3 min54.6%
50,000 GPU-h (≈ Llama 3)16,3843.1 h7.919 min85.3%

The same per-GPU reliability that is harmless for a 512-GPU job halves the goodput of a 16,384-GPU job. Lecture 9 met the same mechanism from the job’s side.

5.4 ML productivity goodput

Google’s ML productivity goodput (Wongpanich et al.) multiplies three factors:

  • scheduling goodput: time the workload runs / (time running + time waiting in queue). It is set by job size, resource availability, reservations and policy;
  • runtime goodput: the share of running time that makes kept progress. Restarts, lost iterations since the last checkpoint, non-overlapped checkpointing and initialisation all cost;
  • program goodput: how efficiently the running program uses the hardware (MFU or a similar measure).
jobschedulingruntimeprogramproduct
slide’s 128-node job (26 min queue, 18 min run)41%95%40%15.5%
reserved 16,384-GPU pre-training run99%55% (MTBI 7,250 GPU-h)40%21.6%

Each factor is owned by a different team: the scheduler, reliability and checkpointing, and the model’s performance engineers. So the product is a shared target that no one can game alone.


6. Scheduling a shared fleet

Lecture 1’s simulator followed one job. Real clusters run a queue of jobs from many teams, and three scheduler decisions dominate:

  • order: which waiting job goes next (first come first served, or fair share by usage);
  • packing: whether a small job may jump ahead into idle nodes. EASY backfill allows it when the job, by its time limit, finishes before the head job’s reserved start, or uses only nodes the head job does not need;
  • placement: which nodes a job gets. A job spread over more racks than necessary pays for slower cross-rack collectives.

All of this happens under gang scheduling: a job starts only when all its nodes are free at once.

scheduler.py simulates a 128-node (1,024-GPU) cluster in 16 racks. The workload is a seeded stream of 1,500 jobs: 55% single-node, a few 64-node; log-normal run times; users asking for 1.5–3× their true run time. Cross-rack placement costs +10% run time per extra rack.

Policy × placement at offered load 0.73 (demo 06):

orderplacementwait: 1 node2–8 nodes16–64 nodesscheduling goodputextra racks per multi-node jobmakespanoccupancy
FIFOfirst-fit52.3 h52.6 h52.6 h10%1.56892 h80%
FIFOtopology11.6 h12.3 h12.2 h32%0.26786 h72%
backfillfirst-fit4.8 h8.5 h22.7 h43%1.43822 h85%
backfilltopology1.1 h1.6 h8.2 h74%0.17764 h73%
  • Strict FIFO makes every job wait behind the head of the queue. With gang scheduling, a 64-node job blocks the cluster until 64 nodes are free at once.
  • Backfill cuts the 1-node wait from hours to about one hour, without delaying the head job.
  • Topology-aware best-fit keeps multi-node jobs in fewer racks, so the same workload finishes 58 hours sooner.
  • Yet first-fit shows the highest occupancy (85%): its jobs simply take longer. Occupancy measures busy nodes, not progress.

Load. Waits explode as the offered load approaches 1. With backfill + topology, the 16–64-node wait goes from 3.4 h at load 0.58 to 17.4 h at 0.87 and 48.2 h at 1.02, while scheduling goodput falls from 86% to 31%. This is the capacity-planning trade-off: a cluster run at full occupancy is a cluster with long queues.

Fair share. When team A submits 3× as many jobs as B and C:

  • FIFO gives similar waits (A 2.24 h, B 1.76 h, C 1.41 h);
  • fair share, ordering by each team’s usage so far, moves B and C ahead (0.52 h, 0.60 h) and leaves the heavy user A waiting longest (1.84 h). (Slurm also decays old usage with a half-life; our simulator does not.)

Failures and health checks. Half the failures in the model are latent: a degraded node kills the next job placed on it. Pre-job health checks (a prolog running DCGM diagnostics) catch latent faults with 90% probability, drain the node and place the job elsewhere.

node MTBFhealth checksjobs killednodes drainednode-hours lostmakespan
none–000764 h
5,000 hno190374779 h
5,000 hyes107190774 h
2,000 hno5201,003793 h
2,000 hyes2931411793 h

Health checks roughly halve the kills and the lost work.

A surprise: under backfill, small jobs waited less with failures (0.2 h vs 1.1 h). Each failure evicts a big job and opens a hole that backfill fills at once; the requeued big job then waits, opening further backfill windows. Failures act like preemption, paid for by the big jobs’ waits and lost work. Under FIFO, failures lengthen every wait (11.6 → 16.3 h for 1-node jobs).


7. Summary

  • One node cannot train a frontier model. The state of 405B is 10× an 8×H100 node; the compute would take centuries. Data parallelism (weak scaling) spans the cluster; model parallelism (strong scaling) stays inside the fast domain.
  • The bandwidth tiers decide placement: HBM 67×, NVLink 9× (per direction), the scale-out NIC 1×. Fabric latency matters for small, frequent collectives, multiplied by the number of sequential steps.
  • Storage tiers set the checkpoint cost and hence the checkpoint interval and the goodput.
  • A cluster is a stack. User space ships in the container; drivers and kernel modules do not, and mismatches there hang jobs at scale. Slurm gives gang scheduling and topology-aware allocation; Kubernetes needs add-ons for both.
  • Bring-up tests catch different failures. The GEMM test catches throughput, the software path and numerical errors; ABFT checksums catch silent corruption. NCCL tests are read as busbw against link speed. Application tests catch stragglers: the slowest GPU sets the pace.
  • Measure down the cascade. Subscribed → allocatable → occupied → utilized → tensor math. GPU_UTIL is blind to what SMs do; use TENSOR_ACTIVE, OFU, power and memory utilisation, and idle waste.
  • Attribute every failure, and drive down “unknown”, which flatters MTBI. MTBI divided by job size is the job’s MTBF.
  • Goodput is scheduling × runtime × program. Backfill and topology-aware placement raise scheduling goodput; health checks and checkpointing raise runtime goodput.

8. Common pitfalls

  • Mixing bits and bytes, or one and two directions (400 Gb/s ≠ 400 GB/s; NVLink “900 GB/s” is both directions).
  • Reading algbw as link utilisation. Compare busbw with the link speed, and know when in-switch reduction lets it exceed a ring’s bound.
  • A GEMM test that checks speed but not results, or one tolerance for all formats.
  • Trusting GPU_UTIL. A spin-waiting NCCL kernel is 100% utilised.
  • Reporting occupancy as progress. Badly placed jobs raise it.
  • First-mover attribution without a time window.
  • Celebrating a high MTBI with a large “unknown” share.
  • Running the cluster at full occupancy and wondering why queues are long.
  • Containerising the driver, or assuming the same image behaves identically on every cloud.

9. Exercises

  1. Amdahl. A training step spends 4% of its time in a serial optimizer phase that does not parallelise across tensor-parallel ranks. What is the best possible TP speedup on 8 GPUs? On 72?
Answer

p=0.96p = 0.96: S(8)=1/(0.04+0.96/8)=1/0.16=6.25S(8) = 1/(0.04 + 0.96/8) = 1/0.16 = 6.25; S(72)=1/(0.04+0.0133)=18.75S(72) = 1/(0.04 + 0.0133) = 18.75; the limit is 25. Strong scaling saturates quickly; the serial part must be parallelised or overlapped.

  1. busbw. An all-reduce of 1 GB on 16 GPUs takes 8 ms. Give algbw and busbw. If the links run at 400 GB/s per direction, how efficient is the collective?
Answer

algbw = 1 GB / 8 ms = 125 GB/s. busbw = 125 × 2 × 15/16 = 234 GB/s, i.e. 59% of 400 GB/s.

  1. Straggler. 1,024 GPUs each take 1.00 s per step, except one that takes 1.25 s. What is the throughput loss? With 1% log-normal jitter on top, about how much more (use demo 03’s table)?
Answer

Every step takes 1.25 s: throughput is 80% of ideal, a 20% loss caused by one device (0.1% of the GPUs). Jitter alone would cost ~3.3% at 1,024 GPUs (between demo 03’s 3.0% at 512 and 3.6% at 4,096), but the throttled GPU dominates; replace it.

  1. Cascade. A 2,000-node reservation has 3% of nodes down or drained, 85% occupancy and 75% utilised. The fleet OFU is 22%. How many nodes’ worth of tensor throughput does the contract buy?
Answer

2,000 × 0.97 × 0.85 × 0.75 = 1,237 nodes utilised; × 0.22 = 272 nodes’ worth of peak tensor throughput, 13.6% of the contract.

  1. MTBI. A week has 200,000 occupied GPU-hours, 10 failures attributed to hardware and 8 “unknown” failures, of which you believe half are hardware. Give the reported and the estimated true MTBI. What does each predict for a 4,096-GPU job?
Answer

Reported: 200,000/10 = 20,000 GPU-h → a 4,096-GPU job is interrupted every 4.9 h. Estimated: 200,000/14 = 14,300 GPU-h → every 3.5 h, about 40% more interruptions than the dashboard implies.

  1. Backfill. The head job needs 64 nodes and is reserved to start in 3 hours; 20 nodes are free now, and 70 will be free at the reservation time. Which of these may start now: (a) 16 nodes, limit 2 h; (b) 16 nodes, limit 5 h; (c) 8 nodes, limit 10 h?
Answer

(a) yes: it finishes before the reservation. At the reservation, 70 − 64 = 6 nodes are spare. (b) no: it would still hold 16 nodes when the head job needs 64 of the 70, and 16 > 6. (c) no: 8 > 6. After (a) starts, a 4-node job with a 10 h limit could start too, since it fits in the 6 spare nodes.

Every group in the course has one 8 × H100 node. The operator’s tools of this lecture apply at that scale:

  • run a GEMM and an all_reduce_perf sweep before trusting the node, and read busbw against NVLink’s speed;
  • watch TENSOR_ACTIVE (or nvidia-smi dmon / DCGM), not just GPU_UTIL;
  • put job IDs on your logs so that a failure can be attributed;
  • checkpoint to local NVMe and copy out asynchronously.

Spring 2026’s Assignment 1 (MFU optimisation) and the student blog “Pre-Training on a Budget” report what these measurements found on the course’s nodes. No assignment solutions are given here.

11. Research directions

  • Automatic failure attribution. Learning first-mover rules from logs across many clusters; shrinking the “unknown” share.
  • Silent data corruption at scale. Cheap online detection (ABFT for attention and optimizers, cross-replica checks), and its interaction with low precision.
  • Straggler-tolerant training. Asynchronous or partially synchronous updates, backup workers, elastic data parallelism.
  • Scheduling for mixed workloads. Pre-training, RL (CPU + GPU) and inference on one fleet; preemption and checkpoint-aware scheduling.
  • Fleet metrics that cannot be gamed. Goodput decompositions that assign each loss to the team that can fix it.

12. Further reading

  • Hugging Face, The Ultra-Scale Playbook; SchedMD, Slurm Workload Manager Overview; Introduction to Lustre (wiki).
  • NVIDIA, nccl-tests (doc/PERFORMANCE.md); NVIDIA DCGM documentation (field identifiers, DCGM exporter HPC job mapping).
  • Wongpanich et al., ML Productivity Goodput (arXiv:2502.06982); Google Cloud, Goodput as a Measure of Productivity (blog).
  • Llama Team, The Llama 3 Herd of Models §3.3.4 (arXiv:2407.21783).
  • Dixit et al., Silent Data Corruptions at Scale (arXiv:2102.11245); Huang and Abraham, Algorithm-Based Fault Tolerance for Matrix Operations (IEEE TC, 1984).
  • Lifka, The ANL/IBM SP Scheduling System (EASY backfill, 1995); MLCommons, MLPerf Training.

13. Next lecture

Lecture 15 · Case Study: Pre-Training Nemotron 3 Nano. With the cluster running, we follow one real pre-training project end to end:

  • NVIDIA’s open hybrid Mamba–Transformer MoE (30B total, ~3.5B active, 25T tokens);
  • the data blend and its phases, and the architecture choices (hybrid Mamba-2 / attention, MoE with GQA-2, multi-token prediction, latent MoE), each argued from inference cost;
  • the precision recipe (NVFP4), the WSD schedule and the long-context extension;
  • how ablations decide what goes into the “hero run”.

We will check the model’s published parameter count tensor by tensor and plan an ablation budget.


术语表 (Glossary, English → 中文)

English中文
cluster / node / tray / rack集群 / 节点 / 计算托盘 / 机柜
strong scaling / weak scaling强扩展 / 弱扩展
Amdahl’s law / Gustafson’s law阿姆达尔定律 / 古斯塔夫森定律
scale-up / scale-out纵向扩展(节点内互连) / 横向扩展(节点间网络)
east–west / north–south traffic东西向 / 南北向流量
fat tree / leaf / spine / rail胖树 / 叶交换机 / 脊交换机 / 轨道(每 GPU 独立网卡链路)
RDMA / GPUDirect RDMA远程直接内存访问 / GPU 直连 RDMA
InfiniBand / RoCE / EFAInfiniBand / 融合以太网 RDMA / AWS 弹性网络适配器
parallel file system / object store并行文件系统 / 对象存储
scheduler / orchestrator / gang scheduling调度器 / 编排器 / 成组调度
prolog / epilog / drain作业前置脚本 / 作业后置脚本 / 排空节点
container image / kernel driver容器镜像 / 内核驱动
observability / telemetry可观测性 / 遥测
bring-up / validation集群上线 / 验证
silent data corruption (SDC)静默数据损坏
algorithm-based fault tolerance (ABFT) / checksum基于算法的容错 / 校验和
algbw / busbw算法带宽 / 总线带宽
in-switch reduction (NVLink SHARP)交换机内归约
straggler / jitter掉队者(慢节点) / 抖动
efficiency cascade效率级联
DCGM / GPU_UTIL / SM_ACTIVE / TENSOR_ACTIVE数据中心 GPU 管理器 / GPU 利用率 / SM 活跃度 / 张量核活跃度
OFU / MFU / HFU总体 / 模型 / 硬件 FLOP 利用率
idle waste / right-sizing空闲浪费 / 资源规格匹配
failure attribution / first mover故障归因 / 首发事件
Xid errorXid 错误(GPU 驱动错误码)
MTBF / MTBI平均故障间隔 / 平均中断间隔
scheduling / runtime / program goodput调度 / 运行时 / 程序有效率
backfill / reservation / time limit回填 / 预留 / 作业时限
topology-aware placement / fragmentation拓扑感知放置 / 碎片化
fair share公平份额
offered load / queueing delay提供负载 / 排队延迟
health check / latent fault健康检查 / 潜伏故障
← 返回课程目录