NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Speeding up distributed machine learning using codes

Kangwook Lee, Maximilian Lam, Ramtin Pedarsani, Dimitris S. Papailiopoulos, Kannan Ramchandran

TL;DR

This paper introduces a novel framework that applies coding theory to distributed machine learning to mitigate two major bottlenecks: "straggler" nodes (slow workers) and communication overhead during data shuffling. By injecting algorithmic redundancy via erasure codes, the authors demonstrate that distributed matrix multiplication can be sped up by a factor of $\log n$, while communication costs for data shuffling can be reduced by nearly an order of magnitude.

What Problem Does This Paper Address?

Modern machine learning relies on massive distributed systems. However, these systems suffer from "system noise"—unpredictable delays caused by shared resources, network congestion, or hardware variations.

The authors identify two specific pain points:

  1. The Straggler Problem: In a typical distributed task (like matrix multiplication), the entire system must wait for the slowest node to finish. As the number of nodes ($n$) grows, the probability of encountering a very slow "straggler" increases, creating a significant performance tail.
  2. Communication Bottlenecks: Many ML algorithms require shuffling data between iterations to improve statistical performance. Moving petabytes of data across a network creates a massive communication bottleneck that often dwarfs actual computation time.

Methods

The paper proposes "Coded Computation" and "Coded Shuffling" to address these issues. Unlike traditional error-correction codes that operate on bits, these techniques are applied directly to the data representation (e.g., floats and doubles) at the algorithmic level.

Coded Matrix Multiplication

To handle stragglers, the authors use Maximum Distance Separable (MDS) codes. Instead of simply partitioning a matrix $A$ into $k$ pieces for $k$ workers, they encode $A$ into $n$ pieces (where $n > k$) and distribute them to $n$ workers.

  • The "Aha" Moment: Because of the MDS property, the master node can recover the full product $AX$ as soon as any $k$ out of $n$ workers respond. This effectively ignores the $n-k$ slowest nodes.
Illustration of Coded Matrix Multiplication

Coded Shuffling

For data shuffling, the authors leverage Coded Caching. By using a small amount of extra storage at each worker to cache data from previous iterations, the master node can multicast "coded" messages.

  • Example: If Worker 1 needs batch $A_3$ and has $A_2$ cached, and Worker 2 needs $A_2$ and has $A_3$ cached, the master can multicast $A_2 + A_3$. Both workers can then decode their required batch by subtracting their cached data.
Illustration of Coded Shuffling

Datasets

The authors evaluated their approach using:

  • Synthetic Benchmarks: Square ($5750 \times 5750$), fat ($5750 \times 11500$), and tall ($11500 \times 5750$) matrices to test parallel matrix multiplication.
  • Amazon EC2 Clusters: Real-world performance was measured on clusters of 10 to 26 instances (using m1.small and c1.medium types) to capture authentic system noise and network latency.

Key Insights and Ideas

  • Redundancy as a Speedup: Counter-intuitively, adding more work (redundancy) can make the overall system faster by removing the need to wait for the "tail" of the distribution.
  • Algorithmic Integration: Coding isn't just a low-level networking trick; it can be "woven into the fabric" of the algorithm itself. This means developers don't need to re-factor deep system code to see gains.
  • Storage-Communication Trade-off: Coded shuffling proves that we can trade off cheap, abundant storage to alleviate expensive, scarce network bandwidth.
  • Exponential Tails: The authors show that if task runtimes have an exponential tail, coded computation provides a $\Theta(\log n)$ speedup over uncoded methods.

Key Results

  • Matrix Multiplication: On an Amazon EC2 cluster, coded matrix multiplication achieved a 40% reduction in average runtime and a 60% reduction in tail latency (95th percentile) compared to the best uncoded parallel algorithms.
  • Linear Regression: For coded gradient descent, the average runtime was reduced by up to 35.7%.
  • Shuffling Efficiency: Theoretical results show that if a fraction $\alpha$ of data is cached, communication costs drop by a factor of approximately $(\alpha + 1/n)n$. In experiments with $n=50$ workers and $10\%$ caching, communication overhead was reduced by more than 81%.
Runtime distributions comparing Uncoded, Repetition-coded, and MDS-coded schemes

Limitations and Future Work

  • Storage Overhead: Coded computation requires storing more data per node. For MDS-coded matrix multiplication, the storage overhead factor is $n/k - 1$.
  • Decoding Complexity: While the paper focuses on linear operations, the complexity of decoding more complex codes could potentially offset computation gains.
  • Non-linear Operations: Most results here apply to linear primitives (matrix mult, gradients). Extending these "coded" benefits to non-linear layers in deep learning remains a significant open challenge.
  • Heterogeneous Clusters: The current theoretical model assumes homogeneous workers; extending this to clusters with varying hardware capabilities is a suggested next step.

Summary updated

BibTeX
@inproceedings{lee2016speeding,
  author = {Kangwook Lee and Maximilian Lam and Ramtin Pedarsani and Dimitris S. Papailiopoulos and Kannan Ramchandran},
  title = {{Speeding up distributed machine learning using codes}},
  booktitle = {ISIT},
  year = {2016},
  doi = {10.1109/isit.2016.7541478},
}
Figure