Distributed AI Training, Checkpoints & RLVR
Scale 10K-GPU training and RLVR: 3D/4D parallelism over NVLink and RDMA, straggler and SDC detection, async checkpoints, and disaggregated rollout pools.
In this lesson (3 bite-sized sections)
Matching 4D parallelism to interconnect physics
Training a frontier model requires storing weights, gradients, optimizer states, and activations totaling terabytes, far beyond one GPU's 80 to 192 GB HBM. The central rule of distributed training comes from hardware bandwidth: NVLink inside an 8-GPU host moves ~900 GB/s bidirectional per GPU, while InfiniBand or RoCE RDMA across hosts delivers ~50 to 100 GB/s per NIC, roughly a 10x cliff.
Modern clusters map four parallelism axes onto that hierarchy (4D parallelism). Tensor Parallelism (TP) splits matrix multiplications inside every transformer layer and runs two synchronous all-reduces per block, so TP must stay inside one NVLink domain. Context Parallelism (CP) shards ultra-long training sequences across GPUs using ring attention so activation memory does not explode. Pipeline Parallelism (PP) places layer stages across nodes using interleaved microbatches to amortize pipeline bubbles over slower cross-node links. Data Parallelism (DP / FSDP / ZeRO) shards optimizer states and weights across replicas, overlapping gradient reduce-scatter with the backward pass.
| Axis | What it shards | Collective pattern | Fabric required | Main bottleneck |
|---|---|---|---|---|
| Tensor (TP) | Hidden weights inside each layer | 2x all-reduce per block (critical path) | Intra-node NVLink only (<= 8 GPUs) | Exposed sync latency across slow links |
| Context (CP) | Long token sequences (e.g., 128k+) | Ring key-value exchange across chunks | NVLink or high-speed RDMA | Load imbalance on causal attention masks |
| Pipeline (PP) | Contiguous transformer layer stages | Point-to-point activation sends | Cross-node InfiniBand / RoCE | Pipeline bubble idle time on small batches |
| Data / FSDP (DP) | Batch samples + sharded params/optimizer | All-gather + reduce-scatter overlapped | Cross-node RDMA fabric | Straggler rank stalling global step barrier |
Stragglers, Silent Data Corruption, and cluster goodput
Across 10,000+ GPUs, hardware failures occur daily. Because synchronous training advances at the pace of the slowest rank, one thermally throttled GPU, degraded optical cable, or noisy NIC slows the entire job. Even more destructive is Silent Data Corruption (SDC): a defective ALU or unflagged bit-flip outputs slightly corrupted floats with no ECC crash, poisoning gradients and triggering irreversible loss spikes days later.
Training teams therefore track effective training time ratio (goodput) rather than peak TFLOPS. Production orchestrators run pre-flight burn-in checks, monitor per-rank NCCL barrier arrival skew to pinpoint stragglers automatically, execute periodic deterministic canary matmuls to detect SDC, and maintain hot-spare nodes that swap out bad hosts in minutes without human intervention.
Async in-memory checkpointing and disaggregated RLVR
Writing a multi-terabyte model plus Adam optimizer checkpoint synchronously to object storage can pause a cluster for 10+ minutes per snapshot. Systems like MegaScale and PyTorch DCP split checkpointing into two steps: a sub-second GPU-to-host-RAM copy that unblocks the next training step immediately, followed by an asynchronous background flush from host RAM to parallel storage or S3. Healthy peer ranks can even serve recovery weights over RDMA after a single-node swap.
Post-training with RLVR (Reinforcement Learning with Verifiable Rewards) breaks uniform pretraining assumptions further. Generating 16 to 64 candidate solutions per prompt is autoregressive and memory-bandwidth bound with extreme tail lengths, grading them runs deterministic CPU sandboxes (compilers, unit tests, math checkers), and updating the policy via GRPO or PPO is compute-bound synchronous training. Colocating all three leaves training GPUs idle waiting for the slowest rollout. Modern RLVR stacks disaggregate rollout engines (vLLM/SGLang workers) from learner workers via a trajectory buffer, pushing refreshed policy weights back to rollout nodes over RDMA.
Disaggregated RLVR post-training cluster: an architecture diagram of 6 components and 6 connections. Full description follows.
- Prompt & task queue: queue or log, in Rollout & verification plane (latency & tail-length bound).
- Rollout GPU pool (vLLM / SGLang): service, in Rollout & verification plane (latency & tail-length bound).
- CPU verifier sandboxes (tests / math): service, in Rollout & verification plane (latency & tail-length bound).
- Scored trajectory buffer: queue or log, in Policy learner & durability plane (FLOPs bound).
- Policy learner GPUs (GRPO / PPO): service, in Policy learner & durability plane (FLOPs bound).
- Async host-RAM -> object store checkpoints: database, in Policy learner & durability plane (FLOPs bound).
- Prompt & task queue sends asynchronously to Rollout GPU pool (vLLM / SGLang) (sample N trajectories).
- Rollout GPU pool (vLLM / SGLang) sends asynchronously to CPU verifier sandboxes (tests / math) (candidate outputs).
- CPU verifier sandboxes (tests / math) sends asynchronously to Scored trajectory buffer (binary rewards).
- Scored trajectory buffer calls synchronously Policy learner GPUs (GRPO / PPO) (packed training batches).
- Policy learner GPUs (GRPO / PPO) sends asynchronously to Async host-RAM -> object store checkpoints (non-blocking flush).
- Policy learner GPUs (GRPO / PPO) feeds back into Rollout GPU pool (vLLM / SGLang) (RDMA policy weight sync).
Classify each mechanism by whether it solves pretraining cluster reliability or RLVR post-training architecture.
Sort 4 more items to check
Recap: align 4D parallelism with NVLink vs RDMA bandwidth cliffs, protect goodput with straggler attribution, SDC canary checks, and async host-RAM checkpoints, and disaggregate rollout generation, verification, and policy learning in RLVR clusters.
Sources: The Llama 3 Herd of Models · MegaScale: scaling LLM training to 10K+ GPUs · DeepSeekMath and GRPO · HybridFlow (verl) RLHF framework
Apply
Your turn
The task this lesson builds to.
Architect the parallelism layout, fault-recovery loop, and checkpointing strategy for pretraining a 120B dense transformer on 2,048 GPUs (256 eight-GPU NVLink nodes linked by InfiniBand) while holding effective cluster goodput above 92%.
Think about
- How do you factor 2,048 GPUs across TP, PP, CP (for long-context stages), and DP/FSDP without pushing TP across InfiniBand?
- What detects a slow straggler node or silent data corruption before it wastes hours of 2,048-GPU compute?
- How do you save multi-terabyte checkpoints frequently enough to bound lost work without stalling the cluster on S3 writes?
Draft your design answer here Save your draft, compare against the model answer, and track progress.
Practice
Make it stick
A second problem on the same idea, so it survives past today.
Propose the cluster architecture for an RLVR coding post-training pipeline on 512 GPUs that generates 16 candidate patches per repository issue, executes containerized test suites to score each patch, and updates policy weights without stalling GPUs on slow long-tail rollouts.
Think about
- How should you partition the 512 GPUs and external CPU pool across rollout generation, test verification, and GRPO policy learning?
- What happens to learner utilization when 1 of the 16 candidate patches takes 10x longer to finish generating or running tests?
- How do updated policy weights reach rollout GPUs quickly without causing unbounded off-policy staleness?
Draft your design answer here Save your draft, compare against the model answer, and track progress.