Asynchronous Stochastic Gradient Descent with Delay Compensation for Distributed Deep Learning

Shuxin Zheng, Qi Meng, Taifeng Wang, Wei Chen, Nenghai Yu, Zhiming Ma, Tie-Yan Liu

Abstract

Distributed deep learning often relies on Asynchronous Stochastic Gradient Descent (ASGD) to maximize hardware utilization. However, ASGD suffers from the "stale gradient" problem, where gradients computed on outdated model versions lead to training instability and reduced accuracy. We present Delay Compensated ASGD (DC-ASGD), a novel optimization algorithm that addresses this gap. By utilizing a Taylor expansion and a computationally efficient Hessian approximation, DC-ASGD compensates for the delay between a worker's local model and the global model. Our experiments on CIFAR-10 and ImageNet demonstrate that DC-ASGD achieves the speed of asynchronous training with the accuracy of sequential SGD, sometimes even outperforming it.

Introduction

In distributed deep learning, Asynchronous Stochastic Gradient Descent (ASGD) is a popular choice because it allows workers to operate without synchronization barriers. However, it is plagued by delayed gradients: by the time a worker calculates a gradient based on model version $w_t$ and returns it to the parameter server, the global model has often been updated to $w_{t+\tau}$ by other workers. Applying this "stale" gradient to a newer model version is mathematically inconsistent, often leading to lower final accuracy compared to sequential training on a single machine.

Methodology

To bridge the performance gap between asynchronous and sequential training, we propose Delay Compensated ASGD (DC-ASGD). The core mechanism involves using a Taylor expansion to estimate the gradient $g(w_{t+\tau})$ as if it were calculated on the current global model.

Hessian Approximation and the Update Rule

Computing the full Hessian matrix required for a Taylor expansion is computationally prohibitive for deep networks. We address this by proving that the outer product of the gradient ($g \cdot g^T$) serves as an asymptotically unbiased estimator of the Hessian for cross-entropy loss. To minimize overhead, we utilize only the diagonal of this outer product, reducing complexity to $O(n)$.

The resulting update rule incorporates a compensation term: $$w_{t+\tau+1} = w_{t+\tau} - \eta(g(w_t) + \lambda g(w_t) \odot g(w_t) \odot (w_{t+\tau} - w_t))$$ where $\lambda$ is a variance control parameter. This first-order approximation is significantly more robust to delays than the zero-order approximation used in standard ASGD.

Experiments and Results

We evaluated DC-ASGD using ResNet architectures on two benchmarks: CIFAR-10 (20-layer ResNet) and ImageNet ILSVRC 2013 (50-layer ResNet).

Key Findings

  • Accuracy Gains: On CIFAR-10 with 4 workers, DC-ASGD achieved an error rate of 8.19%, outperforming standard ASGD (9.27%) and sequential SGD (8.65%).
  • Scalability: As the number of workers increased from 4 to 8, the performance gap between standard ASGD and DC-ASGD widened, indicating superior delay tolerance.
  • Large-Scale Performance: On ImageNet with 16 workers, DC-ASGD reached a top-1 error of 25.18%, surpassing both ASGD (25.64%) and Synchronous SGD (25.30%).
  • Efficiency: The computational overhead of the compensation term is negligible, allowing DC-ASGD to maintain the high hardware efficiency of standard ASGD.

Discussion and Conclusion

DC-ASGD effectively mitigates the staleness problem in distributed training. Interestingly, the algorithm occasionally outperforms sequential SGD, suggesting that the noise inherent in parallel training may act as a beneficial regularizer.

While DC-ASGD is highly efficient, it does require the parameter server to store "backup" models to calculate the delay $(w_{t+\tau} - w_t)$, which may impact memory for extremely large models. Future work will explore higher-order Taylor expansions and the performance of DC-ASGD in massive clusters with hundreds of workers.

Summary updated

BibTeX
@inproceedings{zheng2017asynchronous,
  author = {Shuxin Zheng and Qi Meng and Taifeng Wang and Wei Chen and Nenghai Yu and Zhiming Ma and Tie-Yan Liu},
  title = {{Asynchronous Stochastic Gradient Descent with Delay Compensation for Distributed Deep Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2017},
  url = {https://openreview.net/forum?id=BybaBsb_-S},
}
Figure