GPU上的分层矩阵运算:矩阵向量乘法和压缩
Hierarchical Matrix Operations on GPUs: Matrix-Vector Multiplication and Compression
摘要:
层次矩阵是稠密矩阵的空间和时间有效的表示,其利用不同粒度级别的矩阵块的低秩结构。分层低秩块划分产生的表示可以以接近线性的复杂度存储和操作,而不是稠密矩阵的通常多项式复杂度。在本文中,我们提出了高性能的实现矩阵向量乘法和压缩操作的$\mathcal{H}^2$变体的层次矩阵的GPU。除了分层块划分之外,该变体还利用用于块表示的分层基础,并且导致仅需要$O(n)$存储和用于mat-vec和压缩内核的$O(n)$复杂度的方案。这两个操作是层次矩阵的代数运算的核心,mat-vec是数值算法中普遍存在的运算,而压缩/再压缩表示其他代数运算的关键构建块,这些运算在执行期间需要定期再压缩。开发高效GPU算法的困难主要来自于分层表示的不规则树数据结构,而性能的关键是以允许执行批量线性代数运算的方式在扁平树上重新构建计算。这需要以允许批处理例程使用的方式封送布局不规则的数据。封送操作只涉及指针运算,不涉及数据移动,因此开销最小。我们对来自空间统计的2D和3D问题的协方差矩阵的数值结果显示了我们的例程实现的高效率--对于带宽有限的mat-vec超过550 GB/s,对于P100 Pascal GPU上的压缩超过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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。