Understanding Top-k Sparsification in Distributed Deep Learning
Shaohuai Shi, Xiaowen Chu, Ka Chun Cheung, Simon See
TL;DR
This work tackles the communication bottleneck in distributed SGD by focusing on Top$_k$ gradient sparsification with error compensation. It shows that gradient coordinates tend to follow a bell-shaped, Gaussian-like distribution during training, which motivates a tighter contraction bound for the Top$_k$ operator: $rac{ rm{{m{u}}- ext{Top}_k({m{u}})}^2}{ rm{{m{u}}}^2} leq (1-rac{k}{d})^2$ and a related delta $ abla=rac{2kd - k^2}{d^2}$, leading to convergence guarantees that more closely explain observed performance than prior bounds. The paper then introduces Gaussian$_k$, a GPU-friendly approximate Top$_k$ that estimates the threshold using the percentile point function with $p=1-rac{k}{d}$ and gradient statistics $(bmu,bsigma)$, achieving $O(d)$ complexity while preserving accuracy. Extensive experiments across CNNs and RNNs validate that GaussianK-SGD closely matches TopK-SGD in convergence with small accuracy losses, and demonstrate substantial end-to-end speedups on a 16-GPU cluster compared to dense training and existing sparsification methods. These results provide a practical, scalable pathway for distributed training by combining tighter theory with an efficient top-$k$ selection algorithm.
Abstract
Distributed stochastic gradient descent (SGD) algorithms are widely deployed in training large-scale deep learning models, while the communication overhead among workers becomes the new system bottleneck. Recently proposed gradient sparsification techniques, especially Top-$k$ sparsification with error compensation (TopK-SGD), can significantly reduce the communication traffic without an obvious impact on the model accuracy. Some theoretical studies have been carried out to analyze the convergence property of TopK-SGD. However, existing studies do not dive into the details of Top-$k$ operator in gradient sparsification and use relaxed bounds (e.g., exact bound of Random-$k$) for analysis; hence the derived results cannot well describe the real convergence performance of TopK-SGD. To this end, we first study the gradient distributions of TopK-SGD during the training process through extensive experiments. We then theoretically derive a tighter bound for the Top-$k$ operator. Finally, we exploit the property of gradient distribution to propose an approximate top-$k$ selection algorithm, which is computing-efficient for GPUs, to improve the scaling efficiency of TopK-SGD by significantly reducing the computing overhead. Codes are available at: \url{https://github.com/hclhkbu/GaussianK-SGD}.
