Recommended resources
The freely available resources this lesson will direct you to.
- CSE138 (Distributed Systems) L8: forms of fault tolerance, reliable delivery, reliable broadcastwww.youtube.com
- Distributed Training with PyTorch: complete tutorial with cloud infrastructure and codewww.youtube.com
- Revisiting Reliability in Large-Scale Machine Learning ...arxiv.org
- Architecting scalable checkpoint storage for large-scale ML ...aws.amazon.com
Introduction
In our previous lesson, we meticulously engineered a high-performance data pipeline to ensure our GPUs are never starved for data. We discussed prefetching, intelligent caching, and hardware acceleration with GPUDirect Storage, all in the service of maximizing computational throughput. However, raw performance is only one dimension of efficiency. A training job that runs at a record-breaking speed is of little value if it crashes and loses a week's worth of progress.
This brings us to the crucial topic of reliability. Large-scale training jobs, which can run for weeks or months on thousands of GPUs, are not just susceptible to failures—they are guaranteed to encounter them. This lesson directly addresses the learning outcome: Explain strategies for fault tolerance in long-running training jobs, such as distributed checkpointing and restart. We will explore why failures are a certainty at scale and investigate the architectural patterns and trade-offs involved in making massive computations resilient.
1. The Inevitability of Failure at Scale
In a small system with a handful of components, it's reasonable to treat failures as rare, exceptional events. However, as we scale to thousands of accelerators, this intuition breaks down. The probability of at least one component failing within a given time window approaches certainty. This is not a matter of poor-quality hardware, but a simple statistical reality.
To ground this concept in real-world data, let's examine a study of large-scale ML clusters.
Revisiting Reliability in Large-Scale Machine Learning ...
The paper 'Revisiting Reliability in Large-Scale Machine Learning...' from researchers at Meta provides an excellent, data-driven analysis of failures in production AI clusters. It quantifies how reliability changes with scale.
Please read the 'Introduction' (Section I) and the subsection 'MTTF Decreases at Scale' (part of Section III). Pay close attention to Figure 7, which plots the Mean Time To Failure (MTTF) against job size. Note the dramatic decrease in MTTF as the number of GPUs increases and the projection for even larger jobs.
The key insight from this paper is stark: a job's reliability is inversely proportional to the number of components it uses.
- An 8-GPU job might have an MTTF measured in weeks.
- A 1024-GPU job's MTTF drops to just hours.
- The authors project that a 16,384-GPU job would have an MTTF of only 1.8 hours.
This reality forces us to shift our mindset. We cannot prevent failures; we must design systems that can tolerate them and recover gracefully. This is a classic distributed systems challenge. Before we dive into the ML-specific solutions, let's briefly formalize this from a systems theory perspective.
CSE138 (Distributed Systems) L8: forms of fault tolerance, reliable delivery, reliable broadcast
This lecture segment on distributed systems provides the foundational vocabulary for discussing fault tolerance. It helps classify the types of faults we're concerned with and the kinds of guarantees we can provide.
Please watch the first part of the lecture, from 00:09 to 13:00. Focus on the definitions of fault types (crash, omission, Byzantine) and the forms of fault tolerance (masking, fail-safe).
In the context of large-scale training, we are primarily concerned with crash faults (a node or process stops working) and omission faults (e.g., a network packet is dropped). Our goal is to build a fail-safe system. This means that in the presence of a fault, the system maintains its safety properties (e.g., the model parameters are not corrupted), even if it has to sacrifice liveness (the training process pauses temporarily).
The fundamental mechanism for achieving this is to make copies. As the lecturer in the video later states, "fault tolerance often involves making lots of copies." In our context, the primary copy we need to make is a checkpoint: a snapshot of the training state.
2. Checkpointing: Creating a Recovery Point
A checkpoint is a complete, consistent snapshot of the state of a training job, saved to durable storage. It is the foundation of any fault-tolerant training strategy.
What's in a Checkpoint?
A checkpoint must contain everything needed to resume training exactly where it left off. This typically includes:
- Model Parameters: The weights and biases of the neural network.
- Optimizer States: Internal states maintained by the optimizer, such as momentum buffers (for SGD with momentum) or the first and second moment estimates (for Adam). These are often larger than the model parameters themselves.
- Learning Rate Scheduler State: The current learning rate and any internal counters.
- Training Progress: The current epoch and step/iteration number.
- Miscellaneous State: Random number generator states, etc., to ensure data shuffling and augmentations are reproducible.
The AWS blog "Architecting scalable checkpoint storage" provides a useful rule of thumb for estimating checkpoint size.
Architecting scalable checkpoint storage for large-scale ML training ...
This post from AWS provides practical insights into the infrastructure challenges of checkpointing. It begins by offering a simple but effective way to calculate the size of a checkpoint.
Please read the section 'Checkpoint sizing'. Focus on the formula provided: each model parameter requires roughly 10 bytes for a full training checkpoint (2 bytes for FP16/BF16 weight + 8 bytes for optimizer state). Follow the worked example for the 100-billion-parameter model.
As the example shows, a 100B parameter model requires approximately 1 TB for a single checkpoint. This highlights that checkpointing is not a trivial file-save operation; it is a large-scale data movement problem.
Distributed Checkpoints
For large models trained with parallelism (data, tensor, or pipeline), the state is sharded across many GPUs. A checkpoint is therefore not a single monolithic file but a collection of sharded files that represent the distributed state. Upon restart, each rank loads its corresponding piece of the state.
These images help visualize how a distributed state is captured.


