Elamur Research

Extremely Large Minibatch SGD: Training ResNet-50 on ImageNet in 15 Minutes

Paper · 2017 · Takuya Akiba, Shuji Suzuki and Keisuke Fukuda

Summary

Adding more processors can shorten neural network training, provided they have enough work to do and can agree on each update quickly. Giving them more work at once changes the training procedure itself. The network sees more images before each update and makes fewer updates over the same number of passes through the data. Akiba and colleagues study how far this approach can go on ImageNet, using the ResNet-50 image classifier. Their aim is to reduce the time for the full training run while keeping the accuracy close to that of earlier runs on the same task.

The authors distribute each update across 1024 Tesla P100 GPUs. Each worker processes 32 images, giving a combined minibatch of 32,768. The main optimization difficulty, in their account, comes at the beginning. They start with updates dominated by RMSprop, which adjusts each weight’s gradient using its recent squared gradients, then gradually shift to momentum stochastic gradient descent, or SGD. They also start SGD at a smaller learning rate than the linear batch-size rule would otherwise assign. Before validation, they average workers’ most recent batch normalization statistics, replacing the running estimates that had proved inaccurate in their large-batch setup.

The system uses Chainer and its distributed extension ChainerMN. Most computation uses single precision, and workers exchange half-precision values when performing collective reductions. Across five independent runs, training for 90 epochs, with validation after each epoch, took 897.9 ± 3.3 seconds. On ImageNet’s validation images, the resulting classifier achieved 74.94% ± 0.09 top-1 single-crop accuracy. This metric asks whether the highest-ranked prediction is correct when the classifier receives one crop of an image. Earlier results in the paper’s comparison range from 75.0 % to 76.3 % on the same validation metric.

The experiment establishes that this combination of training choices and distributed infrastructure can bring the benchmark to 15 minutes with accuracy near the earlier reports. The authors describe preliminary comparisons that informed their design, including the choice of a gradual optimizer transition. The final time and accuracy measure the complete recipe, so the results leave open how much each change contributes by itself.

Deep dive: Extremely Large Minibatch SGD: Training ResNet-50 on ImageNet in 15 Minutes

How RMSprop warm-up and distributed SGD trained ResNet-50 on ImageNet in 15 minutes while keeping validation accuracy close to earlier results. · about 34 minutes to read

The problem and its context

Why add workers and enlarge the batch together?

Training an image classifier repeatedly asks it to make predictions, evaluates those predictions against labels, and adjusts the network’s weights. The work recurs across the training data for many passes. For the authors, time spent waiting for a run matters because it sets the pace at which researchers and engineers can try changes. Distributed training also matters when the task grows, whether through a larger dataset or a more computationally demanding network. This paper studies the time question on a fixed benchmark. It uses ImageNet with ResNet-50, the residual network associated with He and colleagues’ work on image recognition. Deep Residual Learning for Image Recognition

A minibatch is the group of training examples whose gradients contribute to one weight update. A gradient describes how the loss changes as the weights change. With data parallelism, workers hold corresponding copies of the weights and process distinct portions of the minibatch. Combining their contributions lets them take a shared update. In synchronous data parallelism, the workers finish that exchange before proceeding with the next update. This creates an opportunity to divide the expensive work of processing examples across devices. It also creates a point in every iteration at which the devices depend on one another. GPU & parallel computing

There are different ways to assign work when more devices become available. If the combined minibatch stays fixed, each worker receives a smaller portion. The exchange of gradient information still has to accompany the update. If the local portion stays fixed, each worker continues to have the same amount of image processing to do, and the larger group covers more training examples per iteration. The second arrangement is the one used for the headline experiment. Its attraction is that the extra workers increase the number of examples handled by a shared update. Its consequence is that an epoch, a pass through the training data, contains fewer occasions to change the weights.

Seen from the optimizer, a larger combined batch alters the relationship between processing data and acting on what the data say. The next batch is evaluated at weights reached after combining a larger set of examples. A sequence of smaller updates would change those weights along the way, so some examples would be evaluated at a later state. Even when both procedures cover the same data over an epoch, their trajectories can differ. The paper therefore ties its timing objective to validation accuracy. Covering the prescribed training data quickly is only part of the benchmark. The run also needs to produce a classifier whose predictions remain competitive with earlier reports.

What prior work supplied

The closest procedural starting point is Goyal and colleagues’ large-minibatch work. Akiba and colleagues adopt its basic training setup and describe the settings they change. One idea they inherit is a rule that increases the reference learning rate in proportion to the total minibatch. The learning rate is the multiplier that sets the scale of a weight change. Increasing it addresses the fact that there are fewer updates per pass at a larger batch size. The rule supplies a scale to start from. The behavior of the first updates at the much larger scale is one of the issues the authors investigate. Accurate, Large Minibatch SGD

The paper places its result among several existing uses of this benchmark. The comparisons include the work associated with ResNet, Goyal and colleagues’ distributed GPU run, and runs by Codreanu and colleagues and You and colleagues on different hardware. Their common task is to train the same kind of image classifier for the same number of epochs and measure accuracy using one crop per validation image. That shared task makes elapsed time and accuracy intelligible across reports. The different systems, software and minibatches also mean that the comparison concerns complete configurations. It gives context for the engineering goal without isolating the effect of any one component. ImageNet Training in Minutes

