(2023-11-12) DASP: Specific Dense Matrix Multiply-Accumulate Units Accelerated General Sparse Matrix-Vector Multiplication
| Author: Yuechen Lu; Weifeng Liu; |
|---|
| Journal: , 1-14, 2023. |
| Journal Tags: |
| Local Link: Lu和Liu - 2023 - DASP Specific Dense Matrix Multiply-Accumulate Units Accelerated General Sparse Matrix-Vector Multi.pdf |
| DOI: 10.1145/3581784.3607051 |
| Abstract: Sparse matrix-vector multiplication (SpMV) plays a key role in computational science and engineering, graph processing, and machine learning applications. Much work on SpMV was devoted to resolving problems such as random access to the vector 𝑥 and unbalanced load. However, we have experimentally found that the computation of inner products still occupies much overhead in the SpMV operation, which has been largely ignored in existing work. In this paper, we propose DASP, a new algorithm using specific dense MMA units for accelerating the compute part of general SpMV. We analyze the row-wise distribution of nonzeros and group the rows into three categories containing long, medium, and short rows, respectively. We then organize them into small blocks of proper sizes to meet the requirement of MMA computation. For the three categories, DASP offers different strategies to complete SpMV by efficiently utilizing the MMA units. |
| Tags: |
| Note Date: 2025/7/22 21:45:09 |
📜 Research Core
⚙️ Content
研究背景(ABSTRACT)
稀疏矩阵向量乘法(SpMV)是计算科学与工程、图处理和机器学习应用中的核心运算之一。
现有的SpMV研究主要集中在以下两个方面:
- 解决向量x的随机访问问题
- 通过重构近似均匀大小的基本工作单元来平衡工作负载
即使这些现有工作已经展示了有希望的改进,所达到的性能仍然不令人满意,无法使带宽利用率接近峰值性能,表明SpMV算法仍有优化空间。
关键发现: 作者将标准CSR SpMV的执行时间分解为三个部分进行分析:
- RANDOM ACCESS(随机访问):平均占25.1%
- COMPUTE(计算):平均占21.1%
- MISCELLANEOUS(其他):平均占53.8%
实验发现计算部分仍然占用很大开销,而这部分的开销在已有工作中被严重忽略。
研究方法
核心思想: 提出DASP算法,使用 特定密集MMA单元加速通用SpMV的计算部分。核心挑战是如何将稀疏矩阵不规则的数据分布转换为MMA单元所需的规则布局。
分类策略: 根据每行非零元素数量将所有行分为三个类别:
- 长行(Long Rows):非零元素数量 > MAX_LEN (256)
- 中等行(Medium Rows):4 < 非零元素数量 ≤ MAX_LEN
- 短行(Short Rows):非零元素数量 ≤ 4
针对性处理: DASP算法对于三种不同的行类别使用不同的策略:
- 长行:分割成固定大小的组,用零填充以满足MMA计算要求
- 中等行:区分规则和不规则部分,分别使用不同的计算单元
- 短行:采用拼接策略,将短行组合成规则布局以提高MMA单元利用率
研究结果
- FP64双精度:平均比现有算法快1.5-2倍,最高可达90倍以上的加速
- FP16半精度:在A100上平均比cuSPARSE快1.7倍,在H800上快1.75倍
广泛的矩阵适用性: 在SuiteSparse矩阵集合的2893个矩阵上测试,DASP在绝大多数矩阵上都表现出色,证明了算法的通用性和鲁棒性。
💡 Innovations
- 发现计算部分是SpMV算法的性能瓶颈并且使用MMA加速单元实现更高的性能
- 提出DASP算法让稀疏矩阵不规则的数据分布变得规则以高效利用MMA单元
- 设计了能够充分利用MMA单元计算模式的数据布局