Abstract
As deep learning models continue to expand in size, they increasingly encounter a "memory wall" where the memory requirements for weights, activations, and optimizer states exceed the capacity of even high-end GPUs. This survey provides a comprehensive taxonomy of techniques—including rematerialization, offloading, and advanced parallelism—designed to enable the efficient training of massive neural networks within fixed hardware constraints.
Introduction: The Memory Wall
The primary bottleneck in modern AI is the disparity between rapidly growing model sizes and the relatively slow increase in GPU memory. While a CPU might have hundreds of gigabytes of RAM, a GPU typically offers only a few dozen. Training a Large Language Model (LLM) requires storing model weights, intermediate activations from the forward pass, and optimizer states (e.g., momentum). When these components exceed GPU memory, training either fails or becomes inefficient due to forced reductions in batch size. This survey categorizes solutions based on their ability to save memory, optimize computation, or reduce communication overhead between devices.
Taxonomy of Efficiency Techniques
The paper organizes efficiency strategies into three primary pillars: single-GPU memory reduction, multi-GPU parallelism, and optimizer/communication efficiency.
1. Single-GPU Memory Reduction
- Rematerialization (Checkpointing): Instead of storing all activations, the system discards some and recomputes them during the backward pass. This trades additional computation for a significantly reduced memory footprint.
- Offloading: This involves moving tensors (activations or weights) from fast GPU memory to larger, slower CPU RAM via the PCIe bus, retrieving them only when needed.
2. Parallelism Strategies
- Data Parallelism: Distributing data samples across multiple GPUs. A key advancement is the Zero Redundancy Optimizer (ZeRO), which eliminates redundant storage of model states across GPUs by sharding them.
- Model and Pipeline Parallelism: These methods split the model itself across devices. Pipeline Parallelism allows different GPUs to process different stages of the model simultaneously. Effective scheduling, such as the 1F1B (one-forward-one-backward) approach, is critical to minimizing idle time, often referred to as the "pipeline bubble."
3. Optimizer and Communication Efficiency
- Low-Precision Training: Utilizing 8-bit or 4-bit representations for optimizer states and gradients to reduce memory and bandwidth requirements.
- Gradient Compression: Techniques like sparsification or quantization reduce the volume of data synchronized between GPUs.
Key Insights and Trade-offs
- The Compute-Memory Trade-off: Rematerialization demonstrates that recomputing values can be more efficient than storing them if it enables larger, more computationally dense batch sizes.
- Balancing the Three Walls: Efficiency requires balancing arithmetic intensity (GPU core utilization), memory capacity, and inter-node bandwidth.
- Redundancy Reduction: Standard data parallelism is often wasteful. Sharding optimizer states via techniques like ZeRO provides near-linear memory scaling.
- Asynchrony vs. Convergence: While asynchronous updates (e.g., PipeDream) maximize GPU utilization, they introduce "weight staleness," which can negatively impact training stability or final accuracy.
Notable Results
The survey highlights several milestones in the field:
- ZeRO-Offload: Enables training models with over 10 billion parameters on a single GPU.
- 8-bit Optimizers: Compressing Adam optimizer states to 8-bit can achieve a 4x memory reduction with negligible loss in accuracy.
- Optimal Checkpointing: Algorithms like REVOLVE provide mathematically optimal schedules for recomputing activations in sequential networks, minimizing overhead.
Limitations and Future Directions
Despite significant progress, several challenges remain. Most optimal memory strategies are designed for simple sequential chains and rely on heuristics for complex models with residual connections. Furthermore, many low-precision techniques require specific hardware support (e.g., Tensor Cores) to realize actual speedups. Finally, while frameworks like DeepSpeed are improving accessibility, achieving "transparent" implementation—where users do not need to manually tune strategies—remains a primary research goal.
Summary updated