There was also a precedent for changing optimizers during a training run. The paper points to a machine translation procedure by Wu and colleagues that begins with Adam and then uses SGD. In that example the switch is abrupt. Akiba and colleagues explore the broader idea that the early part of training may benefit from a different update rule. Their choice of RMSprop and a gradual transition answers a practical question about how to apply that idea to this image classification task. The translation example supplies a precedent for a sequence of optimizers on a different task. Adam

These strands of earlier work address different sources of difficulty. A learning-rate rule tells an engineer how to set the scale of training when the batch changes. An optimizer transition changes how individual gradient components enter an update. A distributed implementation determines how much of each iteration goes to exchanging results and waiting for the next computation. The experiment has to bring all of them together. The authors describe the practical challenge as finding both training settings that retain accuracy at a large minibatch and a hardware and software combination that can use the available devices effectively.

The method, step by step

From local batches to a common update

The training setup starts with ResNet-50 and follows Goyal and colleagues’ procedure wherever the authors leave a setting unspecified. Each worker takes a local minibatch and evaluates the classifier on its images in a forward pass. The backward pass uses the loss to compute the gradients of the weights. In the reported large run, the local batch is 32, and there are 1024 workers. Their local batches constitute a total minibatch of 32,768. The optimizer acts on the gradient for the combined minibatch, so the number to use in the learning-rate scaling rule is the total across workers.

The exchange that makes a common update possible is an all-reduce. In a reduction, a group of inputs is combined by an operation such as addition. An all-reduce gives the combined result back to all participating workers. This allows workers to use shared gradient information after computing their local contributions. The paper also uses an all-reduce for batch normalization statistics when preparing for validation. The gradient exchange belongs to the training iteration. The normalization exchange prepares the network to evaluate validation images using shared statistics.

Synchronous training and validation in the large-minibatch run

The steps in order.

Synchronous training and validation in the large-minibatch runStep 1: Assign local image minibatches to workers1. Assign local image minibatches to workersStep 2: Compute predictions and gradients on each worker2. Compute predictions and gradients on each workerStep 3: Combine gradients through an all-reduce3. Combine gradients through an all-reduceStep 4: Update weights with the scheduled optimizer mixture4. Update weights with the scheduled optimizer mixtureStep 5: Continue training while shifting toward momentum SGD5. Continue training while shifting toward momentum SGDStep 6: Average recent normalization statistics before validation6. Average recent normalization statistics before validationStep 7: Evaluate on ImageNet validation images after each epoch7. Evaluate on ImageNet validation images after each epoch

The combined gradient goes into an update with memory. Momentum carries part of the previous update direction into the current iteration. RMSprop carries a separate memory of how large the gradient components have recently been. The authors’ rule keeps a common momentum state while the current gradient’s contribution changes over the course of training. Early on, most of that contribution is scaled by the recent magnitude of the gradient. As training proceeds, more of it comes from the ordinary momentum SGD term. The transition schedule controls that balance, while a separate schedule controls the overall learning rate used for SGD.

It helps to distinguish a weight from the persistent quantities used to update it. The weight affects the prediction directly. The momentum state remembers a direction and accumulates evidence from successive gradients. The running second moment remembers squared gradient values, which characterize magnitude and give positive and negative gradients the same treatment in that record. The current gradient arrives from the minibatch calculation. Those pieces let the rule decide both how much of the previous direction to keep and how strongly the new evidence ought to change it.

How the two update rules share a momentum state

The authors first update the running average of squared gradients.

mₜ = µ₂ mₜ₋₁ + (1 − µ₂) gₜ²

Here t is the iteration index. The subscript t−1 refers to the preceding iteration. mₜ is the newly updated second-moment estimate, mₜ₋₁ is its previous value, and gₜ is the gradient at the current iteration. The square applies to each gradient component. The coefficient µ₂ gives the weight of the old estimate, and 1 − µ₂ gives the weight of the current squared gradient. The authors use µ₂ = 0.99.

This record changes as gradients arrive. A component with a history of large gradients tends to have a larger second-moment estimate. When that estimate is used in a denominator, it restrains the effect of the current gradient in that component. A component with a smaller estimate receives a different effective scale. The rule can therefore give different amounts of adjustment to different weights under the same nominal learning rate. The estimate concerns gradient magnitudes seen during training. Its role is to shape the update, and it is distinct from the statistics used by batch normalization.

The next line combines the old momentum with a contribution from the current gradient.

∆ₜ = µ₁ ∆ₜ₋₁ − (α_SGD + α_RMSprop / √(mₜ + ε)) gₜ

Here ∆ₜ is the new momentum state and ∆ₜ₋₁ is the previous one. The subscript t identifies the current iteration. The coefficient µ₁ sets how much prior momentum carries forward, and the paper uses µ₁ = 0.9. The term α_SGD weights the direct gradient contribution, and α_RMSprop weights the contribution scaled by the second moment mₜ. The square root turns the second-moment estimate into a scale for the gradient. The small constant ε, set to 10⁻⁸, supplies numerical stability. The divisions and multiplications involving gradient components are applied component by component. The minus sign gives the new gradient’s contribution the direction of loss reduction.

