• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

J4 ›› 2016, Vol. 38 ›› Issue (02): 202-209.

• 论文 • 上一篇    下一篇

基于HYB格式稀疏矩阵与向量乘在CPU+GPU异构系统中的实现与优化

阳王东1,2 ,李肯立2   

  1. (1.湖南城市学院信息科学与工程学院,湖南 益阳 413000;2.湖南大学信息科学与工程学院,湖南 长沙 410008)
  • 收稿日期:2015-04-10 修回日期:2015-06-05 出版日期:2016-02-25 发布日期:2016-02-25
  • 基金资助:

    国家自然科学基金重点项目(61432005);国家自然科学基金(61472124,61572175);湖南省科技计划项目(2015SK200062)

Implementation and optimization of HYB based SpMV
on CPU+GPU heterogeneous computing systems  

YANG Wangdong1,2,LI Kenli2   

  1. (1.School of Information Science and Engineering,Hunan City University,Yiyang 413000;
    2.College of Information Science and Engineering,Hunan University,Changsha 410008,China)
  • Received:2015-04-10 Revised:2015-06-05 Online:2016-02-25 Published:2016-02-25

摘要:

稀疏矩阵与向量相乘SpMV是求解稀疏线性系统中的一个重要问题,但是由于非零元素的稀疏性,计算密度较低,造成计算效率不高。针对稀疏矩阵存在的一些不规则性,利用混合存储格式来进行SpMV计算,能够提高对稀疏矩阵的压缩效率,并扩大其适应范围。HYB是一种广泛使用的混合压缩格式,其性能较为稳定。而随着GPU并行计算得到普遍应用以及CPU日趋多核化,因此利用GPU和多核CPU构建异构并行计算系统得到了普遍的认可。针对稀疏矩阵的HYB存储格式中的ELL和COO存储特征,把两部分数据分别分割到CPU和GPU进行协同并行计算,既能充分利用CPU和GPU的计算资源,又能够发挥CPU和GPU的计算特性,从而提高了计算资源的利用效能。在分析CPU+GPU异构计算模式的特征的基础上,对混合格式的数据分割和共享方面进行优化,能够较好地发挥在异构计算环境的优势,提高计算性能。

关键词: GPU, 稀疏矩阵, SpMV, CUDA, 异构计算

Abstract:

Sparse matrix vector multiplication (SpMV) is an important issue in solving sparse linear systems. The sparse features and the low computing density lead to low computation efficiency. Regarding the irregularities of the sparse matrixes, some hybrid storage formats are used to compute SpMV to improve the compression efficiency and expand the range of adaptation.  HYB is a hybrid compression format of ELL and COO formats, and is widely used on SpMV because of its stable performance. With the common application of parallel computing on GPUs and multicore CPUs, the heterogeneous computing system based on CPU+GPU is accepted. The ELL of HYB is assigned to the GPU for processing and the COO of HYB is assigned to the CPU, which can take full advantages of both CPU and GPU computing resources to improve the utilization efficiency of computing resources. In this paper, based on the analysis of the characteristics of the CPU + GPU heterogeneous computing model, we propose some optimization strategies to improve the performance of SpMV in the heterogeneous computing environment.

Key words: GPU;sparse matrix;SpMV;CUDA;heterogeneous computing