Dual Entangled Polynomial Code: Three-Dimensional Coding for Distributed Matrix Multiplication

Pedro Soto, Jun Li, Xiaodi FanICML 2019

This paper introduces Dual Entangled Polynomial (DEP) codes, a novel 3D coding scheme for distributed matrix multiplication. By requiring each worker node to perform two sub-multiplications instead of one, the authors cleverly "pack" noise terms together. This reduces the number of successful nodes needed to recover the final result by approximately 25% compared to previous state-of-the-art methods.

The Challenge of Distributed Matrix Multiplication

In large-scale machine learning, matrix multiplication is a ubiquitous but computationally expensive building block. To handle massive datasets, these operations are distributed across clusters of nodes. However, distributed systems inevitably suffer from stragglers—nodes that are slow or unresponsive due to hardware issues, network congestion, or resource contention.

Traditional Distributed Coding Schemes

Traditional ways to handle stragglers include:

  1. Replication: Running the exact same task on multiple nodes, which incurs high resource overhead.
  2. 1D/2D Coding: Splitting matrices in one or two dimensions and using erasure coding. While effective, these methods struggle to scale when both matrices are very large.
  3. 3D Coding (EP Codes): Splitting matrices across all three dimensions (rows of A, columns of B, and the shared inner dimension). While Entangled Polynomial (EP) codes were the previous state-of-the-art, they still required a relatively high number of successful tasks (the "recovery threshold") to reconstruct the final product.

The authors aim to bridge the gap between the theoretical optimal recovery threshold and the practical performance of 3D coding schemes.

Introducing Dual Entangled Polynomial (DEP) Codes

The core innovation of this work is the Dual Entangled Polynomial (DEP) code. In standard EP codes, each worker calculates one sub-multiplication. The results act as coefficients of a large polynomial; the master node collects enough results to interpolate this polynomial and extract the desired product submatrices.

DEP codes change the game through several key mechanisms:

  • Dual Execution: Each worker node executes two matrix multiplications instead of one.
  • Polynomial Symmetry: The authors define a coded task $T(\delta)$ as the sum of two components: $T_1(\delta) + T_2(\delta^{-1})$.
  • Noise Overlapping: By carefully choosing the exponents for the submatrices, they ensure that multiple "noise" terms (unwanted partial products) share the same exponent. In EP codes, at most two noise terms share an exponent; in DEP, up to four terms can overlap.
  • Lower Degree: Because more noise is packed into fewer terms, the overall degree of the polynomial is lower. A lower degree means the master node needs fewer "points" (successful worker results) to solve the system.

The "Aha!" Moment

The authors realized that the bottleneck in 3D coding wasn't the desired data, but the "noise" generated by the polynomial construction. By forcing the system to be point-symmetric across the center of the exponent table, they could double the "noise density," effectively making the recovery equations more efficient.

While each node does twice the work (two multiplications), the sub-matrices are smaller. This means the memory footprint per node remains manageable, and the total time spent waiting for the "fastest" nodes is reduced because fewer of them are needed to finish.

Experimental Setup and Key Results

The paper evaluates the algorithm using synthetic matrix multiplication tasks to measure system performance. They tested large-scale matrices (e.g., $3600 \times 200$ multiplied by $200 \times 3600$) in a real-world cloud environment on Microsoft Azure using B1s virtual machines and OpenMPI for distributed communication.

The results demonstrate significant improvements over existing methods:

  • Lower Recovery Threshold: DEP codes require roughly 25% fewer tasks than EP codes. Specifically, for partitions $x, y, z$, DEP requires $\approx \frac{3}{4}xyz + \frac{z}{2} - 1$ tasks, whereas EP requires $xyz + z - 1$.
  • Straggler Tolerance: In experiments with 24 workers, DEP could tolerate up to 120% more stragglers than EP codes while still successfully completing the job.
  • Speedup: Because the recovery threshold is lower, the master node receives fewer total messages. DEP codes reduced the decoding overhead at the master node by approximately 50%.
  • Memory Savings: By allowing for more partitions ($z$) for the same number of workers, DEP saved between 22.2% and 47.6% in memory consumption per task across different test configurations.

Limitations and Future Work

Despite these impressive gains, the approach has limitations. Because each worker performs two multiplications, environments where CPU is the primary bottleneck (rather than network latency or straggler variance) might see diminished returns from the overhead of the second multiplication. Additionally, while the paper provides an optimal choice for the exponent parameters, the best configuration of partitions still depends on the specific dimensions of the input matrices and the cluster size.

Future work will likely explore how easily this "dual" polynomial approach can be generalized to other distributed primitives, such as convolutions or gradient aggregations in deep learning.

Summary updated

BibTeX
@inproceedings{soto2019dual,
  author = {Pedro Soto and Jun Li and Xiaodi Fan},
  title = {{Dual Entangled Polynomial Code: Three-Dimensional Coding for Distributed Matrix Multiplication}},
  booktitle = {International Conference on Machine Learning},
  year = {2019},
}
Figure