计算机工程与科学2024,Vol.46Issue(7):1175-1184,10.DOI:10.3969/j.issn.1007-130X.2024.07.005
一种不规则稀疏矩阵的SpMV方法
An irregular sparse matrix SpMV method
摘要
Abstract
Sparse matrix-vector multiplication(SpMV)is one of the key operators in the field of high performance computing and also has significant applications in emerging deep learning domains.Existing research on SpMV often focuses on square sparse matrices,while there is still a lack of in-depth explora-tion for irregularly shaped sparse matrices(with unequal numbers of rows and columns).The character-istic of unequal numbers of rows and columns results in different storage features for these sparse matri-ces compared to square sparse matrices,leaving room for further optimization.Therefore,this paper establishes an SpMV performance model for irregularly shaped sparse matrices with unequal rows and columns,and analyzes that the performance bottleneck is caused by insufficient bandwidth for data exchange between cache and memory.At the same time,this paper carried out the following two opti-mization tasks:(1)Based on the commonly used CSR storage format for sparse matrices,a new RCSR storage format is proposed,which transforms and compresses a performance-limiting array in the CSR storage format,making SpMV more efficient;(2)An optimized SpMV algorithm based on the RCSR format is designed in conjunction with the SIMD instruction set extension of domestic processors.This paper tests regular and irregular sparse matrices on domestic Phytium processors.For regular sparse matrices,the comprehensive application of RCSR storage format,SIMD instructions,and OpenMP par-allelization technology increases GFLOPS by 83.35%on average.For irregular sparse matrices,the performance improvement is related to the row-to-column ratio,and when the row-to-column ratio is not equal,the optimization effect is more obvious.关键词
稀疏矩阵/不规则矩阵/向量乘法/多核性能/性能优化Key words
sparse matrix/irregular matrix/vector multiplication/multicore performance/perform-ance optimization分类
信息技术与安全科学引用本文复制引用
施禹,董攀,张利军..一种不规则稀疏矩阵的SpMV方法[J].计算机工程与科学,2024,46(7):1175-1184,10.基金项目
国防科技重点实验室稳定支持基金(WDZC20235250111) (WDZC20235250111)
国家自然科学基金(62002371) (62002371)
国防科技大学基金(ZK21-17) (ZK21-17)