Build a Pretraining Cluster
The capstone — 4,000 GPUs, 60 days, one computation that must not stop. Parallelism layout, checkpointing arithmetic, failure recovery, and the operational discipline that makes it finish.
#The task
Train a 200-billion-parameter model on 12 trillion tokens. You have 4,000 GPUs for approximately 60 days.
This is the hardest build here, and not because any individual component is novel. It is hard because it is a single distributed computation that must make continuous progress for two months across hardware that fails twice a day, and there is no partial credit. A run that dies on day 45 with corrupted checkpoints has produced nothing.
Nearly every idea in this atlas appears somewhere in it.
#Phase 0 — Is this even the right shape?
Before allocating anything, the compute budget and the model/data split.
The estimate comes first, and it changes the model. Skipping this is how runs get started that cannot finish.
A fifth lever has become common since 2024: doing most of the matrix maths in FP8 instead of BF16 — DeepSeek-V3 was trained this way. It raises effective throughput substantially, but it needs careful per-block scaling to stay numerically stable, so treat it as a choice you plan and validate on a small run, not a rescue for a schedule that doesn't fit.
#Phase 1 — The parallelism layout
The model is far too big for one GPU, so it must be split — and there are three different ways to split it, used together. Tensor parallel splits individual layers across GPUs, which means they must talk twice per layer, so they'd better be in the same box. Pipeline parallel gives different GPUs different layers, so they hand off once per stage. Data parallel gives every group a full copy of the model and different training examples, syncing once per step.
The rule that arranges them, from model parallelism: the more often something has to communicate, the faster the wire between the participants must be.
One term you'll see below: an all-reduce is the group operation where every GPU contributes a piece of data, the pieces are combined (usually summed), and every GPU ends up with the combined result. It's how GPUs sharing a layer, or sharing training work, stay in agreement.
4,000 GPUs = 500 nodes × 8 GPUs
NVLink within a node, InfiniBand across.
TENSOR PARALLEL = 8 within a node
(2 all-reduces per LAYER →
must be on NVLink)
PIPELINE PARALLEL = 10 across 10 nodes
(one activation per stage
boundary → tolerates IB)
DATA PARALLEL = 50 across the remaining groups
(one gradient sync per STEP,
overlappable)
8 × 10 × 50 = 4,000 ✓
Plus ZeRO-1 within each data-parallel group to shard
optimizer state — cheap, no extra communication.ZeRO-1 deals with the fact that the 50 data-parallel copies would each hold an identical copy of the optimiser's state. Instead, each copy keeps only 1/50th of it and is responsible for updating that slice. The gradient sync already happens every step, so this adds essentially no extra traffic.
Every one of those numbers is checkable before you allocate a single GPU, and getting one wrong costs days.
#Phase 2 — Data
The training data pipeline has to be finished before the run starts, because you cannot fix the corpus at day 30 without invalidating everything before it.
REQUIRED BEFORE THE RUN BEGINS
· 9T tokens, filtered, deduplicated, decontaminated
· pre-packed into fixed-length sequences, in shards
(~500 MB each, uint32 token IDs, mmap-able)
· a deterministic, resumable shard assignment:
rank r at step s reads exactly the same data
on a resume — or you silently replay or skip data
· the mixture weights fixed, with the late-phase
annealing schedule decided
· a content-addressed snapshot ID recorded, so the
exact corpus is reconstructible in two years
LOADER REQUIREMENTS
· prefetch several batches ahead, pinned memory
· never stall the GPU — a loader stall shows up as
mysteriously low MFU and takes days to diagnose
· stream from object storage; staging 9T tokens
to local disk on 500 nodes is not worth itA few of those terms: decontaminated means test questions from the benchmarks you'll evaluate on have been removed, so the model can't memorise the answers. mmap-able means a shard can be read straight from a file as if it were in memory, with no parsing step. Annealing is the planned final stretch of training, where the learning rate drops and the data mixture shifts toward the highest-quality sources. A content-addressed snapshot ID is computed from the data itself, so the same ID always means exactly the same bytes.
The data loader's resumability is a correctness requirement, not a convenience. A resume that replays 30 minutes of data or skips it produces a model trained on a subtly wrong distribution, and nothing will tell you.
#Phase 3 — Checkpointing
A checkpoint is a full snapshot of the run, written to storage so a crash costs you minutes rather than weeks. Note what has to go in it: not just the model's weights, but the optimiser's own accumulated state — the running averages it uses to decide how big each adjustment should be. Restarting without those doesn't resume the run, it disturbs it.
Young's formula balances two costs. Checkpoint too often and you lose time to the pauses themselves. Checkpoint too rarely and each failure throws away more work since the last save. The best interval is roughly √(2 × pause per checkpoint × time between failures); here 360,000 s is the 100-hour cluster MTBF.
Tiered: a fast local-NVMe checkpoint every ~15 minutes for node-level faults, and a full durable checkpoint to object storage every ~50 minutes. Keep the last several object-storage checkpoints — you will need to roll back past a loss spike.
#Phase 4 — Automatic recovery
At a failure every four days, manual restart means someone paged fourteen times over two months, each costing hours. Everything must be automatic.
- 1 Detect NCCL (GPU comms library) timeout · heartbeat loss · health probe
- 2 Isolate cordon the node, tag it for diagnosis
- 3 Replace pull from the 3% warm spare pool
- 4 Reform rebuild process groups, verify topology
- 5 Restore load the checkpoint, reposition the loader
- 6 Verify one step, check the loss is continuous
Details that decide whether this works:
- Warm spares — 3% (15 nodes). A replacement must be available immediately, not queued behind provisioning.
- Pre-flight health checks on every node before it joins. Run a GPU self-test, check the memory's error-correction counters for a chip going bad, measure actual bandwidth to a neighbour, and check it isn't already running hot. A node that answers "yes I'm up" but negotiated its network link at half speed becomes a permanent drag on all 4,000 GPUs.
- Verify the loss after restore. A resume that loads the wrong checkpoint or misplaces the loader shows up as a loss discontinuity. Check it automatically and halt if it jumps.
- Global batch size must stay constant. If you resume on fewer data-parallel ranks, adjust gradient accumulation to compensate, or your learning-rate schedule silently no longer matches the run.
#Phase 5 — Watching for the failures that don't error
Every GPU must finish each step before any of them can start the next, so the slowest one sets the pace for all 4,000. A straggler — one machine quietly running at 80% — therefore costs you 20% of the entire cluster, and nothing logs an error.
THE THREE THAT COST THE MOST
STRAGGLER
one GPU 20% slow → the whole 4,000-GPU job is 20% slow
→ 800 GPUs' worth of waste from one bad part
detect: per-rank step-time DISTRIBUTION, not the mean
alert when p99/p50 > 1.15
SILENT DATA CORRUPTION
a marginal GPU produces wrong results with no error
symptom: loss spike, or slow divergence, no log line
detect: per-rank gradient-norm outliers
periodic deterministic self-test kernels
cross-replica loss comparison on identical data
LOSS INSTABILITY
spikes are normal; the question is recovery
· recovers in a few hundred steps → continue
· doesn't recover → roll back to a checkpoint before
the spike, SKIP the implicated data batches, resume
detect: a human looking at the loss curve daily,
plus automated spike alertingThe daily human look at the loss curve is not replaceable. Published logbooks from large runs are full of judgment calls a threshold would have got wrong.
#Phase 6 — Operating discipline
THE RUNBOOK, WRITTEN BEFORE DAY 1
Automated, no human: node failure, NCCL timeout,
transient loss spike
Page someone: loss diverging, MFU dropping
>15%, checkpoint write failing,
>3 failures in an hour
Human decision required: roll back past a spike, change
a hyperparameter, extend or
stop the run
DAILY REVIEW
loss curve · MFU trend · tokens vs schedule ·
failure log · straggler report · spend to date
NEVER, MID-RUN, WITHOUT A ROLLBACK PLAN
· change the learning-rate schedule
· change the data mixture (except the planned anneal)
· upgrade the framework or drivers
· change the parallelism layout
Every one of those has ended a run somewhere.#The decision log
| Decision | Rejected | Because |
|---|---|---|
| 150B × 9T over 200B × 12T | The original spec | 200B doesn't finish in 60 days at achievable MFU |
| TP 8 × PP 10 × DP 50 | ZeRO-3 across all 4,000 | ZeRO-3's all-gathers are network-bound at this scale |
| TP within the node only | TP across nodes | 2 all-reduces per layer; ~18× slower over InfiniBand |
| Interleaved 1F1B | Naive pipeline schedule | Halves the bubble from 10% to ~5% |
| Activation checkpointing | Store all activations | Activations wouldn't fit; +33% compute is worth it |
| Async sharded checkpointing | Synchronous single-writer | 53 s pause → 12 s, at a 49-minute interval |
| Tiered local + object storage | Object storage only | Node-level faults recover in seconds from local NVMe |
| 3% warm spares | Provision on demand | Provisioning latency dominates recovery time |
| Pre-flight health checks | Trust the scheduler | A half-rate link is a permanent tax with no error |
| Constant global batch on resume | Let it shrink with the cluster | The LR schedule silently stops matching the run |
| Daily human loss review | Fully automated monitoring | Spike-recovery judgment isn't reducible to a threshold |
#What you'd cut for v1
Nothing. That's the honest answer, and it's what makes this build different from every other one here.
There is no viable minimum version of a 60-day 4,000-GPU run. Without automatic recovery it doesn't finish. Without correct checkpointing you lose the run. Without a resumable data loader you train on a subtly wrong distribution and never know. Without straggler detection you pay 20% for two months.
The cut is to the scale, not the machinery. Do a 7B run on 64 GPUs for three days first, with every one of these mechanisms in place, and find out which ones you got wrong when the cost of being wrong is three days rather than two months. Every team that has done this successfully did the small run first.
#Explaining the design
"The first thing is the compute estimate, because it changes the model. At
6PDFLOPs, 200B parameters on 12T tokens is 1.4e25, which at 40% MFU on 4,000 GPUs is 104 days — the run as specified doesn't fit the budget. So I'd resize to roughly 150B on 9T, which finishes in about 59 days and is also a better serving trade.The parallelism layout comes from matching communication frequency to link speed: tensor parallel 8 inside the node because it all-reduces twice per layer and needs NVLink; pipeline across 10 nodes because it only communicates at stage boundaries; data parallel 50 for the rest, since gradient sync happens once per step and overlaps with backward. ZeRO-1 inside the data-parallel groups shards optimizer state for free.
Then it's a reliability problem. At 500 nodes the cluster MTBF is about 100 hours, so I expect 14 failures over the run. Checkpoints are 2.1 TB; sharded and async they cost a 12-second pause, which by Young's formula puts the optimal interval near 50 minutes and total failure cost at about half a percent of the run. Recovery has to be entirely automatic — detect, cordon, pull a warm spare, reform the process groups, restore, verify the loss is continuous.
The failures that actually hurt are the silent ones: a straggler running 20% slow taxes all 4,000 GPUs, and silent data corruption from a marginal GPU produces wrong gradients with no error at all. Both need active detection — per-rank step-time distributions and gradient-norm outliers — because neither will ever raise an exception.
And I'd do a three-day 7B run on 64 GPUs first with all of this machinery in place. There's no way to test a two-month run except by doing a short one properly."
#Where to go from here
This is the last build. If the arithmetic above felt tractable — the memory budget, the bubble fraction, the checkpoint interval, the failure rate — then the material has done its job. Every number came from a page in this atlas, and the whole thing is queueing theory, failure arithmetic, checkpointing, and caching, with unusually large constants.
#Check yourself
Why does the compute estimate come first?Show answer
How are tensor, pipeline and data parallelism laid out?Show answer
What must a resumable data loader guarantee?Show answer
What goes into a checkpoint, and how big is it?Show answer
How do you pick the checkpoint interval?Show answer
What must automatic recovery do?Show answer
Name the three silent failures that cost most.Show answer
What is the honest "v1" of a pretraining run?Show answer
#What to carry forward
- Estimate compute first; it decides the model size and token count.
- Lay out parallelism by communication frequency versus link speed.
- Data must be fixed, deterministic and resumable before day one.
- Size checkpoints and intervals from the failure rate; recover automatically.
- Hunt silent failures, review the loss daily, and rehearse on a small run.