一句话:提出基于残差矩阵的自适应二维分块技术 RASSM,为 SpMM 等单稀疏矩阵核提升缓存占用与性能。
单稀疏矩阵核(SSMK)如 SpMM、SDDMM、SpMV、SpTS 是数据分析、图处理、有限元分析和机器学习等应用的核心,但稀疏矩阵不规则的非零分布会造成缓存占用低与数据移动开销大。本文提出 RASSM,一种输入相关的自适应二维分块技术;其核心是残差矩阵,可紧凑捕获稀疏矩阵非零模式,并据此智能选择 tile 尺寸,兼顾空间与时间局部性,改善数据移动与整体性能。在商用服务器 CPU 上,RASSM 对 SpMM 的空间分析比 MKL、J-Stream、ASpT、CSF-4 等有 1.10×–1.32× 加速,加入时间分析后可达 1.16×–1.38×。
Single-Sparse-Matrix Kernels (SSMKs) such as SpMM, SDDMM, SpMV, and SpTS form the backbone of applications such as data analytics, graph processing, finite-element analysis, machine learning (including GNNs and LLMs), etc. This paper introduces Residue-based Acceleration of Single Sparse Matrix Computation via Adaptive Tiling (RASSM), an input-dependent, adaptive 2-dimensional tiling technique for SSMKs. The adaptation leverages the concept of a residue matrix: a data structure that compactly captures the pattern of non-zeros in the sparse matrix. With residues, we show it is possible to make intelligent decisions on adaptive tile sizes, resulting in increased cache occupancy. Residues allow for optimizations across both spatial and temporal locality. RASSM improves data movement and overall performance as compared to prior techniques. For example, using spatial analysis for SpMM on commodity server CPUs, RASSM has 1.30X speedup over MKL, 1.32X over J-Stream, 1.20X over ASpT, 1.11X over CSF-4 uniform-shape, and 1.10X over CSF-4 uniform-occupancy. RASSM with temporal analysis improves this to 1.36X (vs. MKL), 1.38X (vs. J-Stream), 1.26X (vs. ASpT), 1.17X (vs. CSF-4 uniform-shape), and 1.16X (vs. CSF-4 uniform-occupancy).