There is a single ∆ₜ to carry forward. It contains both the inherited momentum and the current contribution under the scheduled mixture. This matters when interpreting the switch. The portion of the current gradient that uses RMSprop can taper away while the momentum state evolves from its previous value. Setting the RMSprop coefficient to zero makes the update the standard momentum SGD form. Setting the SGD coefficient to zero gives the momentum version of RMSprop described by the authors. Between those cases, both terms change the contribution of the same current gradient.

The weights are then updated using the new momentum.

θₜ = θₜ₋₁ + η ∆ₜ

Here θₜ is the collection of weights after the update, θₜ₋₁ is the collection before it, ∆ₜ is the momentum computed for the current iteration, and η is the learning rate applied to that momentum. The plus sign incorporates the direction already encoded in ∆ₜ. The next iteration starts with the new weights and the newly stored momentum and second-moment estimates.

This placement of η is intentional. The authors follow Goyal and colleagues’ treatment of momentum when the learning rate changes. The momentum is kept in a form that applies the overall SGD learning rate at the weight update, outside the accumulated direction. Folding the changing SGD rate into the momentum contribution beforehand would change how earlier gradients enter a later step. The mixture coefficients still have to account for the fact that the RMSprop and SGD contributions are assigned different learning rates. The paper handles that distinction explicitly.

How the transition begins, changes pace and ends

The first iterations are where the authors report the greatest optimization difficulty. They give ordinary SGD a very small share at the beginning and increase it over time. An exponential part of the schedule lets that share begin rising gradually. A linear part follows and brings the SGD term to full strength. The shape is inspired by the exponential linear unit, an activation function whose exponential and linear pieces motivate the form of the transition. Here the function is used to schedule an optimizer coefficient. It has no role in computing a prediction from an image. Exponential Linear Units

The two boundary descriptions in the appendix specify the following schedule. The additive term in the middle branch expresses the linear segment that runs from the halfway value to the full SGD value.

α_SGD = {
  ½ exp(2(epoch − β_center) / β_period),   if epoch < β_center
  ½ + (epoch − β_center) / β_period,       if β_center ≤ epoch < β_center + ½ β_period
  1,                                      otherwise
}

In this expression, α_SGD is the SGD coefficient in the momentum rule. The variable epoch denotes progress through training in epochs. β_center marks the join between the rising exponential and the rising line, and β_period determines the time scale of the transition. exp denotes the exponential function. The inequalities specify which expression to use at a given epoch. The factor ½ is the coefficient at the join. The 2 in the exponential sets its rate of change relative to β_period. The value 1 is the full SGD coefficient maintained after the transition. The paper sets β_center = 10 and β_period = 5.

The center is a point in the transition, with both contributions still active. At that point the SGD coefficient has reached one half. It then increases at a constant rate until the end boundary, which the authors express as the center plus half the period. After that point, the scheduled coefficient stays at its full value. The design gives particular attention to the start of the handover. An exponential beginning introduces progressively more of the direct gradient term while the RMSprop contribution still dominates.

RMSprop has a learning rate of 0.0003 in the paper. The SGD rate comes from the separate epoch schedule. The authors combine these rates as follows.

η = η_SGD

Here η is the outer learning rate used to update the weights and η_SGD is the learning rate currently assigned by the SGD schedule. Their equality lets the authors apply that scheduled scale to the momentum at the weight update.

α_RMSprop = (1 − α_SGD) η_RMSprop / η_SGD

Here α_RMSprop is the coefficient for the gradient contribution normalized by the second moment. The quantity 1 − α_SGD is the complement of the current SGD coefficient. η_RMSprop is the RMSprop learning rate of 0.0003, and η_SGD is the current SGD learning rate. Their ratio compensates for the outer update using the SGD rate. The RMSprop contribution can therefore have its own learning-rate scale while the update still uses the shared momentum state.

That ratio makes the meaning of the schedule more precise. The complement of the SGD coefficient governs how much of the RMSprop contribution remains at its own nominal rate. The raw α_RMSprop inside the momentum equation also includes the ratio of rates. Treating the two raw coefficients as simple weights that add to a fixed total would miss this adjustment. Once the SGD coefficient is full, the complement vanishes and so does the RMSprop term. Subsequent updates use the common momentum and the scheduled SGD learning rate.

Gradual replacement is a choice about the new contribution at each iteration. It also has implications for the whole path because every update determines the weights at which the next gradient is calculated. An abrupt switch would change how the next gradient enters the momentum at once. The smooth schedule lets that change accumulate over a series of iterations. The paper’s preliminary comparisons motivate this choice, and its equations specify how to carry it out. The record of squared gradients and the record of momentum each retain their own fixed decay coefficient throughout the reported experiments.

Setting the learning rate for the larger batch

The paper separates the optimizer mixture from the schedule for η_SGD. The mixture controls how a gradient enters momentum. The learning-rate schedule controls the scale of the momentum when the weights change. Both depend on the progress of training, and each addresses a different aspect of the difficult beginning. The authors start with a reference rate taken from Goyal and colleagues’ rule for changing batch size.

b_total = n b_local

