Abstract
Finishing 90-epoch ImageNet-1k training with ResNet-50 on a NVIDIA M40 GPU takes 14 days. This training requires 10^18 single precision operations in total. On the other hand, the world's current fastest supercomputer can finish 2 * 10^17 single precision operations per second. If we can make full use of the supercomputer for DNN training, we should be able to finish the 90-epoch ResNet-50 training in one minute. However, the current bottleneck for fast DNN training is in the algorithm level. Specifically, the current batch size (e.g. 512) is too small to make efficient use of many processors. For large-scale DNN training, we focus on using large-batch data-parallelism synchronous SGD without losing accuracy in the fixed epochs. The LARS algorithm enables us to scale the batch size to extremely large case (e.g. 32K). We finish the 100-epoch ImageNet training with AlexNet in 11 minutes on 1024 CPUs. About three times faster than Facebook's result, we finish the 90-epoch ImageNet training with ResNet-50 in 20 minutes on 2048 KNLs without losing accuracy. State-of-the-art ImageNet training speed with ResNet-50 is 74.9% top-1 test accuracy in 15 minutes. We got 74.9% top-1 test accuracy in 64 epochs, which only needs 14 minutes. Furthermore, when we increase the batch size to above 16K, our accuracy is much higher than Facebook's on corresponding batch sizes.
The Challenge of Large-Batch Training
Training state-of-the-art deep neural networks (DNNs) is notoriously slow. A standard 90-epoch training run of ResNet-50 on a single NVIDIA M40 GPU takes about 14 days. While modern supercomputers have the theoretical raw computing power to finish this in seconds, we can't currently "fill" that capacity.
The bottleneck is algorithmic: to use more processors effectively, you must increase the batch size (the number of images processed before updating the model's weights). However, as batch sizes grow beyond a certain point (usually ~8K), model accuracy typically plummets. This research tackles the challenge of scaling synchronous Stochastic Gradient Descent (SGD) to extremely large batches (32K) while maintaining high accuracy.
Layer-wise Adaptive Rate Scaling (LARS)
The core innovation is the Layer-wise Adaptive Rate Scaling (LARS) algorithm. Standard SGD uses a single learning rate for the whole network. LARS uses a different learning rate for each layer, calculated based on the ratio between the norm of the weights and the norm of the gradients. This prevents "gradient explosions" or "vanishing gradients" that often occur in large-batch training.
As shown in the figure above, without LARS, training with a 32k batch size fails to reach competitive accuracy levels, whereas LARS allows the large-batch model to track closely with the small-batch (256) baseline.
Scaling Results and Comparison
The authors utilized the TACC Stampede 2 supercomputer, testing both Intel Skylake CPUs and Knights Landing (KNL) accelerators. By using large batches, they significantly reduced communication overhead. Large batches are more efficient not just because they parallelize work, but because they reduce the number of messages sent across the network. By increasing the batch size from 512 to 32K, the number of iterations (and thus synchronization points) drops by a factor of 64.
| Model | Hardware | Batch Size | Time | Accuracy (Top-1) |
|---|---|---|---|---|
| AlexNet | 1024 CPUs | 32K | 11 mins | 58.6% |
| ResNet-50 | 1024 CPUs | 32K | 48 mins | 74.7% |
| ResNet-50 | 2048 KNLs | 32K | 20 mins | 74.9% |
Previous high-water marks, such as Facebook's 1-hour ResNet training, saw accuracy drop significantly when batches exceeded 8K. This study shows that with LARS, accuracy remains stable even at 32K, actually outperforming Facebook's accuracy at those extreme scales.
Conclusion
This work demonstrates that CPUs can be highly effective for deep learning when paired with appropriate algorithmic innovations. By scaling to 1,024 CPUs and utilizing LARS, the researchers achieved training speeds that surpassed previous GPU-based benchmarks. Future work could further explore how LARS behaves on the latest generation of specialized AI accelerators and address the "straggler" problem in synchronous SGD.
Summary updated