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

Implementing Communication-Optimal Parallel and Sequential QR Factorizations

James Demmel, Laura Grigori, Mark Hoemmen, Julien LangouarXiv 2008

TL;DR

This paper introduces new QR factorization algorithms—Tall Skinny QR (TSQR) and Communication-Avoiding QR (CAQR)—that are designed to minimize data movement across memory hierarchies and networks. By treating QR factorization as a reduction operation, the authors achieve up to a 6.7x speedup over ScaLAPACK in practice and predict over 20x speedup for future petascale systems, all while maintaining the gold-standard numerical stability of Householder reflections.

What Problem Does This Paper Address?

In modern computing, the cost of moving data (communication) has far outpaced the cost of performing arithmetic (FLOPs). Traditional linear algebra libraries like LAPACK and ScaLAPACK were designed when FLOPs were the primary bottleneck. Consequently, their algorithms often move significantly more data than theoretically necessary between processors or between different levels of memory (like disk to RAM).

The authors target the QR factorization, a fundamental operation used for solving linear systems, least squares problems, and computing eigenvalues. The challenge is to create an algorithm that is "communication-optimal"—meaning it moves the minimum amount of data possible—without sacrificing the numerical stability required for scientific computing.

Methods

The authors propose two main algorithmic frameworks:

  1. Tall Skinny QR (TSQR): Designed for matrices where the number of rows is much larger than the number of columns. TSQR views the factorization as a reduction operation. The matrix is partitioned into block rows. Each block is factored locally, and the resulting R-factors are combined and factored again following a tree structure.
  2. Parallel TSQR typically uses a binary tree to minimize the number of messages between processors.
  3. Sequential TSQR uses a "flat tree" (linear chain) to minimize data movement between slow memory (like disk) and fast memory (RAM).
A visualization of the flat tree structure used in sequential TSQR, where blocks are factored and combined one by one.
  1. Communication-Avoiding QR (CAQR): This extends the TSQR idea to general rectangular matrices. It uses TSQR as a "panel factorization" step within a larger 2D block cyclic layout. By replacing the standard column-based Householder QR (which is a latency bottleneck) with TSQR, CAQR significantly reduces the number of messages required.

The implementation also leverages recursive local QR factorizations (Elmroth and Gustavson) to maximize performance within a single processor's cache.

Datasets

The authors evaluated their implementations on several high-performance computing platforms:

  • Pentium III Cluster ("Beowulf"): 35 dual-socket nodes with a Dolphin interconnect.
  • IBM BlueGene/L ("Frost"): A massive parallel system using 1024 compute CPUs.
  • PowerPC G4 Laptop: Used specifically for testing "out-of-DRAM" sequential TSQR, where the matrix is too large for RAM and must be stored on disk.
  • "Peta" Model: A performance model for a projected petascale machine with 8192 processors to estimate future scalability.

Key Insights and Ideas

  • QR as a Reduction: The most significant "aha" moment is realizing that QR factorization can be structured as a reduction. This allows the algorithm to adapt to any hardware topology (binary trees, flat trees, or hybrid trees) just by changing the reduction tree shape.
  • Stability vs. Speed: Many "fast" QR variants (like CholeskyQR or Gram-Schmidt) lose numerical stability when matrices are ill-conditioned. TSQR provides the speed of a reduction while remaining as stable as the standard Householder QR.
  • Communication is the New FLOP: The paper reinforces the shift in high-performance computing: an algorithm that does more arithmetic but less communication will almost always be faster on modern hardware.

Key Results

  • TSQR Speedups: On the Pentium III cluster, TSQR achieved up to 6.7x speedup over ScaLAPACK for a 100,000 x 200 matrix. On BlueGene/L, it saw up to 4x speedup.
  • Out-of-DRAM Performance: The sequential TSQR implementation allowed for factoring matrices that couldn't fit in RAM, running only about 2x slower than a theoretical version with infinite RAM—a massive improvement over standard methods that would trigger crippling system "swapping."
  • CAQR Projections: The performance model for a petascale machine predicts CAQR could be up to 22.9x faster than ScaLAPACK's current routines, particularly when latency dominates the total time.

Limitations and Future Work

  • Tree Optimization: While the paper shows that different trees (binary vs. flat) work for different scenarios, finding the optimal tree for complex, multi-level memory hierarchies (e.g., a system with GPUs, multicore CPUs, and networked storage) remains an open area for research.
  • Generalization: The authors suggest these communication-avoiding techniques can be extended to other two-sided factorizations (like those used for SVD or Eigenvalue problems), which are even more communication-intensive.
  • Implementation Status: At the time of publication, the full parallel CAQR implementation was still a work in progress, with results based largely on performance modeling.

Summary updated

BibTeX
@misc{demmel2008implementing,
  author = {James Demmel and Laura Grigori and Mark Hoemmen and Julien Langou},
  title = {{Implementing Communication-Optimal Parallel and Sequential QR Factorizations}},
  year = {2008},
  eprint = {0809.2407},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/0809.2407},
}
Figure