Journal of Computer Applications ›› 2024, Vol. 44 ›› Issue (12): 3867-3875.DOI: 10.11772/j.issn.1001-9081.2023111707

• Advanced computing • Previous Articles     Next Articles

Adaptive computing optimization of sparse matrix-vector multiplication based on heterogeneous platforms

Bo LI1,2, Jianqiang HUANG1,2(), Dongqiang HUANG1,2, Xiaoying WANG1   

  1. 1.Department of Computer Technology and Applications,Qinghai University,Xining Qinghai 810016,China
    2.Qinghai Provincial Laboratory of Intelligent Computing and Applications (Qinghai University),Xining Qinghai 810016,China
  • Received:2023-12-11 Revised:2024-02-07 Accepted:2024-03-01 Online:2024-05-30 Published:2024-12-10
  • Contact: Jianqiang HUANG
  • About author:LI Bo, born in 1998, M. S. candidate. His research interests include high performance computing.
    HUANG Dongqiang, born in 1998, M. S. candidate. His research interests include high performance computing.
    WANG Xiaoying, born in 1982, Ph. D., professor. Her research interests include smart grid, high performance computing, computer architecture.
  • Supported by:
    Applied Basis Research Program of Qinghai Province(2022-ZJ-701);National Natural Science Foundation of China(62062059)

基于异构平台的稀疏矩阵向量乘自适应计算优化

李博1,2, 黄建强1,2(), 黄东强1,2, 王晓英1   

  1. 1.青海大学 计算机技术与应用系,西宁 810016
    2.青海省智能计算与应用实验室(青海大学),西宁 810016
  • 通讯作者: 黄建强
  • 作者简介:李博(1998—),男,山东菏泽人,硕士研究生,CCF会员,主要研究方向:高性能计算
    黄东强(1998—),男,福建莆田人,硕士研究生,CCF会员,主要研究方向:高性能计算
    王晓英(1982—),女,吉林双辽人,教授,博士,CCF高级会员,主要研究方向:智能电网、高性能计算、计算机体系结构。
  • 基金资助:
    青海省应用基础研究计划项目(2022?ZJ?701);国家自然科学基金资助项目(62062059)

Abstract:

Sparse Matrix-Vector multiplication (SpMV) is an important numerical linear algebraic operation. The existing optimizations for SpMV suffer from issues such as incomplete consideration of preprocessing and communication time, lack of universality in storage structures. To address these issues, an adaptive optimization scheme for SpMV on heterogeneous platforms was proposed. In the proposed scheme, the Pearson correlation coefficients were utilized to determine highly correlated feature parameters, and two Gradient Boosting Decision Tree (GBDT) based algorithms eXtreme Gradient Boosting (XGBoost) and Light Gradient Boosting Machine (LightGBM) were employed to train prediction models to determine the optimal storage format for a certain sparse matrix. The use of grid searches to identify better model hyperparameters for model training resulted in both of those algorithms achieving more than 85% accuracy in selecting a more suitable storage structure. Furthermore, for sparse matrices with the HYBrid (HYB) storage format, the ELLPACK (ELL) and COOrdinate (COO) storage format parts in these metrices were computed on the GPU and CPU separately, establishing a CPU+GPU parallel hybrid computing mode. At the same time, hardware platforms were also selected for sparse matrices with small data sizes to improve computational speed. Experimental results demonstrate that the adaptive computing optimization achieves an average speedup of 1.4 compared to the Compressed Sparse Row (CSR) storage format in cuSPARSE library, and average speedup of 2.1 and 2.6 compared to the HYB and ELL storage formats, respectively.

Key words: Sparse Matrix-Vector multiplication (SpMV), adaptive optimization, Pearson correlation coefficient, eXtreme Gradient Boosting (XGBoost), Light Gradient Boosting Machine (LightGBM)

摘要:

稀疏矩阵向量乘(SpMV)是一种重要的数值线性代数运算,现有的优化存在预处理及通信时间考虑不全面、存储结构不具有普适性等问题。为了解决这些问题,提出异构平台下SpMV的自适应优化方案。所提方案利用皮尔逊相关系数确定相关度高的特征参数,并使用基于梯度提升决策树(GBDT)的极端梯度提升(XGBoost)和轻量级梯度提升(LightGBM)算法训练预测模型,以确定某一稀疏矩阵更优的存储格式。利用网格搜索确定模型训练时更优的模型超参数,使这2种算法选择更适合的存储结构的准确率都超过85%。此外,对于预测存储结构为混合(HYB)格式的稀疏矩阵,在GPU和CPU上分别计算其中的等长列(ELL)与坐标(COO)存储格式部分,建立基于CPU+GPU的并行混合计算模式;同时为小数据量的稀疏矩阵选择硬件平台,提高运算速度。实验结果表明,自适应计算优化相较于cuSPARSE库中的压缩稀疏行(CSR)存储格式计算的平均加速比可以达到1.4,相较于按照HYB和ELL存储格式计算的平均加速比则可以分别达到2.1和2.6。

关键词: 稀疏矩阵向量乘, 自适应优化, 皮尔逊相关系数, 极端梯度提升, 轻量级梯度提升机器学习

CLC Number: