ImageNet Training in Minutes

Yang You, Zhao Zhang, Cho‐Jui Hsieh, James Demmel, Kurt Keutzer · DOI

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.

Introduction

Training state-of-the-art Deep Neural Networks (DNNs) is notoriously slow. While modern supercomputers possess the raw computational power to finish tasks like ImageNet training in seconds, the bottleneck remains algorithmic. To utilize thousands of processors simultaneously, researchers use data-parallel synchronous Stochastic Gradient Descent (SGD). However, to keep these processors busy, the batch size must be increased significantly. Historically, as the batch size increases beyond a certain point (usually 8K), the model's final accuracy plummets—a phenomenon often attributed to the "generalization gap" or optimization instabilities. This paper addresses the "8K barrier," scaling training to 32K images per batch without sacrificing accuracy.

Methods: Enabling Extreme Batch Sizes

The researchers utilized several key techniques to maintain stability at extreme scales, primarily the Layer-wise Adaptive Rate Scaling (LARS) algorithm. Standard SGD uses a single learning rate for the entire network, which often leads to exploding or vanishing gradients in specific layers when using massive batches. LARS calculates a local learning rate for each layer by examining the ratio between weight norms and gradient norms, effectively stabilizing the training process.

Comparison of training with and without LARS for large batch sizes (16k and 32k).

In addition to LARS, the team employed the "Linear Scaling Rule" (increasing the learning rate proportionally with the batch size) and a "Warmup" period to prevent early divergence. For AlexNet, they replaced Local Response Normalization (LRN) with Batch Normalization (BN) to improve stability. Experiments were conducted on the TACC Stampede 2 supercomputer using Intel Xeon Platinum 8160 CPUs and Intel Xeon Phi 7250 (KNL) accelerators.

Key Insights and Results

The study demonstrates that large batches improve communication efficiency by sending fewer, larger messages across the network, reducing latency overhead. While previous state-of-the-art methods saw a sharp decline in accuracy beyond 8K batches, the LARS-based approach maintains high performance even at 32K.

Top-1 Test Accuracy vs. Batch Size for ResNet-50, comparing the LARS-based approach to the Facebook baseline.

Major Milestones:

  • AlexNet: Achieved 58.6% accuracy in 11 minutes using 1024 CPUs (batch size 32K).
  • ResNet-50: Achieved 74.9% top-1 accuracy in just 14 minutes (64 epochs) using 2048 KNL nodes.
  • Scaling Superiority: When the batch size exceeded 16K, the LARS-based approach maintained significantly higher accuracy than previous benchmarks. At a 32K batch size, the authors maintained ~75% accuracy, whereas previous methods failed to generalize.

Discussion and Limitations

While the results demonstrate the feasibility of training ImageNet in minutes, the approach requires massive hardware resources (thousands of nodes). Furthermore, the authors noted a slight discrepancy in absolute peak accuracy compared to some baselines (75.3% vs 76.2%) due to using weaker data augmentation. Future work involves exploring the robustness of these 32K-batch models and their generalization to out-of-distribution datasets, as some researchers remain concerned about large batches converging to "sharp minima."

Summary updated

BibTeX
@misc{you2017imagenet,
  author = {Yang You and Zhao Zhang and Cho‐Jui Hsieh and James Demmel and Kurt Keutzer},
  title = {{ImageNet Training in Minutes}},
  year = {2017},
  eprint = {1709.05011},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1709.05011},
}
Figure