[论文解读] CSR5: An Efficient Storage Format for Cross-Platform Sparse Matrix-Vector Multiplication
CSR5 是一种新型稀疏矩阵存储格式,通过最小化格式转换开销并确保在常规和非规则矩阵上跨 CPU、GPU 和 Xeon Phi 的一致性能,实现了高吞吐量、跨平台的稀疏矩阵-向量乘法(SpMV)。其通过结构无关、SIMD 友好的设计,仅需两个调优参数,使非规则矩阵在 Xeon Phi 上的性能相比先前方法最高提升 943.3%。
Sparse matrix-vector multiplication (SpMV) is a fundamental building block for numerous applications. In this paper, we propose CSR5 (Compressed Sparse Row 5), a new storage format, which offers high-throughput SpMV on various platforms including CPUs, GPUs and Xeon Phi. First, the CSR5 format is insensitive to the sparsity structure of the input matrix. Thus the single format can support an SpMV algorithm that is efficient both for regular matrices and for irregular matrices. Furthermore, we show that the overhead of the format conversion from the CSR to the CSR5 can be as low as the cost of a few SpMV operations. We compare the CSR5-based SpMV algorithm with 11 state-of-the-art formats and algorithms on four mainstream processors using 14 regular and 10 irregular matrices as a benchmark suite. For the 14 regular matrices in the suite, we achieve comparable or better performance over the previous work. For the 10 irregular matrices, the CSR5 obtains average performance improvement of 17.6\%, 28.5\%, 173.0\% and 293.3\% (up to 213.3\%, 153.6\%, 405.1\% and 943.3\%) over the best existing work on dual-socket Intel CPUs, an nVidia GPU, an AMD GPU and an Intel Xeon Phi, respectively. For real-world applications such as a solver with only tens of iterations, the CSR5 format can be more practical because of its low-overhead for format conversion. The source code of this work is downloadable at https://github.com/bhSPARSE/Benchmark_SpMV_using_CSR5
研究动机与目标
- 为解决在求解器中仅使用数十次迭代时,CSR 与专用 SpMV 格式之间格式转换开销过高的问题。
- 设计一种单一存储格式,使在多种架构上对常规和非规则稀疏矩阵均能实现高性能。
- 最小化依赖结构的参数调优,以克服优化 SpMV 格式在实际部署中的障碍。
- 通过统一、低开销的格式,实现在 CPU、GPU 和 Xeon Phi 上的高效 SpMV。
- 缩小在基于迭代的科学计算中,优化格式与标准 CSR 格式之间的性能差距。
提出的方法
- 通过将经典 CSR 格式的三个数组中的两个以原地分块转置方式存储,同时保持一个数组不变,扩展了经典 CSR 格式。
- 引入两个新型辅助数据组,其长度短且与结构无关,从而降低内存开销。
- 采用重新设计的、低开销的分段求和算法,专为现代处理器上的 SIMD 执行而优化。
- 仅使用两个调优参数:一个与硬件相关,一个与稀疏度相关(但不依赖于结构),从而实现快速格式转换。
- 通过一致的数据布局和高 SIMD 利用率,支持在 CPU、NVIDIA 和 AMD GPU 以及 Intel Xeon Phi 上高效执行 SpMV。
- 通过允许以接近仅几次 SpMV 操作的开销实现快速转换,保持与基于标准 CSR 的工具的兼容性。
实验结果
研究问题
- RQ1是否能通过单一存储格式在不依赖结构调优的前提下,同时实现对常规和非规则稀疏矩阵的高性能 SpMV?
- RQ2在多种平台上实现高性能 SpMV 所需的最小格式转换成本是多少?
- RQ3在孤立 SpMV 和基于迭代的工作负载中,CSR5 与 11 种最先进的 SpMV 格式相比表现如何?
- RQ4在仅使用几十次迭代的现实求解器中,CSR5 是否能超越基于 CSR 的 SpMV,此时格式转换成本至关重要?
- RQ5CSR5 是否是唯一一种能同时在 CPU、GPU 和 Xeon Phi 上实现一致高性能的格式?
主要发现
- 对于 10 个非规则矩阵,CSR5 在双路 Intel CPU、NVIDIA GPU、AMD GPU 和 Intel Xeon Phi 上,相对于现有最佳方法,平均性能分别提升了 17.6%、28.5%、173.0% 和 293.3%。
- 在 Xeon Phi 上,CSR5 对非规则矩阵的性能相比最佳先前方法最高提升 943.3%。
- 在 50 次迭代的基于迭代的场景中,CSR5 的整体加速比高于所有其他格式,包括那些预处理开销更低的格式。
- 在 500 次迭代时,CSR5 在所有平台上均保持最高的整体加速比,表现出持续的高效性。
- 当仅执行 50 次迭代时,CSR5 是唯一一种性能优于标准 CSR 格式的格式,原因在于其极低的转换开销。
- 从 CSR 转换为 CSR5 的格式转换开销,低至仅几次 SpMV 操作的开销,使其在迭代次数有限的实际求解器中具有实用性。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。