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

Computer Engineering & Science ›› 2022, Vol. 44 ›› Issue (01): 1-8.

Previous Articles     Next Articles

Implementation and optimization of sparse matrix vector multiplication based on RISC-V vector instruction

GU Yue,ZHAO Yin-liang   

  1. (School of Computer,Xi’an Jiaotong University,Xi’an 710049,China) 
  • Received:2020-03-23 Revised:2021-08-24 Accepted:2022-01-25 Online:2022-01-25 Published:2022-01-13

Abstract: Open source instruction set architecture RISC-V has the advantages of high performance, modularization, simplicity, easy extension, etc., and is widely used in the Internet of Things, cloud computing and other fields. The V module of its vector expansion part supports matrix numerical calculation well. As an important part of matrix numerical calculation, sparse matrix vector multiplication (SpMV) has profound research significance and value. Using the vector configurability and addressing characteristics of RISC-V instruction set, vector multiplication of sparse matrix based on CSR, ELLPACK and HYB compressed format is vectorized respectively. Meanwhile, considering that the sparse matrix is extremely sparse and the number of non-zero elements in each row fluctuates greatly, the HYB storage format is improved by compressing the storage of row vectors with low density of non-zero elements and adjusting the HYB segmentation threshold, which significantly improves the computational efficiency and storage efficiency.

Key words: RISC-V, vector expansion, sparse matrix, SpMV