Abstract
Distributed training of deep learning models on large-scale training data is typically conducted with asynchronous stochastic optimization to maximize the rate of updates, at the cost of additional noise introduced from asynchrony. In contrast, the synchronous approach is often thought to be impractical due to idle time wasted on waiting for straggling workers. We revisit these conventional beliefs in this paper, and examine the weaknesses of both approaches. We demonstrate that a third approach, synchronous optimization with backup workers, can avoid asynchronous noise while mitigating for the worst stragglers. Our approach is empirically validated and shown to converge faster and to better test accuracies.
Introduction
This paper challenges the long-held belief that asynchronous training is the only viable way to scale deep learning across many machines. Historically, researchers faced a "pick your poison" scenario when distributing workloads across many GPUs or CPUs:
- Asynchronous SGD (Async-SGD): Fast because workers process data independently, but introduces staleness—gradients are calculated on outdated model parameters, leading to "noise" and lower final accuracy.
- Synchronous SGD (Sync-SGD): Ensures "fresh" gradients, but is throttled by the straggler effect: the entire system waits for the slowest machine.
We propose a middle ground that provides the mathematical cleanliness of synchronous training with the hardware efficiency of asynchronous training.
Methods: Synchronous SGD with Backup Workers
The proposed method, Sync-Opt, employs $N + b$ workers instead of exactly $N$. The parameter server waits for the first $N$ workers to report their gradients, updates the model immediately, and drops the results from the slowest $b$ backups. This ensures no staleness while mitigating the "tail" of the latency distribution.
Key Insights and Ideas
- The "Tail" is Expensive: Latency measurements show that while 80% of workers might finish in under 2 seconds, the final few can take exponentially longer. Waiting for the 100th worker is significantly more "expensive" in terms of idle time than waiting for the 95th.
- Staleness Degrades Performance: Controlled simulations demonstrate that as average gradient staleness increases, the test classification error rises significantly. Sync-Opt avoids this by ensuring every gradient used is calculated from the current model version.
- Staleness is Depth-Dependent: In asynchronous training, lower-layer gradients are calculated last during backpropagation, making them more stale than top-layer gradients.
- Stability over Speed: Synchronous training is more stable, often removing the need for "gradient clipping" and allowing for higher learning rates that lead to better final test accuracy.
Datasets and Results
The researchers validated Sync-Opt across MNIST, ImageNet (Inception-v3), and CIFAR-10 (PixelCNN):
- Better Accuracy: On ImageNet, Sync-Opt achieved ~0.5% higher test precision than the best asynchronous configuration.
- Faster Convergence: In a 100-GPU deployment, Sync-Opt reached target accuracy 6 to 18 hours faster than Async-Opt.
- Efficiency: For PixelCNN, Sync-Opt reached loss thresholds in under 13 hours that Async-Opt failed to reach even after 40 hours.
- Optimal Configuration: For 100 workers, $N=96$ and $b=4$ provided the fastest convergence.
Limitations and Future Work
While effective, Sync-Opt faces potential challenges with extremely large batch sizes as $N$ increases, which might impact generalization. Future work could explore sparse models (e.g., NLP with large embedding layers) or "timeout" mechanisms instead of a fixed number of backup workers.
Summary updated