Anatomy of High-Performance Column-Pivoted QR Decomposition

Maksim Melnichenko, Riley Murray, William Killian, James Demmel, Michael W. Mahoney, Piotr Luszczek, Mark GatesarXiv 2025 · DOI

Abstract

Numerical linear algebra relies heavily on QR factorization. While unpivoted QR (GEQRF) is highly efficient due to its use of Level 3 BLAS, column-pivoted QR (QRCP)—essential for numerical stability—is significantly slower, often by a factor of 100x. This paper presents BQRRP (Blocked QR with Randomization and Pivoting), a novel framework that uses randomized sketching to bridge this performance gap. BQRRP achieves up to 140x speedup over standard industry libraries like LAPACK and MKL, reaching approximately 60% of the theoretical peak performance of unpivoted methods.

The "Pivot Tax" in Modern Computing

In standard numerical libraries, the choice between speed and stability is stark. Unpivoted QR factorization is optimized for modern hardware, maximizing compute power through matrix-matrix operations. In contrast, the standard pivoted algorithm, GEQP3, relies on memory-bandwidth-limited matrix-vector operations. This discrepancy has led to a massive "pivot tax," where choosing stability can make computations nearly two orders of magnitude slower on modern architectures.

Figure 1: Performance gap between unpivoted (GEQRF) and pivoted (GEQP3) QR, and the speedup of previous randomized methods (HQRRP) over standard LAPACK.

BQRRP: A Randomized Framework

The proposed BQRRP framework addresses this bottleneck by using randomized sketching to select pivots for an entire block of columns simultaneously. This "look-ahead" strategy allows the algorithm to utilize Level 3 BLAS for the bulk of the computation.

Key Innovations

  • LU-based Sketch Pivoting: Instead of greedy pivoting, BQRRP applies standard LU factorization with partial pivoting (GETRF) to a randomized sketch of the matrix. This serves as a fast and accurate proxy for identifying optimal pivot columns.
  • Modular Architecture: The framework is hardware-agnostic, allowing core subroutines to be optimized for specific architectures. For instance, the CPU implementation focuses on in-place memory management, while the GPU version employs a "parallel pivots" strategy to maximize throughput and avoid serial bottlenecks.

Performance Evaluation

The framework was rigorously tested on both synthetic Gaussian matrices and adversarial Kahan matrices to ensure both peak performance and numerical stability. Results show that the randomized approach maintains high pivot quality while dramatically increasing throughput.

CPU and GPU Results

On a dual AMD EPYC system, BQRRP demonstrated speedups of up to 140x over MKL’s standard GEQP3 routine. It consistently outperformed HQRRP, the previous state-of-the-art randomized algorithm, by factors of 7x to 20x on Intel systems. On NVIDIA H100 GPUs, the method achieved roughly 65% of the performance of cuSOLVER’s unpivoted QR, representing a major leap forward in closing the performance gap between stable and fast QR variants.

Conclusion

BQRRP demonstrates that the 100x performance gap between pivoted and unpivoted QR is an implementation artifact rather than a mathematical necessity. By leveraging randomization and Level 3 BLAS, BQRRP provides a high-performance alternative that does not sacrifice numerical stability. Future work will explore optimizations for ARM-based architectures and further integration with vendor-specific GPU libraries to unlock even greater performance.

Summary updated

BibTeX
@misc{melnichenko2025anatomy,
  author = {Maksim Melnichenko and Riley Murray and William Killian and James Demmel and Michael W. Mahoney and Piotr Luszczek and Mark Gates},
  title = {{Anatomy of High-Performance Column-Pivoted QR Decomposition}},
  year = {2025},
  eprint = {2507.00976},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.00976},
}
Figure