1-bit LAMB: Communication Efficient Large-Scale Large-Batch Training with LAMB's Convergence Speed

Conglong Li, Ammar Ahmad Awan, Hanlin Tang, Samyam Rajbhandari, Yuxiong He

TL;DR

Training massive deep learning models like BERT on hundreds of GPUs is bottlenecked by communication. This paper introduces "1-bit LAMB," a novel optimizer that combines large-batch training (LAMB) with aggressive communication compression (1-bit Adam) to significantly reduce communication volume and speed up training without sacrificing convergence or accuracy.

What Problem Does This Paper Address?

Training large-scale deep learning models, such as BERT and GPT-3, on distributed systems with hundreds of GPUs is computationally intensive. A major bottleneck in such setups, especially on commodity hardware with limited bandwidth, is the communication overhead between GPUs. While two promising solutions exist – large-batch optimization (like LAMB) to reduce communication frequency and communication compression (like 1-bit Adam) to reduce the volume of each communication – simply combining them doesn't work. The authors found that existing compression techniques are incompatible with LAMB's unique adaptive layerwise learning rates, leading to convergence issues. This paper aims to bridge this gap by developing a method that effectively integrates both large-batch optimization and communication compression.

Methods

The core contribution is the 1-bit LAMB algorithm. It's a two-stage approach:

  1. Warm-up Stage: Standard LAMB is used for a set number of steps to "pre-condition" the optimizer and establish a stable baseline.
  2. Compression Stage: Here, the novelty lies in how 1-bit LAMB adapts LAMB's layerwise learning rates under compression. Unlike previous methods that simply freeze parameters, 1-bit LAMB uses a novel "reconstructed gradient" approach based on compressed momentum. This allows it to adaptively scale layerwise learning rates, compensating for the frozen variance and maintaining LAMB's convergence speed. They also introduce stabilized soft thresholds for more stable training.

Additionally, they developed a new NCCL-based compressed communication backend for PyTorch distributed. This backend aims to improve both usability and performance compared to existing MPI-based solutions.

Datasets

  • BERT-Large pre-training: The authors used a dataset comprising Wikipedia and BooksCorpus, similar to the original BERT paper.
  • GLUE benchmark: Used for evaluating fine-tuning performance.
  • SQuAD 1.1: Used for evaluating fine-tuning performance.

No new benchmarks were introduced.

Key Insights and Ideas

  • Synergy is Key: Neither large-batch training nor communication compression alone is sufficient for efficient large-scale distributed training, especially under limited bandwidth. Their combination is crucial.
  • LAMB's Adaptivity is Tricky: LAMB's adaptive layerwise learning rates, while beneficial for convergence, pose a significant challenge for direct application of existing compression techniques. The unique way LAMB's scaling coefficients depend on variance makes simple freezing problematic.
  • Novel Adaptation for Compression: The core innovation is the method for adapting LAMB's layerwise learning rates during the compression stage, enabling it to maintain convergence speed and accuracy.
  • System Matters: A well-designed communication backend (like their NCCL-based one) is essential for realizing the full benefits of these algorithmic improvements.

Key Results

  • Communication Reduction: Achieved up to 4.6x communication volume reduction for BERT-Large pre-training.
  • Speedup: Demonstrated up to 2.8x end-to-end time-wise speedup for BERT-Large pre-training on up to 256 GPUs.
  • Convergence & Accuracy: Maintained the same sample-wise convergence speed and fine-tuning task accuracy as uncompressed LAMB.
  • Scalability: The NCCL-based backend showed better performance on Ethernet clusters and comparable performance on InfiniBand clusters compared to MPI-based implementations.
  • Efficiency: 1-bit LAMB on Ethernet clusters achieved comparable throughput to uncompressed LAMB on InfiniBand clusters, highlighting its efficiency.

Limitations and Future Work

  • Memory Overhead: 1-bit LAMB introduces additional memory overhead due to storing a persistent copy of the "fresh" variance and a temporary copy of the last step's momentum. This limited their ability to fit very large batch sizes on GPUs with smaller memory (e.g., 16GB V100s) when the number of GPUs was small.
  • Hyperparameter Tuning: While the core algorithm is robust, the number of warmup steps requires some tuning, though the authors suggest it could potentially be automated.
  • Future Work: The paper doesn't explicitly detail future work, but the success of their NCCL-based backend suggests further integration and optimization within deep learning frameworks would be beneficial. The theoretical analysis provides a foundation for understanding convergence guarantees, which could be extended to more complex scenarios.

Summary updated

BibTeX
@inproceedings{li2022bit,
  author = {Conglong Li and Ammar Ahmad Awan and Hanlin Tang and Samyam Rajbhandari and Yuxiong He},
  title = {{1-bit LAMB: Communication Efficient Large-Scale Large-Batch Training with LAMB's Convergence Speed}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=eypsJ0rvAqo},
}
Figure