TL;DR
This paper introduces RedSync, a system that significantly speeds up distributed deep learning training by optimizing gradient compression techniques. By addressing the practical challenges of implementing Residual Gradient Compression (RGC) on real-world hardware, RedSync achieves substantial performance gains for communication-intensive models, making large-scale training more efficient.
What Problem Does This Paper Address?
Training massive deep neural networks (DNNs) across multiple GPUs and machines is crucial for achieving state-of-the-art performance. Data parallelism is a popular strategy, but synchronizing the gradients from each worker can become a major bottleneck due to limited network bandwidth. While techniques like Residual Gradient Compression (RGC) promise to reduce this communication overhead by transmitting only a small fraction of gradients, their actual efficiency in real-world distributed systems has been underexplored. Existing RGC methods often focus on theoretical compression ratios, overlooking the practical challenges of efficient implementation on GPUs and the overheads associated with sparse data synchronization. This paper aims to bridge this gap by developing and evaluating a practical system, RedSync, that makes RGC effective in real distributed training environments.
Methods
RedSync builds upon the Residual Gradient Compression (RGC) framework and introduces several key innovations:
- Optimized Gradient Compression: RedSync combines RGC with a novel quantization technique called Alternating Signs Quantization (ASQ). ASQ further halves the communication bandwidth by alternating between quantizing the largest positive and largest negative gradients in consecutive iterations, eliminating the need for explicit sign transmission.
- Efficient Communication-Set Selection: A major bottleneck for RGC on GPUs is the overhead of selecting the top-k gradients. RedSync proposes two parallel-friendly selection algorithms:
- Trimmed Top-0.1% Selection: This method uses statistical features to quickly narrow down the search space for significant gradients before applying a GPU-optimized selection algorithm.
- Threshold Binary Search Selection: This approach avoids expensive top-k selection altogether by using binary search to find a threshold that identifies a sufficient number of large gradients. A "sampled" variant further optimizes this by reusing thresholds across iterations.
- Sparse Synchronization: RedSync addresses the challenge of synchronizing sparse gradient data structures. Instead of traditional dense Allreduce, it employs an Allgather operation, which is more amenable to handling varying sparse data sizes from different workers.
- Overlapping Communication and Computation: For CNNs, RedSync abandons gradient clipping to enable better overlap between communication and computation. For RNNs, it optimizes the overlap to occur during the compression phase.
Datasets
The paper evaluates RedSync on several standard datasets:
- Image Classification:
- Cifar10
- ImageNet
- Language Modeling:
- Penn Treebank (PTB)
- WikiText
Key Insights and Ideas
- Theoretical vs. Practical RGC: The paper highlights that achieving a high theoretical compression ratio for gradients doesn't automatically translate to faster training in practice. The overhead of selecting and synchronizing sparse gradients can negate the bandwidth savings.
- ASQ's Efficiency: The Alternating Signs Quantization (ASQ) is a clever way to halve communication bandwidth without accuracy loss, by cleverly exploiting the sign information of gradients.
- GPU-Friendly Selection is Crucial: The performance of RGC on GPUs is heavily dependent on efficient gradient selection. RedSync's proposed methods significantly outperform naive GPU implementations of top-k selection.
- Sparse Synchronization Challenges: Standard dense synchronization primitives are not ideal for sparse data. RedSync's use of Allgather for sparse synchronization is a practical solution.
- Communication-to-Computation Ratio Matters: RedSync shows the most significant benefits for models with a high communication-to-computation ratio, where gradient synchronization is the primary bottleneck.
Key Results
- Accuracy: RedSync (both RGC and RGC+ASQ) achieves accuracy comparable to standard SGD, with differences of no more than 1%. In several cases, RGC/RGC+ASQ even slightly outperform SGD. ASQ itself shows no negative impact on accuracy.
- Speedup: RedSync demonstrates significant speedups for communication-intensive DNNs like AlexNet, VGG16, and LSTMs, especially on larger clusters (e.g., 2-16 nodes). For example, it achieves up to 3x speedup on 4-16 nodes for AlexNet.
- Scalability: RedSync shows good scalability, particularly on the Piz Daint supercomputer with up to 128 GPUs.
- Overhead Analysis: The paper provides a detailed breakdown of time costs (computation, selection, sparse Allreduce, decompression) showing that for communication-intensive models, RedSync effectively reduces the overall training time.
Limitations and Future Work
- ResNet50 Performance: RedSync does not show significant performance gains for ResNet50, which has a high computation-to-communication ratio. The decompression phase becomes a bottleneck, overshadowing bandwidth savings.
- Medium Parallel Scale: RedSync is most effective at medium parallel scales (e.g., 4-16 nodes). At very large scales, decompression overhead becomes more pronounced, limiting further gains.
- Future Work: The authors suggest that further optimizations in decompression and exploring more advanced compression techniques could lead to even greater improvements. Investigating RedSync's effectiveness on different network architectures and hardware configurations would also be valuable.
Summary updated