Here b_total is the size of the combined minibatch across all workers, n is the number of workers, and b_local is the minibatch size on each worker. The formula applies because workers use the same local batch size. In the reported run, n = 1024, b_local = 32, and the total minibatch is 32,768.

η_base = 0.1 · b_total / 256 = 0.1 · n b_local / 256

Here η_base is the reference learning rate from the linear scaling rule. The value 0.1 is the reference rate associated with a minibatch of 256, and the division expresses the new batch size relative to that reference. b_total is the combined minibatch, n is the worker count, and b_local is the local minibatch size. The rightmost expression uses the equality between the combined size and the product of the worker count and local size. The authors give 12.8 as the resulting reference rate for their run.

The paper expresses the schedule from Goyal and colleagues as successive stretches at η_base, 0.1 · η_base, 0.01 · η_base, and 0.001 · η_base. The stretches last 30 epochs, 30 epochs, 20 epochs, and 10 epochs in that order. That comparison provides the reference for the changes. Applying the rule gives a starting scale tied to the size of the full minibatch, while changing the multipliers and their durations determines how much of that scale the authors use at different stages.

The authors’ slow-start schedule assigns 0.5 · η_base to SGD for the first 40 epochs. It uses 0.075 · η_base for the next 30 epochs, 0.01 · η_base for the following 15 epochs, and 0.001 · η_base for the last 5 epochs. This makes the initial stage both smaller in learning rate and longer in duration than the reference schedule described in the paper. Later parts also have their own durations. The effect of the modification is therefore a changed training schedule across the run, with a particular emphasis on the early updates.

Within the first learning-rate stage, the share of the direct SGD contribution is already changing according to the transition function. The rate assigned to that contribution and its relative share answer separate questions. The learning-rate stage says how the momentum is scaled before adding it to the weights. The mixture says whether the current gradient first receives the adaptive adjustment from RMSprop. This distinction also clarifies what the paper means by warm-up. It uses a temporary adaptive contribution and a reduced initial rate for SGD, each with a defined role in the update.

Choosing statistics for validation

Batch normalization uses statistics of activations, including a mean and a variance, to determine how to normalize them. During training, a minibatch supplies the observations behind those statistics. A network can keep a moving estimate across batches for later use at validation time. Such an estimate depends on the batches that contributed to it and the state of the network when they were processed. In the authors’ very large-minibatch setup, the moving estimates of mean and variance became inaccurate representations of the statistics they wanted for evaluation.

The authors keep the statistics from the latest minibatch and use an all-reduce to obtain their average across workers before validation. Each worker has local statistics from its own data. The collective operation makes the same averaged values available across the group. The intervention concerns which statistics are carried forward into evaluation. In particular, the procedure the paper specifies averages the workers’ statistics. That wording matters because combining already computed local variances is a different operation from calculating a variance from all underlying activations together. The paper describes the former at the level of the statistics workers exchange.

There is an important distinction between these two uses of recent information. The RMSprop second moment is a moving average that helps choose a weight update. The means and variances used for batch normalization describe activations and help define how predictions are evaluated. The authors retain accumulated history for the optimizer and use the latest distributed statistics for normalization before validation. These choices can affect the same reported accuracy through different routes. One changes the sequence of learned weights. The other changes the normalization values applied when the trained classifier makes its validation predictions.

The data procedure is given mainly through its connection to the inherited setup. ImageNet supplies the training and validation images, and the authors identify the worker minibatch, the total minibatch and the validation cadence. The headline procedure covers 90 training epochs and evaluates after each epoch. Each such evaluation follows the collective preparation of the normalization statistics. The appendix focuses on the optimizer and learning rates, while the description of the distributed setup supplies the details needed to understand where the local calculations and shared quantities fit.

Running the procedure across the cluster

Chainer supplies the deep learning framework. The paper identifies its define-by-run approach and uses ChainerMN to add synchronous multi-node data parallelism. The software comes from development branches based on Chainer 3.0.0rc1 and ChainerMN 1.0.0. The underlying communications use NCCL 2.0.5 and Open MPI 1.10.2. These details identify the particular stack on which the authors’ timing rests. Chainer handles the computation of the network and its gradients, while the distributed layer and communication libraries support the exchanges that tie local batches into a common update. ChainerMN

Most computation is performed in single precision. Communication for all-reduce uses half-precision floating-point values to reduce the overhead of sending information. The placement of the precision change is important when reading the method. It applies to values being communicated, while the paper characterizes computation more generally as single precision. The authors use the lower communication precision to address the cost of synchronization. Its acceptability also depends on accuracy, since the outcome of the exchange supplies information that the subsequent training computation uses.

The run uses the authors’ MN-1 cluster. It has 128 nodes. Each node contains eight Tesla P100 GPUs, two Intel Xeon E5-2667 processors and 256 GB of memory. The processors are specified as eight-core units at 3.20 GHz. Mellanox Infiniband FDR interconnects the nodes. Those details give physical meaning to the difference between distributing work across devices in one node and distributing it over the whole cluster. The same logical gradient exchange must fit the communication paths available at both scales.

