Sparse Matrix-Vector Multiplication (SpMV) has become a critical performance bottleneck in the local deployment of sparse Large Language Models (LLMs), where inference predominantly operates on workloads during the decoder phase with a batch size of one. Existing SpMV kernels and sparse matrix formats, originally designed for scientific computing, fail to exploit the unique structure patterns inherent in sparse LLMs, resulting in suboptimal performance and excessive storage overhead. This paper presents EC-SpMV, a GPU-optimized SpMV approach for accelerating sparse LLM inference. EC-SpMV introduces (1) a hierarchical block extraction algorithm that captures multiple granularities of block structures within sparse LLMs, and (2) a novel compressed sparse format (EC-CSR) that employs delta indexing to reduce storage overhead and enhance memory access efficiency. Evaluated on real sparse weight matrices from LLaMA and OPT models, EC-SpMV achieves up to 6.44x speedup over state-of-the-art SpMV libraries and reduces storage overhead by up to 55.4% compared to CSR.
Sparse matrix-vector multiplication on GPGPU clusters: A new storage format and a scalable implementation
Erlangen Regional Computing Center(埃尔朗根区域计算中心);Ernst-Moritz-Arndt University of Greifswald(格赖夫斯瓦尔德恩斯特·莫里茨·阿恩特大学);German Aerospace Center (DLR)(德国航空航天中心);Los Alamos National Laboratory(洛斯阿拉莫斯国家实验室)
Performance Modeling of Streaming Kernels and Sparse Matrix-Vector Multiplication on A64FX
A64 FX CPU是目前Top500排行榜上排名第一的超级计算机。虽然它是一个传统的基于缓存的多核处理器,但其峰值性能和内存带宽可与加速器设备相媲美。为这样一个新的体系结构生成高效的代码需要很好地理解其性能特性。利用这些功能,我们构建的执行缓存存储器(ECM)的性能模型的A64 FX处理器在FX 700超级计算机,并验证它使用流循环。我们还确定架构的特点,并获得优化提示。将ECM模型应用于稀疏矩阵向量乘法(SpMV),我们激发了CRS矩阵存储格式不合适的原因以及SELL-C-sigma格式如何通过适当的代码优化实现SpMV的带宽饱和。
A unified sparse matrix data format for efficient general sparse matrix-vector multiply on modern processors with wide SIMD units
稀疏矩阵向量乘法(spMVM)是许多数值算法中最耗时的核心,在所有现代处理器和加速器架构上都得到了广泛的研究。然而,最佳稀疏矩阵数据存储格式是高度硬件特定的,这可能成为使用异构系统时的障碍。此外,目前还不清楚如何在当前多核和众核处理器中最有效地使用宽单指令多数据(SIMD)单元,如果矩阵的稀疏模式中没有结构。我们建议SELL-C-sigma,切片ELLPACK的变体,作为一种SIMD友好的数据格式,它结合了通用图形处理单元(GPGPU)和矢量计算机编程的长期思想。我们讨论了SELL-C-sigma与压缩行存储(CRS)和ELLPACK等已建立的格式相比的优势,并展示了其在各种硬件平台(英特尔Sandy Bridge、英特尔至强融核和Nvidia Tesla K20)上的适用性,用于不同应用领域的各种测试矩阵。使用适当的性能模型,我们深入了解SELL-C-sigma spMVM内核的数据传输特性。SELL-C-sigma带有两个调整参数,研究了它们在测试矩阵范围内的性能影响,并提出了合理的选择。这导致了一种独立于硬件的(“全捕获”)稀疏矩阵格式,其对于跨所有硬件平台的所有测试矩阵实现了非常高的效率。