[论文解读] Hierarchical Matrix Operations on GPUs: Matrix-Vector Multiplication and Compression
本文提出了一种高性能GPU实现,用于$Θ^2$-矩阵的分层矩阵-向量乘法(HMV)与矩阵压缩,通过采用扁平化树形表示和批量线性代数计算,实现了接近最优的$\mathcal{O}(n)$复杂度。在P100 GPU上,其带宽超过550 GB/s,持续性能达850 GFLOPS/s,从而在空间统计与科学计算中实现了大规模稠密矩阵运算的高效处理。
Hierarchical matrices are space and time efficient representations of dense matrices that exploit the low rank structure of matrix blocks at different levels of granularity. The hierarchically low rank block partitioning produces representations that can be stored and operated on in near-linear complexity instead of the usual polynomial complexity of dense matrices. In this paper, we present high performance implementations of matrix vector multiplication and compression operations for the $\mathcal{H}^2$ variant of hierarchical matrices on GPUs. This variant exploits, in addition to the hierarchical block partitioning, hierarchical bases for the block representations and results in a scheme that requires only $O(n)$ storage and $O(n)$ complexity for the mat-vec and compression kernels. These two operations are at the core of algebraic operations for hierarchical matrices, the mat-vec being a ubiquitous operation in numerical algorithms while compression/recompression represents a key building block for other algebraic operations, which require periodic recompression during execution. The difficulties in developing efficient GPU algorithms come primarily from the irregular tree data structures that underlie the hierarchical representations, and the key to performance is to recast the computations on flattened trees in ways that allow batched linear algebra operations to be performed. This requires marshaling the irregularly laid out data in a way that allows them to be used by the batched routines. Marshaling operations only involve pointer arithmetic with no data movement and as a result have minimal overhead. Our numerical results on covariance matrices from 2D and 3D problems from spatial statistics show the high efficiency our routines achieve---over 550GB/s for the bandwidth-limited mat-vec and over 850GFLOPS/s in sustained performance for the compression on the P100 Pascal GPU.
研究动机与目标
- 解决核心$Θ^2$-矩阵操作(尤其是矩阵-向量乘法与压缩)在GPU上缺乏高性能算法的问题。
- 克服在GPU架构上处理分层矩阵中固有的递归与不规则树形数据结构所带来的性能挑战。
- 在全局内存有限的GPU上,实现对空间统计与PDE中常见的大规模稠密矩阵的高效、内存最优计算。
- 设计一种扁平化树形表示方法,以支持对不规则分层数据的线性代数操作高效批处理。
- 在GPU硬件上实现HMV与压缩操作的近线性复杂度($\mathcal{O}(n)$),与$Θ^2$-矩阵的理论效率相匹配。
提出的方法
- 将$Θ^2$-矩阵的分层树形结构扁平化为连续数组,以支持线性代数内核的批量执行。
- 使用指针运算将非规则布局的数据转换为连续批次,以最小化开销。
- 通过在扁平化低秩块与分层基结构上使用批量GEMV操作,实现矩阵-向量乘法。
- 通过在耦合矩阵与基节点上使用批量QR与SVD操作实现矩阵压缩,并通过截断保持精度。
- 利用CUBLAS批量GEMM例程优化正交化与投影阶段,兼顾计算与内存带宽效率。
- 将树形遍历逻辑与线性代数计算分离,实现数据布局与算法内核的清晰解耦。
实验结果
研究问题
- RQ1尽管分层矩阵具有固有的递归与不规则树形数据结构,其操作能否在GPU架构上实现高效映射?
- RQ2通过算法重构,如何在GPU上充分挖掘$\mathcal{H}^2$-矩阵的$\mathcal{O}(n)$存储与计算复杂度优势?
- RQ3通过扁平化分层树形表示并结合GPU上的批量线性代数计算,可在HMV与压缩操作中实现多大性能提升?
- RQ4在现代GPU上,内存受限的HMV与计算受限的压缩操作在多大程度上能实现高带宽与持续的FLOP速率?
- RQ5代数压缩在降低内存占用并提升大规模协方差矩阵后续HMV性能方面,效果如何?
主要发现
- 矩阵-向量乘法(HMV)在P100 GPU上的带宽超过550 GB/s,优于大型三维空间统计问题的STREAM带宽基准。
- 矩阵压缩在P100 GPU上持续性能超过850 GFLOPS/s,其中正交化阶段性能超过2,000 GFLOPS/s。
- 压缩的基生成与截断阶段性能超过600 GFLOPS/s,表明GPU上具有高度计算效率。
- 对于100万×100万的协方差矩阵,HMV耗时不足29 ms,在P100上达到理论峰值内存带宽的78%。
- 在P100 GPU上,将100万×100万矩阵从初始解析表示压缩为最优代数形式耗时不足1.7秒。
- 压缩带来的内存节省显著,尤其体现在低秩部分,且显著提升了后续HMV的运行时间。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。