Abstract
Parallel Stochastic Gradient Descent (SGD) is a cornerstone of large-scale machine learning, yet its performance is often bottlenecked by the high cost of inter-processor communication. We introduce CA-SGD, a communication-avoiding variant for logistic regression that unrolls the algorithm's recurrence to communicate once every $s$ steps instead of every iteration. Our results show that CA-SGD achieves speedups of up to 4.97× on high-performance clusters and scales to 4× more cores than standard SGD, all while maintaining identical numerical accuracy.
Introduction
Stochastic Gradient Descent (SGD) is the primary optimization method for training models ranging from simple regressions to deep neural networks. To process massive datasets, SGD is parallelized across multiple compute nodes. However, standard parallel SGD requires processors to synchronize and exchange data after every mini-batch update. On modern hardware, the latency of sending messages is significantly higher than the time required for local calculations. As systems scale, this "communication tax" becomes the dominant cost, eventually causing performance to plateau. CA-SGD addresses this by mathematically reorganizing the algorithm so that processors can work independently for several steps before synchronizing.
Methods
The authors derive Communication-Avoiding SGD (CA-SGD) specifically for logistic regression by "unrolling" the recurrence relation of weight updates.
Recurrence Unrolling and Non-linearity
Instead of updating the weight vector $x$ at every step $h$, the algorithm looks ahead $s$ steps. It pre-computes the necessary interactions between sampled data points and current weights. While previous communication-avoiding methods were limited to linear problems, CA-SGD handles the non-linear sigmoid function of logistic regression. This is achieved by computing a "Gram matrix" of sampled data points and utilizing additional local memory to correct the gradient over $s$ steps without intermediate communication.
Algorithmic Tuning
The parameter $s$ serves as a tuning knob: increasing $s$ reduces the number of messages (latency) by a factor of $s$, though it requires slightly more local computation and bandwidth. The paper analyzes this trade-off under both 1D-block row and 1D-block column data partitioning schemes.
Numerical Stability and Convergence
A critical concern for communication-avoiding iterative solvers is numerical instability. However, CA-SGD remains stable even for large values of $s$ (up to 512).
As shown in the figure above, the relative solution error for various $s$ values stays significantly below machine epsilon ($\epsilon_{mach}$), confirming that the "unrolled" mathematics do not introduce significant floating-point errors.
Key Results
The algorithm was evaluated using datasets from the LIBSVM repository, including a6a, w7a, and url.
- Identical Convergence: CA-SGD is mathematically equivalent to standard SGD (up to floating-point error). It reaches the same accuracy in the same number of epochs.
- Significant Speedups: On an Infiniband cluster, CA-SGD achieved up to 4.97× speedup over standard SGD for the url dataset.
- Enhanced Scalability: While standard SGD performance degraded as more cores were added, CA-SGD continued to scale, effectively utilizing 4× more cores.
Discussion and Future Work
The benefits of CA-SGD are most pronounced when the batch size $b$ is small, as the cost of the Gram matrix computation grows with $b$. Future research could explore 2D data layouts (splitting both samples and features) for massive matrices and extending the $s$-step technique to multi-layer neural networks, where backpropagation presents a set of nested recurrences.
Summary updated