Sparse matrix-vector multiplication (SpMV) is a fundamental operation in machine learning, scientific computing, and graph algorithms. In this paper, we investigate the space, time, and energy efficiency of SpMV using various compressed formats for large sparse matrices, focusing specifically on Boolean matrices and real-valued vectors. Through extensive analysis and experiments conducted on server and edge devices, we found that different matrix compression formats offer distinct trade-offs among space usage, execution time, and energy consumption. Notably, by employing the appropriate compressed format, we can reduce energy consumption by an order of magnitude on both server and single-board computers. Furthermore, our experiments indicate that while data parallelism can enhance execution speed and energy efficiency, achieving simultaneous time and energy efficiency presents partially distinct challenges. Specifically, we show that for certain compression schemes, the optimal degree of parallelism for time does not align with that for energy, thereby challenging prevailing assumptions about a straightforward linear correlation between execution time and energy consumption. Our results have significant implications for software engineers in all domains where SpMV operations are prevalent. They also suggest that similar studies exploring the trade-offs between time, space, and energy for other compressed data structures can substantially contribute to designing more energy-efficient software components.
翻译:稀疏矩阵-向量乘法(SpMV)是机器学习、科学计算和图算法中的基本运算。本文研究了在大型稀疏矩阵(特别针对布尔矩阵和实值向量)上使用多种压缩格式进行SpMV运算的空间、时间和能效特性。通过在服务器与边缘设备上进行的大量分析与实验,我们发现不同的矩阵压缩格式在空间占用、执行时间和能耗之间呈现出明显的权衡关系。值得注意的是,通过采用合适的压缩格式,我们能在服务器和单板计算机上将能耗降低一个数量级。此外,实验表明,虽然数据并行可以提升执行速度与能效,但实现时间与能耗的同时优化面临着部分不同的挑战。具体而言,我们证明对于某些压缩方案,时间最优的并行度与能耗最优的并行度并不一致,这对执行时间与能耗存在简单线性关系的普遍假设提出了挑战。我们的研究结果对SpMV运算普遍存在的各领域软件工程师具有重要启示。同时表明,针对其他压缩数据结构开展的时间-空间-能耗权衡研究,能为设计更高能效的软件组件作出实质性贡献。