At each iteration, the implementation has work to do locally and work to do collectively. Image processing and the forward and backward passes produce the per-worker gradients. Collective communication supplies the shared result. The optimizer computes and applies the update. The run also pauses for validation after each epoch. Training time includes the repeated iterations and that evaluation cadence, while the shorter timing analysis in the paper looks separately at communication and the whole training iteration. Keeping these units of work distinct is necessary to understand why the paper reports both elapsed time and scaling efficiency.

Experiments and results

What the benchmark measures

The experimental task is ImageNet image classification with ResNet-50. The authors train for 90 epochs and measure top-1 single-crop accuracy on the validation images. Top-1 uses the class that the network ranks highest. It counts a prediction as correct when that class matches the validation label. Single-crop evaluation supplies one crop from an image for the prediction. The metric concerns the ability of the learned classifier to assign labels on the validation split. Training time concerns the work needed to reach the end of the prescribed run, including the validation after each epoch.

The reported full run uses 1024 Tesla P100 GPUs and gives each worker a batch of 32 images. The total minibatch is 32,768, which the paper also describes as 32k. Specifying both sizes is useful because they answer different questions. One indicates the work assigned to a device before the workers communicate. The other indicates how many examples inform a shared optimization step. The run keeps the local contribution at the stated size while using the combined batch to distribute a large share of an epoch’s image processing across the cluster.

The authors repeat the experiment in five independent runs and report means and standard deviations for time and accuracy. This repetition gives some evidence about how consistently the complete recipe behaved on the cluster. It also clarifies the meaning of the figures attached to the headline numbers. The elapsed time and accuracy describe the typical observed run through their means. The reported spreads describe variation among repetitions of that configuration. The earlier benchmark figures come from other reports, so the five-run design belongs to the authors’ own measurement.

The complete training run

The mean time for the full schedule was 897.9 ± 3.3 seconds, including validation after each epoch. The paper presents the same result as 15 min in its comparison of complete runs. The number covers the benchmark at the prescribed epoch count. It is a different quantity from how long the system takes to perform one iteration, and it includes validation work that the iteration measurement is defined separately from. The direct comparison with earlier reports is therefore easiest to read using the table’s 90-epoch framing.

The completed run reached 74.94% ± 0.09 top-1 single-crop accuracy on ImageNet validation images. The paper’s cross-system comparison presents this accuracy as 74.9 %. The authors characterize it as comparable to earlier reports. That claim concerns the observed level of accuracy under the complete procedure. The earlier entries include higher values, so the result quantifies the validation performance that accompanied the time improvement. Timing on its own would leave that outcome unknown.

Reported ResNet-50 single-crop validation accuracy on ImageNet

The large-minibatch run finishes near the earlier accuracy results, with Goyal and colleagues reporting the highest value.

Reported ResNet-50 single-crop validation accuracy on ImageNetHe et al.: 75.3He et al.75.3Goyal et al.: 76.3Goyal et al.76.3Codreanu et al.: 75.0Codreanu et al.75.0You et al.: 75.3You et al.75.3Akiba et al. (this paper): 74.9Akiba et al. (this paper)74.9
The numbers
System or settingaccuracy %
He et al.75.3
Goyal et al.76.3
Codreanu et al.75.0
You et al.75.3
Akiba et al. (this paper)74.9

The comparison includes different combinations of batch size, device and framework. The entry for He and colleagues uses Caffe, eight Tesla P100 GPUs and a minibatch of 256. Its reported time is 29 hr and its validation accuracy is 75.3 %. The Goyal entry uses Caffe2, 256 Tesla P100 GPUs and a minibatch of 8,192. Its reported time is 1 hr and its validation accuracy is 76.3 %. These are the closest entries in the comparison in terms of the GPU type, while their worker counts, software and global batches differ.

The entries for Codreanu and colleagues and You and colleagues use Intel Caffe. Codreanu and colleagues use 720 KNL 7250 processors and a minibatch of 11,520. The reported values are 62 min and 75.0 % validation accuracy. You and colleagues use 1600 Xeon 8160 processors and a minibatch of 16,000, with a reported time of 31 min and a validation accuracy of 75.3 %. Those entries give context for the time others achieved while using different computing platforms to train on the same benchmark.

ResNet-50 training time on ImageNet for runs tabulated in minutes

The Chainer run has the shortest elapsed time among these reported configurations.

ResNet-50 training time on ImageNet for runs tabulated in minutesCodreanu et al.: 62Codreanu et al.62You et al.: 31You et al.31Akiba et al. (this paper): 15Akiba et al. (this paper)15
The numbers
System or settingmin
Codreanu et al.62
You et al.31
Akiba et al. (this paper)15

The timing chart uses the entries that the paper expresses in minutes. The two GPU baselines use hours in the paper’s comparison and are given in those units above. Read together, the accuracy and time measurements show the tradeoff the experiment set out to examine. The reported full configuration has the shortest time in the paper’s comparison, and its validation score is close to the range of earlier entries. Each point in that comparison combines a training procedure with the device count, framework and hardware of its run. The measurements support a comparison of achievable outcomes under those respective conditions.

What the iteration timing adds

The authors also look inside an iteration. They measure average communication time and average time for a complete training iteration over 100 iterations. They define communication time as time spent on the all-reduce operations. The entire iteration includes the forward and backward calculations, communication and the optimization step. Recording both quantities gives a systems view of the run. The complete iteration measures the unit that repeats during training, while the communication measurement tracks a cost that arises specifically from cooperation among workers.