3. The Core Trade-off: Checkpoint Frequency vs. Overhead
Now we arrive at the central design decision: how often should we checkpoint?
- Checkpoint too frequently: You minimize the work lost upon failure, but you incur significant overhead from pausing training to save the state.
- Checkpoint too infrequently: You reduce the overhead, but a single failure could wipe out many hours of expensive computation.
This trade-off can be quantified using a metric called Effective Training Time Ratio (ETTR), which measures the proportion of time spent making meaningful progress.
Revisiting Reliability in Large-Scale Machine Learning ...
The Meta paper on reliability introduces and formally defines ETTR. It provides a powerful analytical model for reasoning about this trade-off.
Please read the following sections: 'Metrics' (Section II-D): Understand the definition of ETTR and its components, particularly 'Catching up from last saved checkpoint' and 'Restart overhead'. 'Quantifying ETTR at Scale' (in Section III) and 'Derivations of Expected ETTR' (Appendix -A): You don't need to follow every step of the derivation, but focus on the final simplified formula (Equation 2) and its components: MTTF, checkpoint interval (T_c), and restart overhead (T_o). Pay attention to Figure 10, which shows the required checkpoint interval to achieve a target ETTR at massive scale.
The simplified formula for high-priority jobs is approximately:
Where:
- is the checkpoint interval. On average, a failure occurs halfway through an interval, so is the lost computation time.
- is the restart overhead (loading the checkpoint, initialization).
- is the Mean Time To Failure for the job.
This model makes the trade-off explicit. To maximize ETTR, we need to minimize the fraction . Since MTTF is largely fixed by the job scale, our levers are to decrease the checkpoint interval () and the restart overhead (). This leads us to the key strategies for efficient checkpointing.
4. Strategies for Efficient Checkpointing and Restart
The goal of advanced checkpointing strategies is to reduce the overhead associated with saving () and loading () so we can afford to checkpoint more frequently, thereby increasing ETTR.
Architecting scalable checkpoint storage for large-scale ML training ...
The AWS blog on checkpoint storage provides an excellent breakdown of modern strategies for both writing (saving) and reading (restarting) checkpoints.
Please read the sections titled 'Checkpointing reading strategies at scale', 'Checkpointing writing strategies at scale', and 'Multi-level checkpointing'.
Let's synthesize the key strategies from that reading.
4.1. Writing Strategy: Asynchronous Checkpointing
- Problem: Traditional synchronous checkpointing pauses all 4,000 GPUs in a cluster to write 1 TB of data. This creates massive idle time—the blog calculates this can be thousands of lost GPU-hours per day.
- Solution: With asynchronous checkpointing, the training process copies the model state to a staging buffer (e.g., in CPU RAM or on a local NVMe drive) and immediately resumes computation. A background process then handles the slower task of writing the staged data to durable storage. This dramatically reduces the time the GPUs are idle, effectively minimizing the checkpointing overhead component of .
4.2. Reading Strategy: Hierarchical Distribution
- Problem: During a restart, all 4,000 GPUs need to read the 1 TB checkpoint. If they all try to pull it from a central storage system simultaneously, this "thundering herd" will overwhelm the storage and network, leading to a very long restart time ().
- Solution: In a hierarchical distribution, a small number of "leader" nodes read the checkpoint from durable storage. They then use the high-bandwidth, low-latency internal cluster network (e.g., NVLink, InfiniBand) to efficiently broadcast the checkpoint data to their peers. This reduces the load on the central storage system by orders of magnitude and significantly shortens restart time.
4.3. A Hybrid Approach: Multi-Level Checkpointing
This strategy combines the best of both worlds by creating a tiered system:
- Fast-Tier Checkpoints: Very frequent (e.g., every 5 minutes), low-overhead, asynchronous checkpoints are saved to fast but less durable local storage (like an NVMe drive). These can recover from transient failures like application crashes or
NaNerrors where the node itself is still healthy. - Durable-Tier Checkpoints: Less frequent (e.g., every hour), higher-overhead checkpoints are written to a highly durable object store (like Amazon S3). These are used to recover from catastrophic hardware failures where the node is lost.
This approach offers frequent recovery points against common failures while minimizing expensive writes to durable storage, providing a robust balance of safety and performance.
Conclusion
In this lesson, we established that fault tolerance is not an optional extra but a mandatory design consideration for large-scale ML training. The statistical certainty of failures at scale requires a systematic approach to recovery.
Key Takeaways:
- Failures are inevitable at scale: Mean Time To Failure (MTTF) decreases inversely with the number of components, dropping from weeks for small jobs to hours for large ones.
- Checkpointing is the fundamental mechanism for fault tolerance: It involves saving a complete snapshot of the training state (model, optimizer, etc.) to durable storage.
- Checkpointing is a trade-off: This is best quantified by the Effective Training Time Ratio (ETTR), which balances the lost work from a failure against the overhead of checkpointing and restarting.
- Efficient checkpointing relies on key strategies:
- Asynchronous Writes: Minimize GPU idle time by offloading the slow storage I/O to a background process.
- Hierarchical Reads: Avoid "thundering herd" problems during restart by having leader nodes distribute the checkpoint over the fast internal network.
- Multi-level Checkpointing: Use a tiered approach with frequent, fast local checkpoints for transient errors and less frequent, durable checkpoints for hard failures.
Preview of the Next Lesson:
Many of the hardware failures that necessitate checkpointing are related to the physical stresses placed on components. Our next lesson, "Describe the key power and cooling considerations in designing and operating large-scale GPU deployments," will delve into the physical layer of the datacenter. Understanding how to manage power and dissipate heat is critical not only for preventing failures but also for enabling the sheer density of computation required by modern AI.