Coordinating Distributed Example Orders for Provably Accelerated Training

A. Feder Cooper, Wentao Guo, Khiem Pham, Tiancheng Yuan, Charlie F. Ruan, Yucheng Lu, Christopher De Sa

TL;DR

Coordinated Distributed Gradient Balancing (CD-GraB) is a novel algorithm that brings the theoretical benefits of optimal example ordering to distributed machine learning. By coordinating how parallel workers sequence their data—using insights from kernel thinning—CD-GraB achieves a provable linear speedup in convergence and consistently outperforms standard random reshuffling in practice.

The Challenge: Scaling Gradient Balancing

In standard deep learning, models are typically trained using Stochastic Gradient Descent (SGD) paired with "Random Reshuffling" (RR), which simply shuffles the dataset at the start of every epoch. While RR is the industry standard, recent research has shown it is not mathematically optimal. A method called Gradient Balancing (GraB) proved that ordering examples based on "stale" gradients from previous epochs allows models to converge significantly faster than random shuffling.

However, GraB has a major limitation: it was designed for a single machine. Modern AI models are trained across dozens or thousands of GPUs in distributed settings, where each worker only sees a small subset of the data. If workers shuffle their local data independently, the global "balance" required for GraB’s speedup is lost. The core challenge is coordinating these local data orders across a network of workers to maintain GraB's theoretical and practical advantages without introducing massive communication overhead.

Introducing Coordinated Distributed GraB (CD-GraB)

To solve this, the authors introduce CD-GraB. The core innovation lies in how it reformulates the "herding" problem—the mathematical task of picking a sequence of vectors that mimics a target distribution—for a distributed environment.

CD-GraB Architecture

Key technical components of CD-GraB include:

  • Parallel Herding: A new formulation that allows workers to decide data permutations collaboratively rather than sequentially.
  • Online PairBalance: Instead of relying on a "stale mean" to center gradients (which can become unreliable at high learning rates), CD-GraB uses insights from kernel thinning. It balances the differences between pairs of adjacent gradient vectors, making the algorithm robust enough to handle larger learning rates.
  • Order Server Architecture: The system utilizes a central server (similar to a parameter server) that collects gradients from workers. While the model updates, the server simultaneously runs the PairBalance algorithm to determine the optimal data order for the next epoch, sending these permutations back to the workers.

Experimental Setup

The researchers evaluated CD-GraB across several distinct tasks to prove its versatility:

  • Logistic Regression: Evaluated on a large-scale mortgage application dataset (New York 2017 subset) with over 244,000 examples.
  • Language Modeling (LSTM): Trained on the WikiText-2 dataset.
  • Time-Series Forecasting (MLP): Evaluated on the M4 Weekly dataset.
  • Image Classification (Ablation): Used CIFAR-10 with a LeNet architecture to study how the algorithm scales with the number of workers.
  • Large Language Models: The authors also demonstrated successful empirical tests with GPT-2 on WikiText-103 using the AdamW optimizer.

Key Insights and Results

Theoretical Superiority

CD-GraB achieves a convergence rate of $\tilde{O}((mnT)^{-2/3})$ for smooth non-convex objectives. This is provably faster than the $\tilde{O}(N^{-1/3}T^{-2/3})$ rate of standard Random Reshuffling.

Theorem 2: Convergence Rate

Theoretically, CD-GraB achieves a linear speedup in convergence rate relative to the number of workers ($m$). This means that doubling your workers doesn't just make the epoch faster; it makes the model require fewer total steps to reach the same accuracy.

Consistent Empirical Gains

Across all benchmarks (Mortgage, WikiText-2, M4), CD-GraB reached lower training loss and better test metrics (accuracy, perplexity, or SMAPE) faster than Distributed Random Reshuffling (D-RR).

Furthermore, coordination proved essential. An ablation study showed that simply running GraB locally on each worker (without coordination) leads to performance degradation as more workers are added. In contrast, as the number of workers increased from 4 to 64 in CIFAR-10 experiments, the gap between CD-GraB and uncoordinated methods grew significantly, confirming that the coordination strategy works at scale.

Limitations and Future Work

  • Optimizer Theory: While CD-GraB works empirically with AdamW, the current convergence proofs are specifically for SGD. Extending the formal theory to adaptive optimizers is a logical next step.
  • Compute Budget: The authors noted they did not have the training budget to test CD-GraB on massive, multi-billion parameter LLMs from scratch, though the theoretical benefits should carry over.
  • The "Order Server" Vision: The authors propose a future where deep learning frameworks include a dedicated "Order Server" as a standard architectural component, similar to how All-Reduce collectives are used today. This would offload the computation of data orders to a background process, ensuring zero overhead for the workers.

Summary updated

BibTeX
@inproceedings{cooper2023coordinating,
  author = {A. Feder Cooper and Wentao Guo and Khiem Pham and Tiancheng Yuan and Charlie F. Ruan and Yucheng Lu and Christopher De Sa},
  title = {{Coordinating Distributed Example Orders for Provably Accelerated Training}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=ISRyILhAyS},
}
Figure