The timing figure spans GPU counts from 1 through 1024. The paper reports that scaling efficiency at 1024 GPUs was 70% using the single-GPU baseline and 80% using the single-node baseline. The single node has eight GPUs. These are relative measures with different starting points. The comparison to a single GPU starts before the work has been distributed among devices. The single-node reference starts from work that is already being distributed inside one node. The reference therefore belongs with the percentage whenever the result is quoted.

Scaling efficiency expresses how much of ideal proportional scaling the system achieves relative to the reference configuration. The values show that useful scaling persists to the full cluster and that distributed work still carries a cost. Because the baseline changes, the two efficiency figures describe the same deployment from different points of comparison. Neither percentage is a validation score or the fraction of the full run spent communicating. The paper uses the communication and iteration measurements to characterize the system and the separately measured full-run time to establish what the arrangement delivers on the benchmark.

The epoch-level and iteration-level results answer distinct questions about a large minibatch. The epoch-level measurements show what happens when the training procedure groups examples into larger updates and runs the full schedule. The iteration-level analysis shows whether the system handles the work of those updates efficiently as devices are added. A configuration can have favorable iteration scaling and still require a separate check that its optimizer reaches adequate validation accuracy. Conversely, an optimization recipe can attain adequate accuracy while the implementation spends enough time on collective operations to limit its practical timing gains. The paper measures both aspects on the same deployment.

Reading the result as a claim about feasibility

The strongest experimental claim is that the authors found a working combination at the stated batch size and epoch count. The result includes both learning behavior and the time the cluster needs to carry it out. That is a meaningful threshold for feasibility. The optimizer, validation procedure and system support a run that ends with accuracy near the comparison entries. The different configurations represented in the benchmark table explain why the result is more naturally read at this level than as a direct measurement of the value of a single software or training change.

The repeated runs add a local check on that claim. They establish that the reported time and accuracy describe a set of runs under the same recipe, with an observed spread. Across-paper comparisons have a different function. They give the reader reference points for what other teams achieved on the task with their own training and hardware. The evidence for repeatability comes from the former, and the historical context for the benchmark comes from the latter. Both are needed to interpret a headline that puts an elapsed time beside a validation result.

What the ablations show

The initial optimizer and the switch

The paper provides qualitative preliminary comparisons and a quantitative scaling analysis. It leaves the effect of removing each training change from the final recipe unmeasured. The preliminary comparisons are most informative about decisions the authors faced. They tried different starting optimizers, considered whether to switch abruptly, and tested several shapes for a gradual transition. These comparisons tell the reader which variants the authors preferred on their task. The numerical accuracy with which to judge the complete recipe comes from the main experiment.

The comparison between Adam and RMSprop concerns the adaptive part at the beginning. The authors took inspiration from the machine translation procedure that starts with Adam and later uses SGD. In their preliminary image classification experiments, RMSprop performed better for their task. They report that preference without a separate validation score or training curve for each optimizer. It supports their choice of which adaptive contribution to put in the recipe. The size of the advantage and its sensitivity to the other settings remain open.

The comparison between a sudden switch and a smooth transition addresses a different concern. The authors report that an abrupt transition disrupted training and worsened the final result. That observation gives a reason to design the update as a mixture with scheduled weights. The paper also says that a linear transition could cause a similar problem at its beginning. In this setting, deciding to use an interval for the transition was only part of the choice. How strongly the SGD term entered the mixture at the start of that interval also mattered to the authors.

The authors considered both a sigmoid and the shape inspired by an exponential linear unit. They describe the outcomes as similar, with a slight advantage for the latter, which they chose for the reported runs. The result identifies a workable shape and makes the selection traceable. Since the paper supplies no separate quantitative outcomes for these schedules, the comparison is best read as a qualitative ordering for this experiment. It offers more direct evidence for taking care with the handover than for ranking smooth transition functions in general.

The sequence of comparisons also helps locate the difficulty the authors were trying to fix. Choice of initial optimizer concerns what to do when training starts. Choice of transition concerns how to change the update rule after that start. Choice of transition shape concerns how the change begins and how it continues. The final recipe answers all of those questions together, but the authors’ account gives each comparison its own scope. A claim about the relative merits of Adam and RMSprop would need more details than this account provides, as would a claim about the best shape for every large-batch problem.

The SGD schedule and normalization statistics

The slow-start schedule is described as a response to initial optimization difficulty. The paper gives enough detail to compare it directly with the reference rate schedule, including the lower initial multiplier and the longer initial stage. It leaves a question about which change delivered the benefit. A comparison that modified the initial multiplier alone would address a different question from one that changed the stage duration alone. The reported schedule adjusts these together and also changes later portions. Its successful use establishes the setting as part of the final procedure.

For batch normalization, the authors report a failure they saw with the conventional running estimates at large batch sizes. Those estimates became inaccurate for the actual activation statistics. The revised procedure uses the latest minibatch and shares an average of the workers’ statistics before validation. The account gives an observed problem and an explicit replacement. Quantifying the role of the replacement would require accuracy or statistic measurements using both versions under otherwise comparable conditions. The reported experiment incorporates the replacement in the full recipe.

