Ordered Momentum for Asynchronous SGD

Chang-Wei Shi, Yi-Rui Yang, Wu-Jun Li

In the realm of distributed deep learning, balancing training speed with optimization stability is a persistent challenge. While Asynchronous Stochastic Gradient Descent (ASGD) allows worker nodes to operate independently without waiting for slower "straggler" nodes, it introduces a chaotic stream of "stale" gradients that can derail standard optimization techniques. A recent paper from researchers at Nanjing University, titled "Ordered Momentum for Asynchronous SGD (OrMo)," introduces a novel framework to resolve one of the most significant casualties of this asynchrony: momentum.

The Challenge of Asynchronous Momentum

To train massive models, computation is distributed across a cluster of workers. In Synchronous SGD (SSGD), the central server waits for every worker to finish computing their gradients before updating the model. While mathematically stable, this approach is bottlenecked by the slowest machine in the cluster.

Asynchronous SGD (ASGD) bypasses this bottleneck by allowing the server to update the model the moment any worker returns a gradient. However, this creates the "stale gradient" problem: a worker might compute a gradient based on an older version of the model (e.g., version 10), but by the time it reaches the server, the global model has already advanced (e.g., to version 20).

Momentum is a critical optimization technique that helps SGD accelerate through flat regions of the loss landscape and improves generalization. Unfortunately, naively applying momentum to ASGD often causes the optimizer to overshoot or diverge entirely because the out-of-order, stale updates corrupt the momentum buffer. Existing workarounds typically require exhaustive hyperparameter tuning or lack rigorous theoretical guarantees.

The OrMo Approach

The authors introduce Ordered Momentum (OrMo), a method that elegantly treats the asynchronous update stream as a re-ordered version of a synchronous one. The approach relies on three core mechanisms:

  1. Gradient Grouping: Instead of blindly adding incoming gradients to the momentum buffer, OrMo assigns every gradient to a "scaled gradient group" based on the iteration index of the model it was originally computed on. Even if a gradient arrives late, the server knows exactly where it belongs in the historical timeline.
Illustration of OrMo's gradient grouping
  1. The Compensation Update: In standard momentum, a gradient influences not just the current step, but all future steps via exponential decay. When a stale gradient finally arrives, OrMo applies a mathematically derived coefficient to the parameter update. This acts as a "compensation" step, applying the exact momentum impact that should have occurred had the gradient arrived on time, using a geometric series-based calculation.
  2. Delay-Adaptive Learning Rates (OrMo-DA): To further enhance stability, the authors propose a variant that automatically scales the learning rate based on the actual delay ($\tau_t$) of an incoming gradient. If a gradient is exceptionally stale, its influence is dynamically reduced.

Crucially, OrMo provides theoretical robustness. Most convergence proofs for ASGD rely on knowing the maximum possible delay ($\tau_{max}$). In real-world clusters, a single frozen process can make $\tau_{max}$ effectively infinite, rendering those proofs impractical. OrMo provides the first convergence analysis for momentum-based ASGD that does not depend on a maximum delay assumption.

Experimental Validation

The researchers evaluated OrMo on standard image classification benchmarks (CIFAR-10 and CIFAR-100) using ResNet18 and ResNet20 architectures. To simulate real-world cloud environments, they tested both homogeneous (identical worker speeds) and heterogeneous (some workers artificially slowed down by 10x) cluster settings.

Key Results: * Superior Accuracy: On CIFAR-100 with 64 workers in a heterogeneous setting, OrMo achieved a test accuracy of 65.48%, significantly outperforming naive ASGD with momentum (59.96%) and other specialized asynchronous methods. * Massive Speedups: In heterogeneous environments, OrMo was up to 8x faster than Synchronous SGD with momentum (SSGDm). While SSGDm was crippled by slow workers, OrMo kept fast workers productive without sacrificing convergence quality. * Unprecedented Stability: During 64-worker tests, the maximum delay reached approximately 30,000 iterations. While naive momentum methods diverged under this extreme staleness, OrMo remained stable and successfully converged.

Limitations and Future Directions

While OrMo marks a significant leap forward, the authors note a few areas for future exploration:

  • Data Distribution: The current theoretical proofs assume data is distributed identically across workers (i.i.d.). Adapting OrMo for non-i.i.d. settings, such as Federated Learning, remains an open challenge.
  • Implementation Overhead: Although OrMo only adds a single scalar (the iteration index) to the communication payload, adopting it requires custom implementation support within existing distributed training frameworks.
  • Advanced Optimizers: Future work could extend this "ordered" compensation logic to other popular optimizers, such as Nesterov Accelerated Gradient or Adam.

Ultimately, OrMo represents a major step toward making asynchronous distributed training as reliable as its synchronous counterparts, allowing practitioners to leverage both the speed of asynchrony and the performance benefits of momentum.

Summary updated

BibTeX
@inproceedings{shi2024ordered,
  author = {Chang-Wei Shi and Yi-Rui Yang and Wu-Jun Li},
  title = {{Ordered Momentum for Asynchronous SGD}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=U2Mx0hSRwA},
}
Figure