Sparse Communication for Training Deep Networks

Negar Foroutan Eghlidi, Martin JaggiarXiv 2020

Abstract

Distributed training of massive deep learning models often encounters a significant communication bottleneck, where the time spent synchronizing gradients across GPUs exceeds the time spent on computation. This paper investigates gradient sparsification as a solution, introducing a novel block-random-k technique. By selecting contiguous blocks of gradients, this method optimizes hardware memory access patterns. Our evaluation on ResNet18 and CIFAR-10 shows that block-random-k achieves substantial speedups—reducing batch time from 375ms to 273ms—while maintaining accuracy within 1.4% of standard SGD.

Introduction

In the era of large-scale deep learning, data parallelism is the standard approach for distributed training. However, as the number of workers increases, the overhead of synchronizing gradients becomes a primary scalability bottleneck. While gradient compression techniques like quantization and sparsification aim to reduce bandwidth requirements, they often introduce significant computational overhead. For instance, Top-k sparsification requires expensive sorting operations, and Random-k methods can lead to inefficient non-contiguous memory access. This paper addresses these challenges by proposing a hardware-friendly sparsification scheme that minimizes both communication and computation costs.

Sparsification Strategies

The authors explore three primary dimensions of gradient sparsification to identify the most effective configurations for distributed training:

  1. Sparsification Scope: This refers to whether gradients are compressed independently for each layer (Layer-wise) or flattened into a single vector before compression (Global).
  2. Compression Schemes: The study evaluates Top-k (sending the $k$ largest gradients), Random-k (sending $k$ random indices), and the proposed Block-random-k. The latter selects a single random index and sends a contiguous block of $k$ values, exploiting modern hardware's preference for sequential memory access.
  3. Error Feedback: To mitigate the information loss from sending only 1% of gradients, unsent values are stored locally and accumulated into the next iteration's updates.

Experimental Setup

The proposed methods were evaluated using a ResNet18 model trained on the CIFAR-10 dataset. The experiments were conducted on a cluster of up to 8 NVIDIA Tesla K80 GPUs, focusing on the trade-offs between execution speed and model accuracy.

Performance Analysis

The experimental results highlight a critical "sorting tax" associated with Top-k methods. Despite its theoretical accuracy, the computational cost of sorting makes it slower than uncompressed SGD. In contrast, Block-random-k leverages sequential memory access to achieve real-world speedups.

Time breakdown per batch for various sparsification methods.

As shown in Figure 4, Block-random-k with AllReduce was the only configuration to outperform standard SGD in wall-clock time, achieving a 27% reduction in per-batch latency (273ms vs. 375ms). Other methods, such as Random-k (AllGather), actually increased the total training time due to the overhead of random memory access and communication protocols.

Accuracy and Sparsification Scope

A key finding of the research is the consistent superiority of layer-wise sparsification over global sparsification. Global sparsification tends to neglect smaller layers with lower gradient magnitudes, whereas layer-wise updates ensure all parts of the network receive diverse information throughout training.

Accuracy comparison across different sparsification scopes and worker counts.

Table 1 (Figure 5) illustrates that layer-wise sparsification maintains higher accuracy than global scope across varying numbers of workers ($W$). While standard SGD reaches ~94.5% accuracy, the Block-random-k method (using AllGather) maintains a respectable ~93.1% accuracy while communicating only 1% of the gradient data. The authors also noted that as the number of workers increases, the communication benefits of sparsification become more pronounced, though large global batch sizes can eventually impact generalization.

Conclusion

Block-random-k sparsification offers a practical path toward efficient distributed training by balancing communication savings with computational efficiency. By prioritizing contiguous memory access and layer-wise updates, the method achieves significant speedups with minimal impact on model performance. Future work should extend these findings to larger datasets and more diverse hardware environments, such as low-bandwidth edge clusters, where communication bottlenecks are even more severe.

Summary updated

BibTeX
@misc{eghlidi2020sparse,
  author = {Negar Foroutan Eghlidi and Martin Jaggi},
  title = {{Sparse Communication for Training Deep Networks}},
  year = {2020},
  eprint = {2009.09271},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2009.09271},
}
Figure