The distinction between these modifications matters when trying to explain the final accuracy. The slow-start schedule changes the optimization path from the earliest iterations. The normalization procedure determines the statistics with which the network is evaluated. A better validation measurement under one choice could depend in part on what happens at evaluation even if the training trajectory stays fixed. A learning-rate adjustment can affect the state reached by training itself. The paper’s overall result shows that the chosen settings work together, while the descriptions indicate different reasons for their inclusion.

The separate roles of the two optimizer decisions matter as well. A smaller SGD rate can reduce the scale of the direct gradient contribution as the schedule begins. The adaptive term can rescale gradient components according to their recent squared values. The final recipe uses both mechanisms. The qualitative comparisons about changing optimizers give evidence relevant to the second mechanism and its transition. A direct estimate of how much the slow rate alone helps would require a run designed to separate the rate from the adaptive contribution.

Communication precision and scaling

In preliminary experiments, the authors observed a relatively small effect on final accuracy from communicating in half precision. That observation supports the use of reduced communication precision in the reported run. The paper gives the precision placement and explains its purpose, which is to reduce all-reduce overhead. It gives no paired set of elapsed times and accuracy values for half-precision and single-precision communication under the final configuration. The outcome establishes that the lower precision used for communication is compatible with the reported accuracy.

The GPU-count study supplies the clearest measured comparison within the paper’s system. Across device counts, the authors look at communication and the complete iteration side by side. The efficiencies at 1024 GPUs express how the timing compares with the single-GPU and single-node reference points. This analysis pertains to how the distributed implementation scales. It gives the reader a way to distinguish the communication part of the repeated workload from the full iteration that contains it.

The scaling measurements and the comparisons of optimizers therefore have different evidentiary weight and answer different questions. The former quantify performance for the software and hardware configuration. The latter record why the authors selected particular training settings in their preliminary work. Neither the time chart across teams nor a comparison of scaling baselines assigns a causal contribution to the adaptive warm-up, the normalization change or the precision change. The paper’s descriptions make those components reproducible at the level of their stated rules, while a controlled ranking of their effects would be another experiment.

Limitations

Limits identified by the authors

The authors frame the result around a particular benchmark, configuration and target. Their claim is that highly parallel training with the stated minibatch can reach accuracy comparable to the earlier ResNet-50 reports on ImageNet. They describe initial optimization as the major trouble spot and explain that the transition experiments were preliminary. They also describe the impact of half-precision communication on accuracy in qualitative terms. These qualifications define what they measured closely and what they assessed while developing the recipe.

Their benchmark uses top-1 single-crop validation accuracy after the specified training schedule. The paper gives an observed mean and standard deviation for its own accuracy and time. The same reporting format is unavailable for the cited baseline entries in its comparison. The authors’ use of comparable accuracy is a practical judgment about the magnitudes shown. The evidence describes what the final configuration achieved and how results varied across its five independent runs. A comparative claim about uncertainty across teams would require additional measurements from common experimental conditions.

The scaling discussion also explicitly names its reference configurations. The single-GPU and single-node baselines give different scaling efficiencies for the same full deployment. The authors include both comparisons, which sets a boundary on how to quote the numbers. A claim that the percentage expresses a universal efficiency at this worker count would miss the conditions attached to it. The measured efficiency belongs to the chosen workload, software and cluster, relative to the stated starting point.

Limits that follow from the design

The benchmark gives strong evidence for its concrete use case and leaves generalization to other settings open. The experiment uses one architecture on one dataset at a prescribed epoch count, with a particular local batch size and cluster. Another image classification architecture could respond differently to a transition between adaptive and direct gradient contributions. Another task could have a different early optimization problem or a different sensitivity to normalization statistics. The paper provides enough information to understand why the authors tried their changes here. Applying them elsewhere would be a new empirical question.

In the same way, the successful batch size is a demonstrated operating point. The main experiment establishes a result at 32,768, and the scaling figure follows iteration performance over GPU counts. A study of accuracy over a sequence of global batch sizes with the same experimental controls would be needed to locate a limit on how far the batch could increase. The choice to hold the local batch at 32 in the main run demonstrates one way to use the cluster at scale. It leaves room for different combinations of local work, worker count and total batch.

The comparison of elapsed times combines many changes. Device counts, device types, frameworks, global batches and aspects of the training recipe differ among the entries. As a consequence, the table answers the practical question of what the respective configurations achieved. It leaves open how much time a particular component saved under fixed conditions. The same distinction applies to an extrapolation to a different cluster. Network links, communication libraries and precision choices help determine the all-reduce cost. A timing figure measured on MN-1 gives a concrete reference and leaves the performance of another system to measurement.

There is also a distinction between a fixed endpoint and a fixed accuracy threshold. The paper times training over 90 epochs and reports the resulting validation score. A comparison based on reaching the same predetermined validation accuracy would need to follow accuracy over elapsed time for the competing configurations and establish how each reaches that threshold. The fixed-epoch benchmark is intelligible and comparable to the earlier reports as presented. It answers how long the authors’ particular schedule takes and what validation quality it yields at its end.

