Sparse matrix multiplication instruction implementation method and system
The sparse matrix multiplication instruction implementation method provided by the invention comprises the following steps: compressing an initial sparse matrix through a matrix scale, sparseness and a data type in an obtained sparse matrix multiplication instruction to obtain a compressed sparse ma...
Gespeichert in:
Hauptverfasser: | , , , , , , , , |
---|---|
Format: | Patent |
Sprache: | chi ; eng |
Schlagworte: | |
Online-Zugang: | Volltext bestellen |
Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
Zusammenfassung: | The sparse matrix multiplication instruction implementation method provided by the invention comprises the following steps: compressing an initial sparse matrix through a matrix scale, sparseness and a data type in an obtained sparse matrix multiplication instruction to obtain a compressed sparse matrix; obtaining sparse index matrix data through the line number of the loaded compressed sparse matrix and a sparse index matrix established according to the sparse matrix; obtaining a dense matrix through the matrix scale, the row number and the sparse index matrix data; the compressed sparse matrix and dense matrix are subjected to matrix multiplication operation through the sparse index matrix data, so that the target matrix is obtained, the target matrix is written into the corresponding register, and the system has the same beneficial effects.
本发明提供的稀疏矩阵乘指令实现方法,是通过已获取的稀疏矩阵乘指令中的矩阵规模、稀疏度和数据类型,对初始的稀疏矩阵进行压缩,得到压缩后的稀疏矩阵;通过加载的压缩后的稀疏矩阵的行编号和根据稀疏矩阵建立的稀疏索引矩阵,获取稀疏索引矩阵数据;通过矩阵规模、行编号和稀疏索引矩阵数据,获取稠密矩阵;通过稀疏索引矩阵数据使压缩后的稀疏矩阵和稠密矩阵 |
---|