# 异步随机梯度下降

异步随机梯度下降（Async SGD 或 ASGD）是一种分布式训练方案，工作节点计算梯度并更新共享模型，而无需等待其他工作节点完成各自的更新。它取消了同步数据并行 SGD 的同步屏障——在同步方案中，每个工作节点都必须提交梯度后全局模型才能推进——并用这段等待时间换来了一个新问题：某些工作节点计算梯度时所依据的模型状态已经过时了。

| 关键事实 | 详情 |
|---|---|
| 核心机制 | 工作节点将梯度推送到共享模型（通常是参数服务器），并拉取当前模型状态，而不等待同伴；收到的状态不一定已被所有梯度更新过<sup>[1](https://prace-ri.eu/wp-content/uploads/Best-Practice-Guide_Deep-Learning.pdf)</sup> |
| 主要代价 | 陈旧梯度：全局模型收到较旧的、相关性较低的更新，这会降低收敛性，并需要对学习率和动量等超参数进行更多调优<sup>[2](https://deeplearningsystems.ai/ch05/)</sup> |
| 实际扩展极限 | 对于通用深度学习，通常无法扩展到超过 8 个工作节点（往往 2 或 4 就是极限），超过 8 个工作节点后收敛性比同步 SGD 更差<sup>[2](https://deeplearningsystems.ai/ch05/)</sup> |
| 奠基性无锁算法 | HOGWILD!（牛、Recht、Re、Wright，2011）在共享内存上无锁运行 SGD，当梯度更新稀疏时达到近乎最优的收敛速率<sup>[3](https://arxiv.org/abs/1106.5730)</sup> |
| 经典深度学习变体 | Downpour SGD（Dean 等，2012）针对分片的参数服务器运行 DistBelief 的多个模型副本，在副本执行和服务器分片两个层面都是异步的<sup>[4](https://papers.nips.cc/paper_files/paper/2012/file/6aca97005c68f1206823815f66102863-Paper.pdf)</sup> |
| 实践中存活的场景 | 大型推荐系统中的嵌入层，更新只触及有限子集的嵌入条目；Liu 和 Zhao 的系统在点击率任务上将异步训练扩展到 3,000 个工作节点<sup>[2](https://deeplearningsystems.ai/ch05/)</sup><sup> • </sup><sup>[5](https://ojs.aaai.org/index.php/AAAI/article/view/16108)</sup> |
| 框架支持 | TensorFlow 的 `tf.distribute.ParameterServerStrategy` 实现了参数服务器训练，工作节点独立读取和更新变量而无需同步，可扩展到数千个工作节点<sup>[6](https://www.tensorflow.org/tutorials/distribute/parameter_server_training?authuser=10)</sup> |

## 工作原理

在标准的[参数服务器](https://www.edgepedia.org/zh/parameter-server)安排中，每个工作节点持有一个模型副本，处理一个小批量数据，计算梯度，并将其推送到服务器，服务器立即应用更新。然后工作节点拉取当前参数并继续。由于没有工作节点等待其他节点，即使某些机器缓慢或故障，硬件利用率也保持高位；该方案天然地防范了拖垮大规模同步训练的负载不均衡问题——在同步训练中，单个掉队者就能拖住每一次迭代<sup>[1](https://prace-ri.eu/wp-content/uploads/Best-Practice-Guide_Deep-Learning.pdf)</sup><sup> • </sup><sup>[7](https://research.ibm.com/publications/balancing-stragglers-against-staleness-in-distributed-deep-learning)</sup>。

代价是陈旧性。基于若干次更新之前的参数计算出的梯度，不再精确指向当前模型所需的方向。deeplearningsystems.ai 的工程文本将此认定为收敛性受损的原因：全局模型收到停滞的、较旧的、相关性较低的梯度，异步 SGD 需要更多迭代才能训练完成，且无法达到单节点 SGD 的性能，这也使调试更加困难<sup>[2](https://deeplearningsystems.ai/ch05/)</sup>。对分布式 SGD 的随机[延迟微分方程](https://www.edgepedia.org/zh/delay-differential-equation)分析得出了兼容的结论：小程度的陈旧性不一定减慢收敛，而大程度则导致发散<sup>[8](https://ieeexplore.ieee.org/document/10909566/)</sup>。

## 早期系统

**HOGWILD!**（2011）确立了同步可以完全取消。当时在威斯康星大学麦迪逊分校计算机科学系的牛峰、Benjamin Recht、Christopher Re 和 Stephen J. Wright 让处理器访问共享内存并随意更新各个分量，接受它们可能覆盖彼此的工作。当优化问题稀疏时——即大多数梯度更新只修改决策变量的一小部分——覆盖很少发生且引入的误差很小，该方法达到近乎最优的收敛速率；实验上它比基于锁的方案快一个数量级<sup>[3](https://arxiv.org/abs/1106.5730)</sup>。后续工作从收敛证明中移除了有界梯度假设，并将分析扩展到递减学习率<sup>[9](https://arxiv.org/abs/1802.03801)</sup>。

**Downpour SGD** 由 Dean 及其同事在 2012 年 NIPS 的 DistBelief 论文中提出，将这一思想带入大规模深度学习。训练数据被划分为子集，每个子集上运行一个模型副本，更新流经一个分片到多台机器的集中式参数服务器，例如十个分片，每个分片存储和更新十分之一的参数。该方案在两种不同意义上是异步的：模型副本彼此独立运行，参数服务器分片也彼此独立运行。Downpour 及其配套的批处理方法都被设计为容忍副本处理速度的差异，甚至副本的整体故障<sup>[4](https://papers.nips.cc/paper_files/paper/2012/file/6aca97005c68f1206823815f66102863-Paper.pdf)</sup>。

**参数服务器**框架由李沐、David G. Andersen、Alexander J. Smola 及其同事提出，2014 年在 OSDI 上由[卡内基梅隆大学](https://www.edgepedia.org/zh/carnegie-mellon-university)和谷歌展示，对这一架构进行了推广。服务器节点以稠密或稀疏向量和矩阵的形式维护全局共享参数，框架管理节点间的异步数据通信，并支持灵活的一致性模型、弹性可扩展性和持续容错；实验覆盖了数 PB 的真实数据、数十亿的样本和参数，从稀疏逻辑回归到潜在狄利克雷分配<sup>[10](https://www.usenix.org/conference/osdi14/technical-sessions/presentation/li_mu)</sup>。

## 收敛理论

理论结果界定了异步方法能容忍多少陈旧性。Duchi、Chaturapruek 和 Re 在 2015 年证明，完全异步的随机梯度过程在凸问题上达到最优收敛速率，所需条件与标准随机梯度过程几乎相同，因为随机逼近固有的噪声主导了异步性引入的噪声<sup>[11](https://arxiv.org/abs/1508.00882)</sup>。Stich、Mohtashami 和 Jaggi 后来统一了小批量、延迟和异步 Hogwild! 式 SGD，并确定了一个关键参数 \( \tau_{\mathrm{crit}} = O(\sigma_{*}^{2}/\epsilon + M) \)，其中 \( \sigma_{*}^{2} \) 是驻点附近梯度方差的上界，\( \epsilon \) 是目标精度：只要延迟不超过该阈值，异步和延迟 SGD 就享有强线性加速；对于梯度相对稀疏的问题，以参数 \( \Delta \leq 1 \) 衡量，线性加速在延迟高达 \( O(\Delta^{-1}) \) 时仍成立<sup>[12](https://proceedings.mlr.press/v130/stich21a/stich21a.pdf)</sup>。

Konstantin Mishchenko、Francis Bach、Mathieu Even 和 Blake Woodworth 在 2022 年的分析推翻了性能主要取决于延迟的流行直觉。他们使用基于虚拟迭代和延迟自适应步长的递归，证明了异步 SGD 的保证与梯度延迟无关，仅取决于并行设备的数量，并论证在他们考虑的设置中，异步 SGD 在凸和非凸目标上都优于同步小批量 SGD<sup>[13](https://arxiv.org/abs/2206.07638)</sup>。

## 缓解陈旧性

存在若干类修正方案。陈旧感知异步 SGD 由 Wei Zhang、Suyog Gupta、Xiangru Lian 和 Ji Liu 在 2015 年提出，根据梯度陈旧程度调节学习率并提供收敛保证，在 CIFAR-10 和 ImageNet 上与同步 SGD 和传统 ASGD 进行了对比实验<sup>[14](https://arxiv.org/abs/1511.05950)</sup>。混合设计将工作节点聚成组，组内同步更新自己的参数服务器，而组服务器异步更新中央服务器；IBM 研究院对这一设计的研究表明，即使向节点注入超过 300% 的延迟，渐进分组的训练用时仍不超过无延迟情况下的 120%，精度下降最多限制在 2.5%<sup>[7](https://research.ibm.com/publications/balancing-stragglers-against-staleness-in-distributed-deep-learning)</sup>。去中心化变体完全移除了中央服务器：异步去中心化并行 SGD（AD-PSGD）以最优的 \( O(1/\sqrt{K}) \) 速率收敛，并在工作节点数量上具有线性加速；在 ImageNet 上用多达 128 块 GPU 训练 ResNet-50 时，其每轮收敛与 AllReduce-SGD 相当，而在网络共享的 HPC 环境中每轮运行速度快 4 到 8 倍<sup>[15](https://arxiv.org/abs/1710.06952)</sup>。

## 异步训练的应用场景

实证比较表明，选择取决于规模和异构性。Jin、Yuan、Iandola 和 Keutzer 在 ImageNet 上训练 ResNet 时发现，异步 SGD（包括弹性平均和 gossip 通信变体）在较少节点（最多约 32 个）时收敛更快，而同步 SGD 在更多节点（最多约 100 个）时扩展更好<sup>[16](https://arxiv.org/abs/1611.04581)</sup>。工程文献认为通用深度学习的实际交叉点更低：异步 SGD 通常无法扩展到超过 8 个节点，而由最多 8 个同步组异步交换更新的混合方案是可用的中间地带<sup>[2](https://deeplearningsystems.ai/ch05/)</sup>。

异步性在多个节点上以最小影响发挥作用的主要例外是大型推荐系统的嵌入层，有时还包括紧随其后的层，因为那里的更新只影响有限子集的嵌入条目<sup>[2](https://deeplearningsystems.ai/ch05/)</sup>。对于日样本可达数百 TB 的极端规模点击率模型，Liu 和 Zhao 提出了陈旧归一化和数据归一化，连同面向自适应优化器的 SWAP 框架，将异步训练扩展到 3,000 个工作节点并保证收敛，在真实电子商务任务中将最终 AUC 提高了 5 个百分点以上<sup>[5](https://ojs.aaai.org/index.php/AAAI/article/view/16108)</sup>。

异步方法在强化学习和联邦学习中同样保持吸引力，在这些领域它们比小批量 SGD 提供显著加速<sup>[17](https://proceedings.neurips.cc/paper_files/paper/2022/file/029df12a9363313c3e41047844ecad94-Paper-Conference.pdf)</sup>；[TensorFlow](https://www.edgepedia.org/zh/tensorflow) 将参数服务器风格暴露为 `tf.distribute.ParameterServerStrategy`，推荐用于具有大型嵌入的模型或使用可抢占机器的环境<sup>[6](https://www.tensorflow.org/tutorials/distribute/parameter_server_training?authuser=10)</sup>。

## References

1. [PRACE Best Practice Guide - Deep Learning, Section 3.2.2 Asynchronous SGD](https://prace-ri.eu/wp-content/uploads/Best-Practice-Guide_Deep-Learning.pdf)
2. [Chapter 5: Distributed Training, Deep Learning Systems](https://deeplearningsystems.ai/ch05/)
3. [Feng Niu, Benjamin Recht, Christopher Re, Stephen J. Wright (2011). HOGWILD!: A Lock-Free Approach to Parallelizing Stochastic Gradient Descent. arXiv.](https://arxiv.org/abs/1106.5730)
4. [Jeffrey Dean et al. (2012). Large Scale Distributed Deep Networks. NIPS.](https://papers.nips.cc/paper_files/paper/2012/file/6aca97005c68f1206823815f66102863-Paper.pdf)
5. [Lewis Liu, Kun Zhao (2021). Asynchronous Stochastic Gradient Descent for Extreme-Scale Recommender Systems. AAAI 35(1), 328-335.](https://ojs.aaai.org/index.php/AAAI/article/view/16108)
6. [Parameter server training with ParameterServerStrategy, TensorFlow Core](https://www.tensorflow.org/tutorials/distribute/parameter_server_training?authuser=10)
7. [Saurav Basu, Vaibhav Saxena, Rintu Panja, Ashish Verma (2018). Balancing Stragglers Against Staleness in Distributed Deep Learning. HiPC 2018, IBM Research.](https://research.ibm.com/publications/balancing-stragglers-against-staleness-in-distributed-deep-learning)
8. [Distributed Stochastic Gradient Descent With Staleness: A Stochastic Delay Differential Equation Based Framework. IEEE.](https://ieeexplore.ieee.org/document/10909566/)
9. [Lam M. Nguyen et al. (2018). SGD and Hogwild! Convergence Without the Bounded Gradients Assumption. arXiv.](https://arxiv.org/abs/1802.03801)
10. [Mu Li, David G. Andersen, Alexander J. Smola et al. (2014). Scaling Distributed Machine Learning with the Parameter Server. OSDI 14, pp. 583-598.](https://www.usenix.org/conference/osdi14/technical-sessions/presentation/li_mu)
11. [John C. Duchi, Sorathan Chaturapruek, Christopher Re (2015). Asynchronous stochastic convex optimization. arXiv.](https://arxiv.org/abs/1508.00882)
12. [Sebastian U. Stich, Amirkeivan Mohtashami, Martin Jaggi (2021). Critical Parameters for Scalable Distributed Learning. PMLR 130.](https://proceedings.mlr.press/v130/stich21a/stich21a.pdf)
13. [Konstantin Mishchenko, Francis Bach, Mathieu Even, Blake Woodworth (2022). Asynchronous SGD Beats Minibatch SGD Under Arbitrary Delays. arXiv.](https://arxiv.org/abs/2206.07638)
14. [Wei Zhang, Suyog Gupta, Xiangru Lian, Ji Liu (2015). Staleness-aware Async-SGD for Distributed Deep Learning. arXiv.](https://arxiv.org/abs/1511.05950)
15. [Xiangru Lian et al. (2017). Asynchronous Decentralized Parallel Stochastic Gradient Descent. arXiv.](https://arxiv.org/abs/1710.06952)
16. [Peter H. Jin, Qiaochu Yuan, Forrest Iandola, Kurt Keutzer (2016). How to scale distributed deep learning? arXiv.](https://arxiv.org/abs/1611.04581)
17. [Asynchronous SGD paper, NeurIPS 2022 Proceedings](https://proceedings.neurips.cc/paper_files/paper/2022/file/029df12a9363313c3e41047844ecad94-Paper-Conference.pdf)

---
*Initially written Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 人工智能与数据 › Machine learning and neural computation › Neural networks and deep learning › Deep learning software and hardware › Distributed and large-scale training

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/asynchronous-stochastic-gradient-descent

English original: https://www.edgepedia.org/asynchronous-stochastic-gradient-descent