The validation metric has a similarly specific interpretation. Top-1 single-crop accuracy summarizes classification performance on the ImageNet validation images under that evaluation procedure. It leaves open other questions about predictions, such as how errors fall across classes or whether the same outcome would appear under a different evaluation procedure. The paper grounds its claim in a common benchmark measurement. Extending the claim to other aspects of prediction quality would require the corresponding data.

The final recipe also combines interventions that could interact. A particular optimizer transition may behave differently under another SGD rate, because the mixture explicitly includes the scheduled rate. A different number of workers or a different local batch size could change the statistics available for the validation procedure. The paper gives qualitative observations that guided these choices and demonstrates their joint success. That design leaves the strength of the interactions and the necessity of individual changes open.

Finally, the paper specifies the training settings it changes relative to Goyal and colleagues’ method and identifies versions or development branches for the software. This gives a reader a starting point for reconstructing the experiment. Details inherited from the earlier procedure still matter, especially when a change in preprocessing or training configuration could influence accuracy. Settings such as the optimizer coefficients are explicit in the appendix. Understanding the full experimental recipe requires reading those settings in conjunction with the inherited procedure and the particular distributed implementation.

What came after

ImageNet as a shared test of training time

ImageNet Training in Minutes occupies a special place in the comparison. Akiba and colleagues cite it as a benchmark predecessor. They report its ResNet-50 configuration as a 16,000-image minibatch on 1600 Xeon 8160 processors, with a 31 min training time and 75.3 % single-crop validation accuracy on ImageNet. This relationship is concrete and runs from the earlier benchmark result into Akiba and colleagues’ comparison. It shows how a minutes-scale training objective was already being pursued on different hardware. The comparison connects the two through the task and measurements. It gives no basis for attributing Akiba and colleagues’ warm-up or normalization procedure to the You run.

The title of Highly Scalable Deep Learning Training System with Mixed-Precision identifies mixed precision as part of a system for training ImageNet in four minutes. It continues the line of work in which numerical precision and distributed execution matter to a result stated in elapsed time. Akiba and colleagues give a specific instance of using lower precision in the collective communication while doing most computation in single precision. The later work’s title gives its broader systems emphasis. It leaves the exact placement of its precision changes, and the details of any shared optimizer components, unspecified here.

Putting these ImageNet works in the same discussion helps distinguish a shared benchmark from a shared implementation. Time on ImageNet is a way to state the outcome of the complete system. Achieving such a time depends on the work assigned to devices, the way they communicate and the training procedure that makes the batch usable. Akiba and colleagues spell out their choices for all of those parts. The later title states its own emphasis on mixed precision and system scaling. The relationship that can be established is a continuation of the effort to reduce the time required to train on ImageNet.

Optimizer transitions and large batches on other tasks

Improving Generalization Performance by Switching from Adam to SGD studies a switch between optimizers with generalization as the objective. That gives the two works a common structural choice. An adaptive optimizer is useful for one part of training, after which SGD takes over. In Akiba and colleagues’ implementation the adaptive contribution comes from RMSprop, and the motivation is the difficulty of starting at a very large batch. The Keskar work identifies Adam as its starting optimizer and generalization as its focus. The title supports that connection between choices and objectives without establishing that the papers use the same schedule.

This distinction matters because optimizer changes can be investigated through several outcomes. Akiba and colleagues report how their transition fits into a timed benchmark that also measures validation accuracy. Keskar’s title places the quality of performance on unseen data at the center of the optimizer switch. The two studies thus ask related questions about different phases of training. The early and late update rules can be treated as separate design choices, and the evidence for choosing them depends on the setting and the outcome being measured.

Large Batch Optimization for Deep Learning takes the large-batch training question to BERT. Its title reports training BERT in 76 minutes and makes batch optimization the subject of the work. This extends the pairing of a large batch with an elapsed-time objective beyond the ImageNet classifier studied by Akiba and colleagues, into the setting of language pretraining. The shared problem is how to use large batches to distribute training while retaining a workable optimization procedure. The later title establishes the task and time claim. It gives no reason to assume that the ImageNet transition function, worker statistics or communication format carry over unchanged.

The connections across these works are most precise at the level of the problem each pursues. The ImageNet system papers compare complete routes to a short training run. The optimizer-switching work examines the use of adaptive optimization followed by SGD for a different aim. The BERT work carries large-batch optimization and the measurement of elapsed time to a different training task. Akiba and colleagues’ contribution to those lines is the documented ImageNet case in which a gradual handover, a revised learning-rate schedule, recent normalization statistics and a synchronized system together make the very large minibatch usable.

Cite

Cite as Takuya Akiba, Shuji Suzuki and Keisuke Fukuda. 2017. Extremely Large Minibatch SGD: Training ResNet-50 on ImageNet in 15 Minutes. arXiv:1711.04325.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.1711.04325 · arXiv 1711.04325

@misc{akiba2017extremely,
  title = {{Extremely Large Minibatch SGD: Training ResNet-50 on ImageNet in 15 Minutes}},
  author = {Takuya Akiba, Shuji Suzuki and Keisuke Fukuda},
  year = {2017},
  doi = {10.48550/arxiv.1711.04325},
  eprint = {1711.04325},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.1711.04325}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/akiba-2017-extremely-large-minibatch-sgd-training/