[Paper Review] ZeRO-Offload: Democratizing Billion-Scale Model Training
ZeRO-Offload offloads gradients, optimizer states, and optimizer computation to CPU to train models up to 13B parameters on a single GPU, with scalable performance and seamless PyTorch integration.
Large-scale model training has been a playing ground for a limited few requiring complex model refactoring and access to prohibitively expensive GPU clusters. ZeRO-Offload changes the large model training landscape by making large model training accessible to nearly everyone. It can train models with over 13 billion parameters on a single GPU, a 10x increase in size compared to popular framework such as PyTorch, and it does so without requiring any model change from the data scientists or sacrificing computational efficiency. ZeRO-Offload enables large model training by offloading data and compute to CPU. To preserve compute efficiency, it is designed to minimize the data movement to/from GPU, and reduce CPU compute time while maximizing memory savings on GPU. As a result, ZeRO-Offload can achieve 40 TFlops/GPU on a single NVIDIA V100 GPU for 10B parameter model compared to 30TF using PyTorch alone for a 1.4B parameter model, the largest that can be trained without running out of memory. ZeRO-Offload is also designed to scale on multiple-GPUs when available, offering near linear speedup on up to 128 GPUs. Additionally, it can work together with model parallelism to train models with over 70 billion parameters on a single DGX-2 box, a 4.5x increase in model size compared to using model parallelism alone. By combining compute and memory efficiency with ease-of-use, ZeRO-Offload democratizes large-scale model training making it accessible to even data scientists with access to just a single GPU.
Motivation & Objective
- Motivate the need for accessible billion-parameter model training and reduce hardware barriers.
- Propose a unique offload strategy that maximizes GPU memory savings while minimizing CPU compute and CPU-GPU communication.
- Demonstrate scalability of the approach from single GPUs to up to 128 GPUs using ZeRO-powered data parallelism and possible model parallelism.
- Provide optimized CPU execution (fast Adam) and a scheduling technique to preserve throughput and accuracy.
Proposed method
- Model training is represented as a data-flow graph and partitioned between CPU and GPU to optimize compute, communication, and memory savings.
- Offload strategy keeps FP16 parameters on GPU while offloading FP16 gradients and FP32 optimizer states to CPU, and performs parameter updates on CPU.
- Partitioning analysis shows the minimum CPU computation and minimum CPU-GPU communication, leading to an optimal offload decision.
- combines offload with ZeRO-stage-2 data parallelism to achieve near-linear scaling up to 128 GPUs and compatibility with model parallelism for even larger models.
- An optimized CPU Adam implementation using SIMD, loop unrolling, and multithreading is used, plus a one-step delayed parameter update to overlap CPU and GPU work.
- A delayed parameter update (DPU) option allows overlapping CPU updates with GPU compute to improve throughput without accuracy loss.
Experimental results
Research questions
- RQ1Can ZeRO-Offload enable training of models larger than what fits in a single GPU memory without sacrificing efficiency?
- RQ2How does offloading to CPU interact with ZeRO data parallelism to scale across many GPUs?
- RQ3What are the practical throughput and memory savings when training billion-parameter models on single/multiple GPUs?
- RQ4Does an optimized CPU Adam and DPU maintain model convergence while improving performance?
Key findings
- Training models up to 13B parameters on a single NVIDIA V100 GPU with 40 TFLOPS, versus 1.2B that fits without offloading.
- Near-linear scalability on up to 128 GPUs when combined with ZeRO-powered data parallelism.
- On a DGX-2 node, up to 70B parameters can be trained when combining ZeRO-Offload with model parallelism.
- CPU-Adam optimization yields over 6x speedup over standard PyTorch Adam implementations and, with delayed parameter update, up to 1.5x end-to-end throughput improvement.
- The approach enables training of 10x larger models with minimal CPU computation overhead and controlled communication, without requiring model refactoring.
- The offload strategy is unique and optimal under the defined objectives of maximizing GPU memory savings while minimizing CPU compute and CPU-GPU communication.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.