Scaling the Wild: Decentralizing Hogwild!-style Shared-memory SGD

Bapi Chatterjee, Vyacheslav Kungurtsev, Dan AlistarharXiv 2022 · DOI

Abstract

Training deep neural networks at scale often involves a trade-off between the high-speed, lock-free updates of shared-memory asynchrony (Hogwild!) and the scalability of decentralized message-passing (Local SGD). This paper introduces Locally-Partitioned-asynchronous Parallel SGD (LPP-SGD), a novel framework that bridges this gap. By combining asynchronous local updates, partial backpropagation, and non-blocking model averaging, LPP-SGD achieves significant training speedups and improved generalization. We provide a rigorous convergence analysis and demonstrate empirical gains across standard computer vision benchmarks.

Introduction

Training deep neural networks on massive datasets requires massive parallelism. Traditionally, researchers choose between two paradigms: shared-memory asynchrony, which is fast but limited to single machines, and decentralized message-passing, which scales well but often faces communication bottlenecks or poor generalization with large mini-batches. LPP-SGD addresses the challenge of decentralizing the "wild" nature of Hogwild!-style updates, allowing multiple GPUs to run internal asynchronous processes while communicating through an efficient, non-blocking averaging mechanism.

Methodology: The LPP-SGD Framework

LPP-SGD is built on three core components designed to maximize hardware utilization and minimize synchronization overhead:

  • Asynchronous Local Updates: Each GPU hosts multiple "updater" processes that compute gradients and update a local shared model without locks, maximizing hardware utilization.
  • Partial Backpropagation: To reduce computational costs, the model is partitioned into blocks. Updaters update specific blocks rather than the entire network in every step, effectively lowering the FLOP count per iteration.
  • Non-Blocking In-Place Averaging: A dedicated process on each GPU manages communication with peers. This averaging happens in the background, updating the local model "in-place" to avoid memory copy overheads.
Experimental overview showing training times and configurations across various methods and worker counts (Q=2, 4, 8).

To ensure theoretical soundness, the authors utilize an Elastic Consistency model to bound errors caused by "stale" gradients, proving that the algorithm achieves standard convergence rates for non-convex problems.

Key Results

LPP-SGD was evaluated across standard benchmarks including CIFAR-10, CIFAR-100, and ImageNet. The results consistently show that LPP-SGD outperforms standard Mini-Batch SGD (MB-SGD) and existing local SGD variants in both speed and accuracy.

Speed and Efficiency

On a 2-GPU setup, LPP-SGD achieved up to a 1.68x speedup over standard MB-SGD. For SqueezeNet on CIFAR-10, LPP-SGD finished training in approximately 1027 seconds, compared to 1580 seconds for the baseline—a nearly 35% reduction in time.

Detailed performance metrics for SqueezeNet on CIFAR-10, highlighting speedups and accuracy gains of LPP-SGD.

Generalization and Scalability

One of the most significant insights is that the noise introduced by asynchronous updates acts as a regularizer, pushing the model toward "flatter" minima and improving generalization. In tests, LPP-SGD reached 92.55% accuracy compared to 91.50% for the baseline. Furthermore, the method demonstrated near-linear scaling as the number of GPUs increased from 2 to 8.

Conclusion

LPP-SGD successfully decentralizes Hogwild!-style updates, providing a scalable and theoretically grounded approach to asynchronous SGD. By leveraging local asynchrony and efficient background communication, it offers a practical path to faster training without sacrificing model quality. Future work will explore integrating communication-reduction techniques like quantization and automating hyperparameter tuning to make the system more accessible for researchers.

Summary updated

Abstract

