在当前GPU上实现高而非常瘦矩阵的QR分解
Implementation of QR factorization of tall and very skinny matrices on current GPUs
AI总结:
本文针对高而瘦矩阵的QR分解问题,探讨了基于Gram矩阵和TSQR的两种算法,并提出Q-less QR和共享内存优化技术,证明了TSQR在求解时间上的竞争力,但需低级代码优化支持。
摘要:
我们考虑计算实稠密高而瘦矩阵的QR(或QZ)分解问题。即,列数远少于行数,导致大多数计算完全或部分受限于内存带宽。本文聚焦于仍支持64位浮点运算的最新NVIDIA GPGPU,但结果也适用于AMD GPU。我们讨论了两种基本算法:基于正交方程(Gram矩阵)的方法,特别是Cholesky-QR2和SVQB,以及基于Householder变换的树状缩减TSQR。我们提出两种主要优化技术:避免Q因子的写回(Q-less QR)和利用快速局部内存(GPU上的共享内存)。我们比较了Gramian基方法的直接实现和更复杂的TSQR实现,在性能、求解时间和实现复杂度方面。通过我们自己的代码和供应商优化的库例程进行性能建模和数值实验,我们证明了在内存受限到过渡(内存/计算受限)阶段专用方法和实现的重要性,并表明TSQR在求解时间上具有竞争力,但需要在低级代码优化上投入。
英文摘要:
We consider the problem of computing a QR (or QZ) decomposition of a real, dense, tall and very skinny matrix. That is, the number of columns is tiny compared to the number of rows, rendering most computations completely or partially memory-bandwidth limited. The paper focuses on recent NVIDIA GPGPUs still supporting 64-bit floating-point arithmetic, but the findings carry over to AMD GPUs as well. We discuss two basic algorithms: Methods based on the normal equations (Gram matrix), in particular Cholesky-QR2 and SVQB, and the "tall-skinny QR" (TSQR), based on Householder transformations in a tree-reduction scheme. We propose two primary optimization techniques: Avoiding the write-back of the Q factor ("Q-less QR"), and exploiting fast local memory (shared memory on GPUs). We compare a straight-forward implementation of Gramian-based methods, and a more sophisticated TSQR implementation, in terms of performance achieved, time-to-solution, and implementation complexity. By performance modelling and numerical experiments with our own code and a vendor-optimized library routine, we demonstrate the crucial need for specialized methods and implementations in this memory-bound to transitional (memory/compute-bound) regime, and that TSQR is competitive in terms of time-to-solution, but at the cost of an investment in low-level code optimization.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。