Abstract
We consider the setting where a master wants to run a distributed stochastic gradient descent (SGD) algorithm on $n$ workers each having a subset of the data. Distributed SGD may suffer from the effect of stragglers, i.e., slow or unresponsive workers who cause delays. One solution studied in the literature is to wait at each iteration for the responses of the fastest $k<n$ workers before updating the model, where $k$ is a fixed parameter. The choice of the value of $k$ presents a trade-off between the runtime (i.e., convergence rate) of SGD and the error of the model. Towards optimizing the error-runtime trade-off, we investigate distributed SGD with adaptive $k$. We first design an adaptive policy for varying $k$ that optimizes this trade-off based on an upper bound on the error as a function of the wall-clock time which we derive. Then, we propose an algorithm for adaptive distributed SGD that is based on a statistical heuristic. We implement our algorithm and provide numerical simulations which confirm our intuition and theoretical analysis.
Introduction: The Straggler Problem in Distributed SGD
In distributed machine learning, a "master" node divides data among $n$ "worker" nodes. In synchronous SGD, the master typically waits for all workers to finish their gradient computations before updating the model. However, in real-world clouds, some workers are inevitably slower than others due to network congestion or resource contention—these are stragglers.
A common solution is fastest-$k$ SGD, where the master only waits for the first $k$ workers to respond. This creates a fundamental trade-off:
- Small $k$: Iterations are very fast, but the gradient estimate is noisy (high variance), leading to a high "error floor" where the model stops improving.
- Large $k$: Iterations are slow because you wait for more workers, but the gradient is more accurate, allowing the model to reach higher precision.
Most existing systems use a fixed $k$. This paper addresses the lack of a principled way to vary $k$ dynamically to get the "best of both worlds": the speed of small $k$ at the start and the precision of large $k$ at the end.
Methodology
The authors approach the problem through both theoretical modeling and a practical heuristic:
Wall-Clock Time Analysis
Unlike most papers that analyze error vs. the number of iterations, this paper derives an upper bound for error vs. wall-clock time. They use renewal theory to account for the random variables of worker response times. Using this theoretical bound, they derive specific "switching times" ($t_k$) at which the master should increase the value of $k$.
Statistical Heuristic (Algorithm 1)
Recognizing that theoretical switching times require knowing hidden system parameters (like the optimal loss value $F^*$), they propose a practical algorithm. It monitors the inner product of consecutive gradients.
- In the early "transient phase," gradients mostly point in the same direction (positive inner product).
- In the "stationary phase" (near the optimum), the model bounces around, and gradients become noisy and point in opposing directions (negative inner product).
The algorithm uses a counter to detect when negative inner products become frequent, signaling it's time to increase $k$ to reduce noise.
Experimental Setup
The paper evaluates the proposed algorithm using synthetic datasets:
- Data Generation: Features ($X$) were generated uniformly at random; labels ($y$) were generated via a linear model with added Gaussian noise.
- Task: Linear regression using an $\ell_2$ loss function.
- Worker Simulation: Worker response times were modeled using independent exponential random variables to simulate varying levels of straggling.
Key Results and Insights
The core insight is that SGD naturally moves from a transient phase (rapidly moving toward the goal) to a stationary phase (vibrating around the goal). The optimal $k$ is not static; $k=1$ is often best for the transient phase to maximize iteration speed, while $k=n$ is best for the stationary phase to minimize noise.
- Efficiency Gains: In simulations with 50 workers, the adaptive policy reached its lowest error at roughly $t=2000$, whereas the best non-adaptive version (fixed $k=40$) required $t=6000$ to reach the same level of accuracy.
- Superiority over Asynchronous SGD: The adaptive synchronous approach outperformed fully asynchronous SGD, which often struggles with "stale" gradients.
- Theoretical Validation: Numerical results closely matched the theoretical "switching points," confirming that the statistical heuristic effectively captures the underlying optimization logic.
Conclusion and Future Work
While the results are promising, the evaluation is currently limited to linear regression on synthetic data with exponential response times. Future work should explore real-world deep learning workloads and non-exponential straggler distributions. Additionally, the joint optimization of both the step size ($\eta$) and the worker count $k$ remains an open area for investigation, as does the impact of communication overhead in very large-scale settings.
Summary updated