Abstract
Pipeline-parallel distributed optimization is essential for large-scale machine learning but is challenged by significant communication overhead from transmitting high-dimensional activations and gradients between workers. Existing approaches often depend on impractical unbiased gradient assumptions or incur sample-size memory overhead. This paper introduces Clapping, a Communication compression algorithm with LAzy samPling for Pipeline-parallel learnING. Clapping adopts a lazy sampling strategy that reuses data samples across steps, breaking sample-wise memory barrier and supporting convergence in few-epoch or online training regimes. Clapping comprises two variants including Clapping-FC and Clapping-FU, both of which achieve convergence without unbiased gradient assumption, effectively addressing compression error propagation in multi-worker settings. Numerical experiments validate the performance of Clapping across different learning tasks.
Introduction
Training massive models like LLaMA-3 requires pipeline parallelism, where model layers are distributed across multiple GPUs. However, these GPUs must constantly exchange high-dimensional activations (forward pass) and gradients (backward pass), creating a severe communication bottleneck, particularly on slower networks. While data compression can mitigate this, it introduces "compression noise."
Traditional error-feedback mechanisms to counter this noise typically require storing compression errors for every sample in the dataset ($O(N)$ memory). For large-scale datasets with millions of samples, this is practically impossible. Furthermore, many existing methods rely on an "unbiased gradient" assumption. The authors highlight that this is often a myth in deep learning; even if a compressor is unbiased, the resulting gradient in a multi-layer pipeline becomes biased due to the non-linear composition of layers. Clapping is specifically designed to converge even in the presence of these biased gradients.
The Clapping Framework
The authors propose Clapping (Communication compression with LAzy samPling for Pipeline-parallel learnING) to address these challenges. The core innovation is Lazy Sampling, which reuses the same data sample for several consecutive iterations with a probability $1-p$.
By maintaining the same sample over multiple steps, the system can implement error feedback locally. The compression error from a previous step is added back into the current step, effectively "clearing" the bias over time. This approach reduces memory requirements from $O(N)$ (entire dataset) to $O(B)$ (current batch), as errors only need to be tracked for the active sequence of lazy samples.
There is a fundamental trade-off in this approach: reusing samples longer (smaller $p$) stabilizes communication and improves efficiency, but staying on one sample too long might cause the model to "over-learn" specific data points, potentially impacting generalization.
Two variants are introduced:
- Clapping-FC (First-step Compressed): Compresses all transmissions from the start.
- Clapping-FU (First-step Uncompressed): Transmits the first sample of a lazy sequence without compression to establish a clean baseline, then uses compression for subsequent refinement steps.
Theoretical and Empirical Performance
Clapping is designed to converge even with biased gradients, a common occurrence in multi-worker pipeline settings. As shown in the comparison table below, Clapping-FU achieves a convergence rate of $O(1/\sqrt{T})$, matching standard non-compressed SGD while maintaining low memory overhead.
Empirical results across benchmarks like GLUE, Wikitext-2, and C4 demonstrate significant gains:
- Speedup: A 2.2x speedup was observed in LLaMA-2 (1B) pre-training under 100Mbps bandwidth.
- Bandwidth Efficiency: 95% communication savings were achieved during LLaMA fine-tuning with negligible accuracy loss (<0.5%).
- Memory Reduction: For a 70B parameter model, Clapping reduces the required extra memory from ~85,000 GB (required by AQ-SGD) to just 60 GB—a 1400x reduction.
Conclusion
Clapping effectively breaks the memory barrier associated with communication compression in pipeline-parallel training. By leveraging lazy sampling, it provides a practical path for training large-scale models on commodity hardware with limited bandwidth. While hyperparameter tuning for the lazy probability $p$ is necessary, the method offers a robust solution for modern distributed AI. Future work may explore the regularizing effects of compression noise, potentially treating it as a feature that helps models generalize better.
Summary updated