arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2307.06109cs.MS
收藏

SpComp:一种面向稀疏结构的矩阵运算专用编译方法

SpComp: A Sparsity Structure-Specific Compilation of Matrix Operations

Barnali Basak, Uday P. Khedker, Supratim Biswas

AI总结:

本文提出编译时框架 SpComp,通过 Essential Indices Analysis 按非零结构自动重组稀疏矩阵计算;在 SpMSpV 和稀疏 Cholesky 上较 TACO、分段规则生成器及 CHOLMOD 平均提升最高 83%。

摘要:

稀疏矩阵运算涉及大量零操作数,这使得大多数运算都是冗余的。当矩阵运算在稀疏数据上重复执行时,冗余量会进一步放大。针对稀疏性优化矩阵运算通常涉及数据重组或计算重组,并可在编译时或运行时执行。尽管编译时技术避免了引入运行时开销,但其应用要么局限于生成稠密输出并处理不可变稀疏矩阵的简单稀疏矩阵运算,要么需要人工干预才能针对不同矩阵运算定制该技术。我们提出了一种名为 SpComp 的编译时技术,它通过根据数据非零值的位置自动定制计算来优化稀疏矩阵运算。我们的方法既不会产生任何运行时开销,也不需要任何人工干预。它还适用于生成稀疏输出并处理可变稀疏矩阵的复杂矩阵运算。我们引入了一种名为 Essential Indices Analysis 的数据流分析,它静态收集有关计算的符号信息,并帮助代码生成器重组计算。生成的代码包含分段规则循环,没有间接引用,并且适合进一步优化。与最先进的 TACO 编译器和分段规则代码生成器相比,SpComp 生成的 SpMSpV 代码表现出显著的性能提升。平均而言,相对于 TACO,我们实现了 79% 的性能提升;相对于分段规则代码生成器,实现了 83% 的性能提升。与 CHOLMOD 库相比,SpComp 生成的稀疏 Cholesky 分解代码平均展示出 65% 的性能提升。

英文摘要:

Sparse matrix operations involve a large number of zero operands which makes most of the operations redundant. The amount of redundancy magnifies when a matrix operation repeatedly executes on sparse data. Optimizing matrix operations for sparsity involves either reorganization of data or reorganization of computations, performed either at compile-time or run-time. Although compile-time techniques avert from introducing run-time overhead, their application either is limited to simple sparse matrix operations generating dense output and handling immutable sparse matrices or requires manual intervention to customize the technique to different matrix operations. We contribute a compile time technique called SpComp that optimizes a sparse matrix operation by automatically customizing its computations to the positions of non-zero values of the data. Our approach neither incurs any run-time overhead nor requires any manual intervention. It is also applicable to complex matrix operations generating sparse output and handling mutable sparse matrices. We introduce a data-flow analysis, named Essential Indices Analysis, that statically collects the symbolic information about the computations and helps the code generator to reorganize the computations. The generated code includes piecewise-regular loops, free from indirect references and amenable to further optimization. We see a substantial performance gain by SpComp-generated SpMSpV code when compared against the state-of-the-art TACO compiler and piecewise-regular code generator. On average, we achieve 79% performance gain against TACO and 83% performance gain against the piecewise-regular code generator. When compared against the CHOLMOD library, SpComp generated sparse Cholesky decomposition code showcases 65% performance gain on average.

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

↑