Abstract
It is inevitable to train large deep learning models on a large-scale cluster equipped with accelerators system. Deep gradient compression would highly increase the bandwidth utilization and speed up the training process but hard to implement on ring structure. In this paper, we find that redundant gradient and gradient staleness has negative effect on training. We have observed that in different epoch and different steps, the neural networks focus on updating different layers and different parameters. In order to save more communication bandwidth and preserve the accuracy on ring structure, which break the restrict as the node increase, we propose a new algorithm to measure the importance of gradients on large-scale cluster implementing ring all-reduce based on the size of the ratio of parameter calculation gradient to parameter value. Our importance weighted pruning approach achieved 64X and 58.8X of gradient compression ratio on AlexNet and ResNet50 on ImageNet. Meanwhile, in order to maintain the sparseness of the gradient propagation, we randomly broadcast the index of important gradients on each node. While the remaining nodes are ready for the index gradient and perform all-reduce update. This would speed up the convergence of the model and preserve the training accuracy.
Introduction
Training massive deep learning models requires distributed clusters. Traditionally, this is done using a Parameter Server (centralized) or Ring AllReduce (decentralized). While Ring AllReduce is generally more efficient because it avoids a central bottleneck, it struggles with "Deep Gradient Compression" (DGC).
In a standard DGC setup, nodes only send the most "important" gradients (sparsity). However, in a ring structure, as the sparse gradients from one node pass through others, they aggregate and become increasingly dense. By the time the data completes the circuit, the bandwidth savings have vanished. Additionally, "gradient staleness"—where updates are based on outdated information—can actively harm model convergence.
Methods: Importance Weighted Pruning
To address the density aggregation problem in rings and maintain training accuracy, we propose a three-pronged strategy:
- Importance Metric: Instead of just looking at the absolute size of a gradient, we measure importance as the ratio of the gradient to the current parameter value ($||\nabla w|| / ||w||$). This captures how much a specific update will actually "shift" the weight.
- Random Index Broadcasting: To solve the "density" problem in rings, the cluster randomly selects one node to be the "leader" for a step. This node determines the indices of the most important gradients and broadcasts that index map to the others. Every node then performs the AllReduce update only on those specific indices, ensuring sparsity remains constant throughout the ring.
- Layer-wise Dynamic Thresholding: Recognizing that neural networks focus on different layers at different stages of training, we use a dynamic threshold. This threshold is adjusted based on the mean and variance of gradient importance within each layer, allowing the compression rate to adapt as the model converges.
Experimental Setup
The proposed approach was evaluated on standard computer vision benchmarks:
- ImageNet: Used for training AlexNet and ResNet50.
- CIFAR10: Used for training ResNet101.
The experiments were conducted on a 96-node cluster using consumer-grade NVIDIA GTX 1080ti GPUs and standard Gigabit Ethernet. This setup demonstrates that algorithmic efficiencies can bypass the need for expensive enterprise hardware like Infiniband.
Results and Discussion
The "Importance Weighted Pruning" method demonstrated significant gains without sacrificing accuracy.
Compression and Accuracy
- Compression Ratios: We achieved 64x compression on AlexNet and 58.8x on ResNet50.
- Accuracy: On ResNet50, the "Layerwise Threshold" method slightly outperformed the baseline accuracy (76.31% vs 76.09%) while using significantly less bandwidth.
The "Focus" Phenomenon
We observed that neural networks don't update all parameters equally. At different epochs, the "learning energy" shifts between different layers. Our layer-wise approach exploits this by not forcing a "one-size-fits-all" compression rate across the whole model.
Fighting Staleness
To combat gradient staleness (gradients that are 100-300 steps old), we introduce a probabilistic update. Even if a gradient is below the importance threshold, it has a small chance to be updated anyway, which helps "refresh" the parameters and resist staleness.
Conclusion and Future Work
Our importance-weighted pruning approach enables high-speed training on large clusters with standard hardware. While randomly choosing a node to set the importance index works, future research could explore if selecting nodes based on local loss would improve performance. Additionally, while the dynamic thresholding is effective, it introduces hyperparameters that may require tuning for new architectures. Future work will also investigate the applicability of this approach to other decentralized topologies like 2D-Torus or Hierarchical Rings.
Summary updated