LAYUP: Asynchronous decentralized gradient descent with LAYer-wise UPdates

Cabrel Teguemne Fokam, Marcel Nieveler, Lukas König, Khaleelulla Khan Nazeer, David Kappel, Anand SubramoneyarXiv 2024

TL;DR

Distributed training of massive deep learning models often gets bogged down by communication bottlenecks and slow workers (stragglers). This paper introduces LayUp, a decentralized, asynchronous training method that updates model parameters layer-by-layer during backpropagation using randomized gossip communication. By eliminating synchronization barriers and memory-heavy buffers, LayUp speeds up training by up to 32% over standard Distributed Data Parallel (DDP) while maintaining or even improving final model accuracy.

What Problem Does This Paper Address?

Distributed training typically relies on Distributed Data Parallel (DDP), a synchronous approach where every device must finish its backward pass before exchanging gradients via an all-reduce operation. This creates a massive synchronization barrier: fast devices sit idle waiting for slow ones ("stragglers"), leading to poor hardware utilization.

Existing asynchronous or decentralized alternatives (like Local SGD or gossip-based methods) try to fix this but often suffer from parameter drift (where models on different devices diverge too much), require massive memory buffers to store delayed updates, or degrade final model accuracy. The authors set out to design a distributed training framework that breaks the synchronization barrier without sacrificing accuracy or blowing up memory usage.

Methods

LayUp introduces a clever blend of layer-wise granularity and decentralized communication:

  • Layer-wise Updates: Instead of waiting for the entire backward pass to finish, LayUp transmits and applies updates for each layer as soon as its gradients are computed during backpropagation.
  • Asynchronous Randomized Gossip: Each device runs a dedicated concurrent "updater thread" that randomly selects a peer device to exchange updates using a push-sum protocol.
  • Lock-Free and Queueless: Updates are applied directly to the target device's parameters without locking mechanisms or queues. While threads can occasionally overwrite each other, it completely eliminates buffering overhead.
  • Theoretical Bounding: The authors use the Elastic Consistency framework to mathematically prove that the gradient bias introduced by these asynchronous layer-wise updates is strictly bounded and does not prevent the model from converging to an optimal solution.
Timeline comparison of standard DDP vs. LayUp's asynchronous layer-wise updates.

Datasets

The authors evaluated LayUp across a diverse set of standard vision and language benchmarks:

  • Vision: ImageNet-1k and CIFAR-100 (using ResNet-18 and ResNet-50 architectures).
  • Language/Sequence Modeling: Minipile (for pre-training a 400M parameter GPT-2 Medium) and Wikitext-103 (for finetuning a 1.6B parameter GPT-2 XL).
  • Sentiment Analysis: The IMDb dataset (using a 2-layer LSTM).

Key Insights and Ideas

  • The Layer-Wise Advantage: The core "aha" moment is that updating layer-by-layer naturally mitigates parameter drift. Because output layers finish computing gradients long before input layers, sending them immediately allows devices to interleave parameter mixing with ongoing computation. The authors show that while parameter drift scales linearly with network depth under standard block updates, layer-wise updates break this bottleneck.
  • Embracing the Bias: Asynchronous, lock-free updates mean a forward pass might run on a mixture of weights from different iterations (introducing gradient bias). However, both theory and experiments show this noise is well-behaved and acts almost like a regularizer, sometimes yielding better final accuracy than perfectly synchronous training.
  • Straggler Immunity: In decentralized gossip, a slow node doesn't halt the cluster. Faster nodes simply continue exchanging updates among themselves, and the straggler catches up naturally when it communicates, preventing the entire system from slowing down.

Key Results

  • Speed and Convergence: LayUp converged up to 32% faster in wall-clock time compared to standard DDP during GPT-2 XL finetuning, and up to 27% faster than communication-efficient alternatives like SlowMo.
  • Accuracy and Perplexity: LayUp achieved the highest accuracy on CIFAR-100 (78.46%) and ImageNet-1k (76.97%) compared to DDP, CO2, SlowMo, and GoSGD. It also achieved the lowest perplexity on language tasks.
Learning curves across vision and language tasks showing wall-clock time advantages.
  • Hardware Efficiency: LayUp achieved significantly higher Model FLOPs Utilization (MFU)—e.g., 72.36% MFU for GPT-2 Medium pre-training compared to 51.95% for SlowMo.
  • Straggler Robustness: When artificial communication delays were injected, standard DDP and other baselines saw their training times skyrocket, whereas LayUp's training time remained virtually flat.
Impact of stragglers on wall-clock time and accuracy.

Limitations and Future Work

  • Lock-Free Overwriting: Because the algorithm is lock-free, updates can occasionally overwrite each other if two devices target the same peer simultaneously. While this didn't hurt convergence empirically, it represents a chaotic element in highly scaled environments.
  • Hardware/Primitive Constraints: The implementation required a sequential lock around NCCL communication primitives because NCCL is not natively thread-safe for fully asynchronous operations.
  • Future Work: The authors suggest scaling LayUp to even larger models (beyond 1.6B parameters), exploring more diverse tasks, and testing in highly heterogeneous hardware environments where device speed variance is extreme.

Summary updated

BibTeX
@misc{fokam2024layup,
  author = {Cabrel Teguemne Fokam and Marcel Nieveler and Lukas König and Khaleelulla Khan Nazeer and David Kappel and Anand Subramoney},
  title = {{LAYUP: Asynchronous decentralized gradient descent with LAYer-wise UPdates}},
  year = {2024},
  eprint = {2410.05985},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.05985},
}
Figure