TL;DR
Training massive deep learning models strains GPU memory. This paper introduces Lynx, a framework that cleverly overlaps recomputation (a memory-saving technique) with communication in distributed training. By doing so, Lynx significantly speeds up training and reduces memory overhead, outperforming existing methods by up to 1.37x.
What Problem Does This Paper Address?
The ever-increasing size of deep learning models, like GPT, is pushing the limits of GPU memory. While techniques like pipeline and tensor parallelism help distribute the workload across multiple GPUs, they often aren't enough to prevent out-of-memory errors. Recomputation, where intermediate activation values are discarded and regenerated during the backward pass, is a common solution to save memory. However, existing recomputation methods are either too rigid (rule-based) or too slow to configure (model-adaptive), and crucially, they all perform recomputation on the critical training path, adding latency. This paper tackles the challenge of making recomputation more efficient and less intrusive, especially in the context of complex distributed training setups.
Methods
Lynx introduces a novel framework with three core components:
- Model Profiler: This component analyzes the model's structure and operator behavior during a test run to gather crucial metrics like operator type, execution time, and dependencies.
- Model Policy Maker: This is the brain of Lynx. It uses the profiled information to:
- Heuristic-based Recomputation Scheduling (Lynx-HEU): Instead of brute-force searching for the best recomputation strategy, Lynx-HEU leverages the observation that large DNNs have repetitive structures (like identical transformer layers). It finds an optimal recomputation policy for a single representative structure and applies it across all similar structures, drastically reducing search time.
- Recomputation-Aware Model Partitioning: This algorithm balances the workload across pipeline stages, but unlike traditional methods, it considers the recomputation strategy when partitioning. This ensures that stages with recomputation are not disproportionately slowed down, leading to better overall pipeline efficiency.
- Model Deployer: This component implements the determined optimal schedule on the physical hardware.
The key innovation is overlapping recomputation with communication. Instead of recomputing on the critical path, Lynx schedules recomputation to occur during the communication phases of tensor parallelism, effectively hiding the recomputation overhead.
Datasets
The paper uses the WikiText2 dataset for training and evaluation. They evaluate their framework on various GPT models ranging in size from GPT-300M to GPT-23B parameters.
Key Insights and Ideas
- Recomputation doesn't have to be on the critical path: The paper's core insight is that recomputation can be scheduled flexibly, particularly to overlap with communication phases in tensor parallelism, effectively hiding its latency.
- Repetitive structures are a goldmine for optimization: The observation that large DNNs have many identical layers allows for a heuristic approach to recomputation scheduling (Lynx-HEU), dramatically reducing the search space and time.
- Partitioning needs to be recomputation-aware: Simply balancing computation across pipeline stages isn't enough. To maximize throughput, the partitioning strategy must account for the recomputation overhead and opportunities for overlap.
- Communication overhead is a significant bottleneck: The paper highlights that tensor parallelism communication can consume a substantial portion of training time (10-70%), creating an opportunity for Lynx to hide recomputation within this time.
Key Results
- Lynx achieves up to 1.37x higher training throughput compared to existing methods like Full Recomputation, Selective Recomputation, and AdaPipe.
- Lynx-HEU can find near-optimal recomputation policies in seconds, even for very large models (e.g., 175B parameters), compared to hours or days for other methods.
- The recomputation-aware model partitioning strategy improves throughput by 1.1x-1.23x compared to standard partitioning.
- Lynx effectively reduces recomputation time on the critical path by 71%-94% compared to Full Recomputation and 31%-80% compared to AdaPipe.
- The framework demonstrates effectiveness across different hardware (NVIDIA GPUs, Ascend NPUs) and parallelism configurations.
Limitations and Future Work
- Homogeneous Clusters: The current formulation of Lynx focuses on homogeneous GPU clusters. The authors plan to explore extensions for heterogeneous GPU clusters in future work.
- Model Accuracy: While Lynx aims to avoid impacting model accuracy, the paper doesn't deeply explore the potential trade-offs or provide extensive empirical validation of accuracy preservation across all scenarios.
- New Hardware: The paper notes that future AI accelerators and training systems might increase communication pressure, suggesting that Lynx's techniques will become even more effective. This implies a potential avenue for future research to adapt Lynx to these emerging hardware architectures.
Summary updated