# Large-minibatch SGD (2017)

> Two simple rules, scale the learning rate with the batch and warm it up gradually, let 256 GPUs train ResNet-50 in an hour without losing accuracy.

Page: https://mralbu.github.io/ai-datasets/p/large-minibatch-sgd

## Key facts

- Title: Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour
- Authors: Priya Goyal, Piotr Dollár, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, Kaiming He
- Venue: arXiv June 2017
- Category: Foundations
- Paper: https://www.alphaxiv.org/abs/1706.02677

## Why it matters

It turned "use more GPUs" from a research problem into a recipe, and showed that large batches failed because of optimization early in training, not poor generalization. Learning-rate warmup and scaling the learning rate with the batch are now part of almost every large training run, including every large language model.

## The idea

Splitting training across many GPUs means much larger batches. Linear scaling rule: when the batch grows k times, multiply the learning rate by k, so one large step stands in for k small ones. That breaks down early in training, when the network changes fast, so start from the small learning rate and raise it steadily over the first five epochs (a gradual warmup).

## The result

ResNet-50 trained with 8,192 images per batch on 256 GPUs in one hour reached 23.74% top-1 error on ImageNet, against 23.60% for the usual 256-image batch, which took 29 hours on 8 GPUs. Without warmup the error was 24.84%, and beyond 8k images accuracy fell quickly. The fast-trained networks transferred to COCO detection and segmentation with the same accuracy.

## The data

- [ImageNet (ILSVRC) (2009)](https://mralbu.github.io/ai-datasets/d/imagenet.md): 1.28 million photos across 1,000 classes, the dataset behind the deep learning boom.
- [MS COCO (2014)](https://mralbu.github.io/ai-datasets/d/coco.md): 330k everyday scenes with 1.5M labeled objects in 80 categories.

## Builds on

- [ResNet (2015)](https://mralbu.github.io/ai-datasets/p/resnet.md)

## Part of

- [Optimizers](https://mralbu.github.io/ai-datasets/t/optimizers.md) (step 5 of 7)
