Abstract
The communication of gradients is costly for training deep neural networks with multiple devices in computer vision applications. In particular, the growing size of deep learning models leads to higher communication overheads that defy the ideal linear training speedup regarding the number of devices. Gradient quantization is one of the common methods to reduce communication costs. However, it can lead to quantization error in the training and result in model performance degradation. In this work, we deduce the optimal condition of both the binary and multi-level gradient quantization for ANY gradient distribution. Based on the optimal condition, we develop two novel quantization schemes: biased BinGrad and unbiased ORQ for binary and multi-level gradient quantization respectively, which dynamically determine the optimal quantization levels. Extensive experimental results on CIFAR and ImageNet datasets with several popular convolutional neural networks show the superiority of our proposed methods.
Introduction
Training massive Deep Neural Networks (DNNs) requires distributed computing, where multiple devices (GPUs or edge devices) work together. However, these devices must constantly "talk" to each other by sharing gradients. As models grow into the hundreds of millions of parameters, this communication becomes a massive bottleneck; often, the time spent transmitting data exceeds the time spent actually calculating it.
To address this, researchers use gradient quantization to shrink 32-bit floating-point numbers into just a few bits (sometimes only 1 bit). However, quantization introduces noise or error. Existing methods often assume gradients follow a specific pattern (like a Gaussian distribution) or use fixed, evenly spaced levels. In reality, gradient distributions change during training and across different layers. This paper introduces a universal, distribution-agnostic framework to find the most efficient quantization levels dynamically.
Methodology: ORQ and BinGrad
The authors deduce the optimal condition for quantization by minimizing the Mean Square Error (MSE) between the full-precision gradient and its quantized version. This leads to two primary schemes:
- ORQ (Optimized Random Quantization): Designed for multi-level quantization (e.g., 4 or 8 levels). It uses a greedy recursive algorithm to find the "sweet spots" for quantization levels based on the actual distribution of the gradients at that specific moment in training. Unlike standard methods that space levels evenly, ORQ places levels where the gradient density is highest.
- BinGrad (Binarized Gradient): Designed for aggressive 1-bit compression. It includes BinGrad-b (biased, deterministic) and BinGrad-pb (partially biased, hybrid) to balance the trade-off between bias and variance.
By analyzing the histograms of quantized gradients, the authors found that in standard methods like QSGD, many quantization levels are barely used. ORQ "spreads the wealth," ensuring every bit of the communication budget is used to represent the gradient's shape accurately.
Experimental Results
The researchers evaluated their methods on standard computer vision benchmarks including CIFAR-10, CIFAR-100, and ImageNet using various architectures like ResNet and GoogLeNet.
Key findings include:
- ImageNet (ResNet-50): With a ~20x compression ratio, ORQ-3 achieved 73.92% top-1 accuracy, significantly higher than TernGrad's 72.62%.
- Accuracy Gains: On CIFAR-100, ORQ-9 achieved 72.37% accuracy on ResNet-56, nearly matching the full-precision (FP) baseline of 72.66%, while using 10x less communication.
- Binary Performance: Even at 32x compression (1-bit), BinGrad-b achieved 69.83% on ResNet-110 (CIFAR-100), outperforming SignSGD (68.21%).
Discussion and Future Work
While ORQ and BinGrad show significant improvements, there are trade-offs. The ORQ algorithm relies on a greedy recursive search; while the authors describe the overhead as trivial, more efficient algorithms could further reduce latency. Additionally, the fundamental trade-off in binary quantization between bias (BinGrad-b) and variance (BinGrad-pb) remains a challenge. Future research could extend these optimal conditions to other model types like Transformers or Recurrent Neural Networks (RNNs).
Summary updated