TL;DR
Training massive Mixture-of-Experts (MoE) models is hampered by enormous checkpoint sizes, leading to significant overhead. This paper introduces MoC-System, a novel approach that uses Partial Experts Checkpointing (PEC) to drastically reduce checkpoint size by selectively saving experts, combined with advanced sharding and management techniques to maintain efficiency and accuracy.
What Problem Does This Paper Address?
Large Language Models (LLMs) are growing at an unprecedented rate, and the Mixture-of-Experts (MoE) architecture has emerged as a key strategy to scale model capacity without a proportional increase in computational cost. However, this scaling comes with a major challenge: fault tolerance. Distributed training of these massive MoE models relies heavily on checkpointing to save progress and recover from inevitable hardware failures. Traditional checkpointing methods, while effective for dense models, become prohibitively expensive for MoE models due to the sheer volume of parameters stored in numerous "experts." This leads to massive checkpoint files, prolonged saving times, and increased overall training duration, making fault tolerance a bottleneck.
Methods
The core innovation is the Mixture-of-Checkpoint System (MoC-System), which orchestrates checkpointing for MoE models. Key components include:
- Partial Experts Checkpointing (PEC): Instead of saving all experts in an MoE layer, PEC selectively saves a subset of experts (
Kpec) per layer, significantly reducing checkpoint size. This is inspired by observations that MoE models are somewhat robust to updates on a subset of experts. - Proportion of Lost Tokens (PLT) Metric: A novel metric to quantify the accuracy impact of PEC by measuring the proportion of tokens whose expert updates are "lost" due to not being saved in a checkpoint.
- Fully Sharded Checkpointing: Extends existing sharding strategies to efficiently distribute checkpointing workloads across all distributed ranks, specifically optimizing for MoE's expert parallelism.
- Two-Level Checkpointing Management: A system that asynchronously handles in-memory snapshots (GPU-to-CPU) and persistent storage (CPU-to-Storage) separately, leveraging memory bandwidth and storage persistence. This includes adaptive configuration of hyperparameters like
KsnapshotandKpersistfor optimal overlap and reduced overhead. - Adaptive Sharding for Non-Expert Part: A strategy to adaptively allocate non-expert parts of the checkpoint based on PEC's selection pattern, balancing workload across ranks.
- Dynamic-K Strategy: Adjusts
Kpecdynamically in response to accumulated faults to keep PLT below a critical threshold.
Datasets
- Wikitext-2: Used for correlation analysis between PLT and model accuracy.
- SlimPajama-627B (1B token subset): Used for pre-training the GPT-350M-16E model.
- ImageNet-1K: Used for training the SwinV2-MoE vision model.
- OLMOE model fine-tuned on Alpaca dataset: Used to evaluate fault tolerance during fine-tuning.
Key Insights and Ideas
- MoE sparsity is a double-edged sword: While it enables massive parameter counts, it also creates a checkpointing bottleneck. However, this sparsity also makes the model somewhat resilient to partial updates, enabling PEC.
- Selective saving is key: The insight that not all experts need to be saved at every checkpoint is crucial. This allows for drastic size reductions without catastrophic accuracy loss.
- Accuracy can sometimes improve with "lossy" checkpoints: The paper suggests that the "loss" of expert updates from PEC can act as a form of regularization, potentially preventing overfitting and leading to slight accuracy improvements on downstream tasks.
- Algorithm-system co-design is vital: MoC-System isn't just an algorithm; it's a system that deeply integrates with the training process, leveraging hardware capabilities (memory bandwidth, PCIe) and distributed training paradigms (DP, EP) for maximum efficiency.
Key Results
- Checkpoint Size Reduction: PEC achieved up to a 57.7% reduction in total checkpoint size, and with
Kpec=1, it reached 42.3% of the full model checkpoint size. - Overhead Reduction: MoC-System reduced overhead for each checkpointing process by up to 98.9% compared to the original method.
- Speedup: Training iterations were sped up by up to 5.12x with MoC-System.
- Accuracy Preservation/Improvement: Recovery from PEC checkpoints maintained comparable validation loss and achieved an average accuracy increase of 1.08% on downstream tasks.
- PLT Threshold: Model accuracy remained stable when PLT was below 3.75%.
Limitations and Future Work
- PLT vs.
KpecTrade-off: While PEC reduces checkpoint size, it introduces PLT. The paper explores strategies to manage this trade-off, but it remains a core consideration. - Complexity of Load-aware Selection: While load-aware expert selection was explored, it was found to require more complex control mechanisms and higher costs, making sequential selection more practical.
- Future Work: The authors suggest exploring MoE's inherent sparsity for more efficient co-design strategies in LLM training and fault tolerance. They also aim to extend their work to other LLM algorithms and fault tolerance mechanisms.
Summary updated