arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2407.00829cs.DCcs.PF
收藏

自带格式与内核:稀疏矩阵计算的可组合抽象

Bring Your Own Formats and Kernels: Composable Abstractions for Sparse Matrix Computation

Purdue University(普渡大学);Virginia Tech(弗吉尼亚理工大学)

Pratyush Das, Amirhossein Basareh, Artem Pelenitsyn, Kirshanthan Sundararajah, Milind Kulkarni, Ben Delaware

AI总结:

提出SABLE框架,通过plan-extract-dispatch接口支持用户组合定制混合稀疏矩阵格式与内核,实现编译时针对目标矩阵的专门化,显著提升SpMV/SpMM性能。

摘要:

现实世界的稀疏矩阵通常具有多种形式的结构化稀疏性——矩形密集块、对角带和散点条目——没有单一的存储格式能够高效地利用所有这些特性。混合格式通过将矩阵的每个子区域以其最高效的形式存储来解决这个问题。然而,现有的混合方法仅支持固定的格式和内核集合,因此引入新的表示或内核需要修改其内部实现。我们提出了SABLE,一个允许用户通过\emph{plan-extract-dispatch}接口以组合方式构建定制混合格式的框架。用户定义\emph{提取器}将矩阵分割成特定格式的区域,以及\emph{内核}为每个区域生成专门的C代码;SABLE在编译时将这些部分组装成一个专门针对目标矩阵的单一程序。这两个组件是独立且可组合的,因此新格式会自动与所有现有内核集成,无需对框架进行任何修改。我们通过引入VDIA(一种用于非均匀长度对角带的新格式)并将其组合构建两种新的混合格式——VDIA+CSR和VDIA+VBR+CSR——来展示这种可扩展性。我们使用SuiteSparse基准测试中的矩阵对SpMV和SpMM进行评估,结果显示,与最佳的全稀疏基线相比,VBR+CSR的几何平均加速比为$1.10\ imes/1.20\ imes$(SpMV/SpMM),VDIA+CSR为$1.14\ imes/1.31\ imes$,而完整的VDIA+VBR+CSR组合在VBR+CSR基础上进一步实现了$1.08\ imes/1.25\ imes$的加速。

英文摘要:

Real-world sparse matrices often feature multiple forms of structured sparsity -- rectangular dense blocks, diagonal bands, and scattered entries -- that no single storage format can efficiently exploit. Hybrid formats address this by storing each subregion of a matrix in its most efficient form. Existing hybrid approaches, however, only support fixed sets of formats and kernels, so incorporating a new representation or kernel requires modifying their internals. We present SABLE, a framework that lets users build bespoke hybrid formats compositionally through a \emph{plan-extract-dispatch} interface. Users define \emph{extractors} that carve a matrix into format-specific regions and \emph{kernels} that emit specialized C code for each region; SABLE assembles these pieces into a single program specialized to the target matrix at compile time. Both components are independent and composable, so a new format automatically integrates with all existing kernels without any changes to the framework. We demonstrate this extensibility by introducing VDIA, a novel format for diagonal bands of non-uniform length, and composing it to build two new hybrid formats -- VDIA+CSR and VDIA+VBR+CSR. We evaluate SABLE on SpMV and SpMM using matrices from the SuiteSparse benchmarks, demonstrating geometric-mean speedups over the best fully-sparse baselines of $1.10\times/1.20\times$ (SpMV/SpMM) for VBR+CSR, and $1.14\times/1.31\times$ for VDIA+CSR, with the full VDIA+VBR+CSR composition yielding a further $1.08\times/1.25\times$ over VBR+CSR.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