FastPersist: Accelerating Model Checkpointing in Deep Learning

Guanhua Wang, Olatunji Ruwase, Bing Xie, Yuxiong HearXiv 2024

Abstract

Model checkpoints are critical Deep Learning (DL) artifacts that enable fault tolerance for training and downstream applications, such as inference. However, writing checkpoints to persistent storage, and other I/O aspects of DL training, are mostly ignored by compute-focused optimization efforts for faster training of rapidly growing models and datasets. Towards addressing this imbalance, we propose FastPersist to accelerate checkpoint creation in DL training. FastPersist combines three novel techniques: (i) NVMe optimizations for faster checkpoint writes to SSDs, (ii) efficient write parallelism using the available SSDs in training environments, and (iii) overlapping checkpointing with independent training computations. Our evaluation using real world dense and sparse DL models shows that FastPersist creates checkpoints in persistent storage up to 116x faster than baseline, and enables per-iteration checkpointing with negligible overhead.

The I/O Wall in Deep Learning

In the era of massive Large Language Models (LLMs), training efficiency is often limited by hardware reliability. To mitigate the risk of failure, researchers periodically save "checkpoints"—complete snapshots of the model's state—to persistent storage. However, a significant "I/O Wall" has emerged: while GPU compute performance has scaled exponentially, SSD write speeds have lagged behind.

In large-scale training setups, the time spent waiting for a checkpoint to save can consume up to 96% of a total training iteration. This leads to a scalability paradox: as more GPUs are added to reduce computation time, the relative overhead of checkpointing increases because the I/O time remains constant. Consequently, researchers often checkpoint infrequently, risking the loss of hours of expensive compute time in the event of a crash.

Iteration time breakdown showing checkpointing overhead dominating as data parallelism increases.

FastPersist: Breaking the Bottleneck

FastPersist addresses these challenges through three primary architectural innovations:

1. NVMe-Specific Optimizations

Standard I/O libraries are typically not optimized for the high-concurrency nature of NVMe SSDs. FastPersist leverages modern asynchronous I/O interfaces (such as io_uring) and implements a double-buffering strategy. This allows the system to overlap data transfers from GPU memory (HBM) to CPU memory (DRAM) with the subsequent transfer from DRAM to the SSD, maximizing hardware utilization.

2. Parallelized Checkpoint Writes

In Data Parallel (DP) training, every GPU rank maintains an identical copy of the model. FastPersist exploits this redundancy by sharding the checkpoint across all available nodes. Instead of a single rank writing the entire model, each GPU writes a unique portion to its local SSD. This effectively aggregates the write bandwidth of the entire cluster.

3. Pipelined Checkpointing

The authors identified that while a checkpoint depends on the current iteration's optimizer step, the subsequent iteration's forward and backward passes do not depend on the checkpoint's completion. FastPersist decouples these dependencies, running the checkpointing process in a background thread to allow the next training iteration to proceed immediately.

Evolution of checkpointing strategies from baseline to FastPersist's pipelined approach.

Evaluation and Results

The system was evaluated on a cluster of 8 NVIDIA DGX-2 nodes (128 V100 GPUs) using GPT-3 models ranging from 0.7B to 13B parameters, including sparse Mixture-of-Experts (MoE) variants.

  • Throughput and Speedup: FastPersist achieved an aggregate write throughput of 146 GB/sec, representing roughly 80% of the hardware's theoretical peak. Compared to the standard torch.save() baseline, checkpointing was up to 116x faster.
  • Reduced Overhead: By pipelining I/O, the training slowdown associated with per-iteration checkpointing was reduced from over 90% to less than 5% for most model sizes.
  • End-to-End Efficiency: For a GPT3-0.7B model, FastPersist provided a 21.8x speedup in total training time when checkpointing every iteration.

Conclusion

FastPersist demonstrates that model checkpointing can be made "practically free" by aligning I/O strategies with modern hardware capabilities and training patterns. By treating redundancy as an asset and overlapping I/O with compute, the system enables high-frequency checkpointing, significantly improving the fault tolerance and overall efficiency of large-scale deep learning training.

Summary updated

BibTeX
@misc{wang2024fastpersist,
  author = {Guanhua Wang and Olatunji Ruwase and Bing Xie and Yuxiong He},
  title = {{FastPersist: Accelerating Model Checkpointing in Deep Learning}},
  year = {2024},
  eprint = {2406.13768},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.13768},
}
Figure