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-testsdocumentation (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/containscluster_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:
- 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.
- 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).
- Bring a cluster up. Know what a GEMM test, an NCCL test and an application test each catch. Read
all_reduce_perfoutput (algbw vs busbw), and know how silent data corruption is detected. - 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.
- Attribute failures and compute MTBI, and explain why “unknown” flatters it.
- 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
| Section | Idea | Code in code/lecture14/ |
|---|---|---|
| §1 | why a cluster; scaling laws; bandwidth tiers; fabrics; storage | cluster_ops.py, 01_why_a_cluster.py |
| §2 | what a cluster is: scheduler, stack, observability | (prose) |
| §3 | bring-up: GEMM, silent data corruption, NCCL tests, weak scaling | 02_bring_up.py |
| §3.5 | stragglers and the counters that hide them | 03_stragglers_and_counters.py |
| §4 | measuring success: cascade, OFU, power, memory, idle waste | 04_utilization_metrics.py |
| §5 | failure attribution, MTBI, goodput | 05_failures_and_goodput.py |
| §6 | scheduling a shared fleet | scheduler.py, 06_scheduling.py |
0.4 Notation
- = number of GPUs (or processors).
- = parallel fraction of the work.
- = 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):
| model | training state | vs 8×H100 | vs GB300 tray | one 8×H100 node at 40% MFU |
|---|---|---|---|---|
| Llama 3 8B | 128 GB | 0.2× | 0.1× | 7 years (15T tokens) |
| Llama 3 70B | 1.13 TB | 1.8× | 1.0× | 64 years |
| Llama 3.1 405B | 6.49 TB | 10.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 parallelises, , which can never exceed . Model parallelism on a fixed model is strong scaling, and it is usually limited by network bandwidth.
- Weak scaling (弱扩展): the problem grows with . Gustafson’s law: , linear in . Data parallelism is weak scaling: each extra GPU processes its own share of more data.
| Amdahl | limit | Gustafson | ||
|---|---|---|---|---|
| 0.95 | 15.4 | 19.6 | 20 | 973 |
| 0.99 | 39.3 | 91.2 | 100 | 1014 |
| 0.999 | 60.2 | 506 | 1000 | 1023 |
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):
| tier | bandwidth | vs scale-out |
|---|---|---|
| HBM3 (on the GPU) | 3,350 GB/s | 67× |
| NVLink 4 (scale-up, inside the node) | 450 GB/s | 9× |
| InfiniBand NDR 400 Gb/s (scale-out) | 50 GB/s | 1× |
| PCIe Gen5 x16 (to the host) | 64 GB/s | 1.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:
| fabric | ring, 64 KB | ring, 256 MB | tree, 64 KB | tree, 256 MB |
|---|---|---|---|---|
| InfiniBand | 1.03 ms | 21.5 ms | 23 µs | 20.5 ms |
| RoCEv2 | 3.58 ms | 24.0 ms | 68 µs | 20.5 ms |
| EFA | 12.8 ms | 33.2 ms | 230 µs | 20.7 ms |
A flat ring has latency-bound steps; a tree or hierarchical scheme has about . 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):
| tier | examples | per node | best for |
|---|---|---|---|
| local scratch | node NVMe, tmpfs | ~14 GB/s | temporary data, caches, container builds |
| shared NFS | ZFS, NetApp | 0.5–2.5 GB/s | home directories, shared datasets, ease of access |
| parallel file system | Lustre, WEKA, VAST | 3–10 GB/s, scales out | active training data, checkpoints, heavy parallel I/O |
| object store | S3, GCS, Azure Blob | 0.1–0.5 GB/s, scales out | durable 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 , hence Lecture 9’s interval 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:
srun -N 8 --gpus-per-node=8allocates 8 nodes;- each node starts one container;
- each container spawns 8 processes (ranks), one per GPU;
- 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
| layer | examples | who controls it |
|---|---|---|
| container image | your job, PyTorch / JAX / Megatron / NeMo / vLLM, NCCL + its network plugin, CUDA user space (cuBLAS, cuDNN) | the researcher; ships with the job |
| host user space | container runtime (containerd / Enroot), scheduler agent (slurmd + Pyxis, or kubelet), RDMA user space (verbs, libfabric, UCX), telemetry (DCGM, node exporter) | the node image |
| kernel space | GPU driver (sets the CUDA version ceiling), RDMA NIC driver, GPUDirect RDMA (nvidia-peermem), storage clients | fixed per node image |
| host OS | pinned kernel, cgroups v2, hugepages, IOMMU | chosen once per cluster |
| compute service | bare metal vs VM with GPU passthrough | the 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
| phase | tests |
|---|---|
| hardware validation | DGEMM, cuBLAS matmul, NCCL, nvBandwidth, local-storage FIO |
| functional validation | system checks, authentication, Slurm configuration, Enroot set-up, network-storage FIO, smoke tests (NCCL, nvBandwidth) |
| workload validation | NCCL 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):
| precision | achieved | max | |
|---|---|---|---|
| FP32 | 512 / 1024 / 4096 | 2.4 / 3.0 / 2.9 TFLOP/s | to |
| BF16 | 512 | 0.004 TFLOP/s | |
| FP16 | 512 | 0.004 TFLOP/s |
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 (the natural scale of rounding in a dot product), is a small multiple of machine epsilon in each format: FP32 , BF16 . 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 must equal , and the row sums must equal . 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 ( of ):
| corruption of | 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 |
| relative | no |
It raises no false alarms on the clean result, and costs 0.2% of the GEMM’s FLOPs at . 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 × for all-reduce. A ring all-reduce makes every rank send and receive of the data, so busbw is what each link actually carried, independent of . Compare busbw with the link speed.
- #wrong: elements with the wrong value after the collective.
Demo 02 parses the slide’s output:
| size | time | algbw | busbw | busbw/algbw | #wrong |
|---|---|---|---|---|---|
| 268 MB | 1,097 µs | 244.7 GB/s | 428.2 GB/s | 1.750 | 0 |
| 1.07 GB | 4,034 µs | 266.2 GB/s | 465.8 GB/s | 1.750 | 0 |
| 17.2 GB | 62,561 µs | 274.6 GB/s | 480.6 GB/s | 1.750 | 0 |
Three things can be read from it:
- The number of GPUs. busbw/algbw = 1.750 = , so .
- 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):
| size | 4 KB | 64 KB | 1 MB | 4 MB | 16 MB | 64 MB |
|---|---|---|---|---|---|---|
| time | 879 µs | 491 µs | 850 µs | 2.4 ms | 6.8 ms | 28.8 ms |
| busbw | 0.01 | 0.20 | 1.85 | 2.65 | 3.71 | 3.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:
| gradient | 1 process | 2 | 4 |
|---|---|---|---|
| 1 MB | 1.00 | 0.80 | 0.59 |
| 16 MB | 1.00 | 0.45 | 0.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:
| rank | compute | all-reduce incl. waiting | step |
|---|---|---|---|
| 0 | 11.1 ms | 6.1 ms | 17.0 ms |
| 1 | 11.0 ms | 6.4 ms | 17.0 ms |
| 2 (throttled) | 16.0 ms | 1.4 ms | 17.1 ms |
| 3 | 11.1 ms | 6.4 ms | 17.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:
| GPUs | 1% jitter | 3% jitter |
|---|---|---|
| 512 | 3.0% | 8.6% |
| 16,384 | 3.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
| stage | meaning | slide’s fraction | of subscribed |
|---|---|---|---|
| subscribed | nodes in the capacity reservation (what finance contracted for) | 100% | 100% |
| allocatable | healthy and schedulable (excludes down, drained, reserved) | 96% | 96.0% |
| occupied | assigned to a running job | 90% | 86.4% |
| utilized | GPU activity reported by DCGM | 80% | 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:
| counter | measures | blind to |
|---|---|---|
GPU_UTIL (DCGM_FI_DEV_GPU_UTIL) | % of time any kernel is running | what the SMs are doing |
SM_ACTIVE (..._PROF_SM_ACTIVE) | fraction of SMs with work | whether that work is matrix math |
TENSOR_ACTIVE (..._PROF_PIPE_TENSOR_ACTIVE) | fraction of time tensor pipes are busy | the clock speed |
DRAM_ACTIVE (..._PROF_DRAM_ACTIVE) | fraction of peak HBM bandwidth in use | |
| NVLINK_TX/RX | bytes over NVLink |
The slide’s illustrative values per phase (demo 03 reproduces them with dcgm_counters):
| phase | GPU_UTIL | SM_ACTIVE | TENSOR_ACTIVE | DRAM_ACTIVE |
|---|---|---|---|---|
| matmul-heavy step | 100% | 0.94 | 0.61 | 0.42 |
| memory-bound kernels | 100% | 0.88 | 0.03 | 0.87 |
| all-reduce in flight | 100% | 0.22 | 0.00 | 0.08 |
| stalled on a straggler (NCCL spin-wait) | 100% | 0.18 | 0.00 | 0.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.
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 type | GPU-hours | OFU | memory p95 | idle waste |
|---|---|---|---|---|
| pre-training (well tuned) | 63,346 | 43.3% | 96% | 0% |
| fine-tuning, small model | 5,144 | 17.2% | 43% | 5% |
| inference / evaluation | 2,792 | 5.6% | 87% | 10% |
| RL rollouts (memory-bound) | 38,082 | 7.9% | 99% | 2% |
| interactive / debugging | 5,305 | 1.3% | 37% | 65% |
| data-loader-bound training | 15,000 | 12.4% | 68% | 10% |
| fleet (GPU-hours weighted) | 129,669 | 25.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;
sacctFAILED 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 engine | correct | unknown | wrong |
|---|---|---|---|
| first mover, all evidence | 75% | 18% | 7% |
| first mover, 5-minute window | 80% | 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.
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 hardware | failures | MTBI |
|---|---|---|
| true hardware failures | 20 | 7,250 GPU-h |
| attributed by the windowed rules | 11 | 13,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):
| MTBI | GPUs | job MTBF | interruptions / day | checkpoint interval | runtime goodput |
|---|---|---|---|---|---|
| 7,250 GPU-h | 512 | 14.2 h | 1.7 | 41 min | 94.1% |
| 7,250 GPU-h | 16,384 | 0.4 h | 54 | 7.3 min | 54.6% |
| 50,000 GPU-h (≈ Llama 3) | 16,384 | 3.1 h | 7.9 | 19 min | 85.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).
| job | scheduling | runtime | program | product |
|---|---|---|---|---|
| slide’s 128-node job (26 min queue, 18 min run) | 41% | 95% | 40% | 15.5% |
| reserved 16,384-GPU pre-training run | 99% | 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):
| order | placement | wait: 1 node | 2–8 nodes | 16–64 nodes | scheduling goodput | extra racks per multi-node job | makespan | occupancy |
|---|---|---|---|---|---|---|---|---|
| FIFO | first-fit | 52.3 h | 52.6 h | 52.6 h | 10% | 1.56 | 892 h | 80% |
| FIFO | topology | 11.6 h | 12.3 h | 12.2 h | 32% | 0.26 | 786 h | 72% |
| backfill | first-fit | 4.8 h | 8.5 h | 22.7 h | 43% | 1.43 | 822 h | 85% |
| backfill | topology | 1.1 h | 1.6 h | 8.2 h | 74% | 0.17 | 764 h | 73% |
- 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 MTBF | health checks | jobs killed | nodes drained | node-hours lost | makespan |
|---|---|---|---|---|---|
| none | – | 0 | 0 | 0 | 764 h |
| 5,000 h | no | 19 | 0 | 374 | 779 h |
| 5,000 h | yes | 10 | 7 | 190 | 774 h |
| 2,000 h | no | 52 | 0 | 1,003 | 793 h |
| 2,000 h | yes | 29 | 31 | 411 | 793 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
- 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
: ; ; the limit is 25. Strong scaling saturates quickly; the serial part must be parallelised or overlapped.
- 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.
- 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.
- 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.
- 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.
- 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.
10. The related assignment (concepts only)
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_perfsweep 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 / EFA | InfiniBand / 融合以太网 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 error | Xid 错误(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 | 健康检查 / 潜伏故障 |