On the Parallel I/O Optimality of Linear Algebra Kernels: Near-Optimal Matrix Factorizations

Grzegorz Kwasniewski, Marko Kabic, Tal Ben-Nun, Alexandros Nikolaos Ziogas, Jens Eirik Saethre, André Gaillard, Timo Schneider, Maciej Besta, Anton Kozhevnikov, Joost VandeVondele, Torsten Hoefler · DOI

Abstract

Matrix factorizations are among the most important building blocks of scientific computing. State-of-the-art libraries, however, are not communication-optimal, underutilizing current parallel architectures. We present novel algorithms for Cholesky and LU factorizations that utilize an asymptotically communication-optimal 2.5D decomposition. We first establish a theoretical framework for deriving parallel I/O lower bounds for linear algebra kernels, and then utilize its insights to derive Cholesky and LU schedules, both communicating N^3/(P*sqrt(M)) elements per processor, where M is the local memory size. The empirical results match our theoretical analysis: our implementations communicate significantly less than Intel MKL, SLATE, and the asymptotically communication-optimal CANDMC and CAPITAL libraries. Our code outperforms these state-of-the-art libraries in almost all tested scenarios, with matrix sizes ranging from 2,048 to 262,144 on up to 512 CPU nodes of the Piz Daint supercomputer, decreasing the time-to-solution by up to three times. Our code is ScaLAPACK-compatible and available as an open-source library.

Introduction: The Communication Bottleneck

In high-performance computing (HPC), matrix factorizations like LU and Cholesky are the fundamental engines of scientific simulations, ranging from quantum physics to climate modeling. While these operations were traditionally considered "compute-bound," the modern "memory wall" has shifted the challenge. Moving data between processors (I/O) now costs significantly more in time and energy than performing the actual arithmetic.

Existing "communication-optimal" 2.5D algorithms often fail in practice because they are only optimal in an asymptotic sense. Their real-world communication overhead can be 7 to 16 times higher than theoretical lower bounds, and the data movement required for "pivoting" (swapping rows for numerical stability) often negates any architectural benefits.

A New Theoretical Framework for I/O Bounds

To address these inefficiencies, researchers at ETH Zurich developed a two-pronged approach. First, they established a rigorous framework to derive precise, non-asymptotic I/O lower bounds for Disjoint Array Access Programs (DAAP). By using computational Directed Acyclic Graphs (cDAGs) and the "red-blue pebble game," they can prove exactly how much data must be moved for a given memory size.

The research workflow: from input programs and cDAG representation to deriving I/O lower bounds and implementing near-optimal matrix factorization schedules.

This framework led to the creation of COnfLUX (for LU) and COnfCHOX (for Cholesky). These algorithms utilize a 2.5D decomposition, replicating data across extra memory to parallelize the reduction dimension of the computation. To solve the pivoting problem in LU, they introduced Row-Masking Tournament Pivoting, which uses logical masks to identify rows instead of physically swapping them across the network, keeping communication costs within 1.5x of the theoretical bound.

Empirical Results and Performance

The algorithms were evaluated on the Piz Daint supercomputer using up to 512 CPU nodes. Historically, 2.5D LU algorithms were so inefficient that they required over 15,000 processors just to break even with well-optimized 2D libraries. COnfLUX and COnfCHOX overcome this gap, delivering practical benefits at much smaller scales.

Performance evaluation on the Piz Daint supercomputer. The left heatmap shows the speedup over state-of-the-art libraries, while the right heatmap displays the percentage of hardware peak performance achieved.

Key results include:

  • Speedup: Up to a 3x reduction in time-to-solution for LU factorization and 1.8x for Cholesky compared to SLATE and Intel MKL.
  • Communication Reduction: COnfLUX reduces communication volume by up to 1.6x compared to the next best implementation.
  • Efficiency: The algorithms maintain high hardware utilization even on relatively small matrices where 2.5D overheads usually dominate.
  • Compatibility: The code is ScaLAPACK-compatible, allowing it to serve as a drop-in replacement for existing scientific software.

Conclusion and Future Work

By focusing on tight constant factors rather than just big-O optimality, this work moves 2.5D algorithms from theoretical curiosities to practical tools. While the current implementation focuses on CPU architectures, future directions include extending these near-optimal schedules to GPU-heavy systems and developing auto-tuning mechanisms to optimize performance across diverse hardware configurations.

Summary updated

BibTeX
@inproceedings{kwasniewski2021parallel,
  author = {Grzegorz Kwasniewski and Marko Kabic and Tal Ben-Nun and Alexandros Nikolaos Ziogas and Jens Eirik Saethre and André Gaillard and Timo Schneider and Maciej Besta and Anton Kozhevnikov and Joost VandeVondele and Torsten Hoefler},
  title = {{On the Parallel I/O Optimality of Linear Algebra Kernels: Near-Optimal Matrix Factorizations}},
  booktitle = {SC},
  year = {2021},
  doi = {10.1145/3458817.3476167},
}
Figure