arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2407.00243cs.DC
收藏

改善稀疏与稠密矩阵乘法中的局部性

Improving Locality in Sparse and Dense Matrix Multiplications

Mohammad Mahdi Salehi Dezfuli, Kazem Cheshmi

AI总结:

本文提出运行时方法 tile fusion,通过融合稀疏与稠密矩阵乘法分块来改善数据局部性,并在多核 CPU 上相比未融合基线和 MKL 分别取得 1.97 倍和 1.64 倍的几何平均加速。

摘要:

连续的矩阵乘法常用于图神经网络和稀疏线性求解器中。这些操作经常对相同的矩阵进行读写访问。虽然重用这些矩阵可以改善数据局部性,但由于两个乘法操作之间迭代存在不规则的依赖关系,这带来了挑战。现有的融合方法通常引入过多的同步开销,或产生重叠计算但收益有限。本文提出了 tile fusion,一种运行时方法,用于融合两个矩阵-矩阵乘法的分块(tile),其中至少有一个涉及的矩阵是稀疏的。tile fusion 旨在改善数据局部性,同时为共享内存多核处理器中的核心提供足够的工作负载。对于一对矩阵-矩阵乘法,在多核 CPU 上,tile fusion 相较于未融合基线和 MKL 实现的几何平均加速比分别为 1.97 倍和 1.64 倍。

英文摘要:

Consecutive matrix multiplications are commonly used in graph neural networks and sparse linear solvers. These operations frequently access the same matrices for both reading and writing. While reusing these matrices improves data locality, it presents a challenge due to the irregular dependencies between iterations across the two multiplication operations. Existing fusion methods often introduce excessive synchronization overhead or overlapped computations with limited benefits. This paper proposes tile fusion, a runtime approach that fuses tiles of the two matrix-matrix multiplications, where at least one of the involved matrices is sparse. Tile fusion aims to improve data locality while providing sufficient workload for cores in shared-memory multi-core processors. For a pair of matrix-matrix multiplications, tile fusion outperforms unfused baseline and MKL implementations with a geometric mean speedup of 1.97$\times$ 1.64$\times$, respectively, on multi-core CPUs.

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

↑