Powered by the simplicity of lock-free asynchrony, Hogwilld! is a go-to approach to parallelize SGD over a shared-memory setting. Despite its popularity and concomitant extensions, such as PASSM+ wherein concurrent processes update a shared model with partitioned gradients, scaling it to decentralized workers has surprisingly been relatively unexplored. To our knowledge, there is no convergence theory of such methods, nor systematic numerical comparisons evaluating speed-up. In this paper, we propose an algorithm incorporating decentralized distributed memory computing architecture with each node running multiprocessing parallel shared-memory SGD itself. Our scheme is based on the following algorithmic tools and features: (a) asynchronous local gradient updates on the shared-memory of workers, (b) partial backpropagation, and (c) non-blocking in-place averaging of the local models. We prove that our method guarantees ergodic convergence rates for non-convex objectives. On the practical side, we show that the proposed method exhibits improved throughput and competitive accuracy for standard image classification benchmarks on the CIFAR-10, CIFAR-100, and Imagenet datasets. Our code is available at https://github.com/bapi/LPP-SGD.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
CIFAR-100 · ResNet-20/CIFAR-100LPP-SGD (B_loc=128, U=4)Te.A. (test accuracy)69.75split: test · fine-tuned · U=4 · epochs=300 · backbone=ResNet-20 · hardware=2 Nvidia GeForce RTX 2080 Ti GPUs · local_batch_size=128
Source quote
L965: Lpp-sgd\xspace │ 128 │ 4 │ 0.378 │ 1.161 │ 89.50 │ 69.75 │ 1154
CIFAR-100 · ResNet-20/CIFAR-100LPP-SGD (B_loc=128, U=4)T (latency)1154-600 vs baselinesplit: test · fine-tuned · U=4 · epochs=300 · backbone=ResNet-20 · hardware=2 Nvidia GeForce RTX 2080 Ti GPUs · local_batch_size=128
Source quote
L965: Lpp-sgd\xspace │ 128 │ 4 │ 0.378 │ 1.161 │ 89.50 │ 69.75 │ 1154
CIFAR-100 · SqueezeNet/CIFAR-100LPP-SGD (B_loc=128, U=4)Te.A. (test accuracy)69.97split: test · fine-tuned · U=4 · epochs=200 · backbone=SqueezeNet · hardware=2 Nvidia GeForce RTX 2080 Ti GPUs · local_batch_size=128
Source quote
L978: Lpp-sgd\xspace │ 128 │ 4 │ 0.070 │ 1.504 │ 98.79 │ 69.97 │ 1071
Reported baseline / comparator measurements (3)
BenchmarkMethodMetricScoreProtocol / Evidence
CIFAR-100 · ResNet-20/CIFAR-100Mb-SGD (B_loc=128) baselineTe.A. (test accuracy)69.73split: test · fine-tuned · epochs=300 · backbone=ResNet-20 · hardware=2 Nvidia GeForce RTX 2080 Ti GPUs · local_batch_size=128
Source quote
L967: Mb-sgd\xspace │ 128 │ 0.360 │ 1.111 │ 89.93 │ 69.73 │ 1754
CIFAR-100 · ResNet-20/CIFAR-100Mb-SGD (B_loc=128) baselineT (latency)1754split: test · fine-tuned · epochs=300 · backbone=ResNet-20 · hardware=2 Nvidia GeForce RTX 2080 Ti GPUs · local_batch_size=128
Source quote
L967: Mb-sgd\xspace │ 128 │ 0.360 │ 1.111 │ 89.93 │ 69.73 │ 1754
CIFAR-100 · SqueezeNet/CIFAR-100Mb-SGD (B_loc=128) baselineTe.A. (test accuracy)70.06split: test · fine-tuned · epochs=200 · backbone=SqueezeNet · hardware=2 Nvidia GeForce RTX 2080 Ti GPUs · local_batch_size=128
Source quote
L980: Mb-sgd\xspace │ 128 │ 0.049 │ 1.178 │ 99.29 │ 70.06 │ 2134
BibTeX
@misc{chatterjee2022scaling,
  author = {Bapi Chatterjee and Vyacheslav Kungurtsev and Dan Alistarh},
  title = {{Scaling the Wild: Decentralizing Hogwild!-style Shared-memory SGD}},
  year = {2022},
  eprint = {2203.06638},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2203.06638},
}
Figure