Sparse matrix computation is crucial in various modern applications, including large-scale graph analytics, deep learning, and recommendation systems. The performance of these algorithms varies greatly depending on the structure of the input matrix, making it difficult to gain a comprehensive understanding of sparse computation and its relationship to inputs, algorithms, and target machine architecture. Despite extensive research on certain sparse algorithms, such as SpMV, the overall family of sparse algorithms has yet to be investigated as a whole. In this paper, we introduce SpChar, a workload characterization methodology for general sparse computation. SpChar employs tree-based models to identify the most relevant hardware and input characteristics, starting from hardware and input-related metrics gathered from Performance Monitoring Counters and matrices. Our analysis enables the creation of a characterization loop that facilitates the optimization of sparse computation by mapping the impact of architectural features to inputs and algorithmic choices. We apply SpChar to more than 600 matrices from the SuiteSparse Matrix collection and three state-of-the-art Arm CPUs to determine the critical hardware and software characteristics that affect sparse computation. In our analysis, we determine that the biggest limiting factors for high-performance sparse computation are (1) the latency of the memory system, (2) the pipeline flush overhead resulting from branch misprediction, and (3) the poor reuse of cached elements. However, the degree to which those impact the performance of a CPU greatly depends on the algorithm and the input data.
翻译:稀疏矩阵计算在诸多现代应用中至关重要,包括大规模图分析、深度学习及推荐系统。这些算法的性能高度依赖于输入矩阵的结构,这使得全面理解稀疏计算及其与输入、算法和目标机器架构的关系变得困难。尽管对某些稀疏算法(如SpMV)已有广泛研究,但整个稀疏算法家族尚未被作为一个整体进行系统研究。本文提出SpChar,一种针对通用稀疏计算的工作负载表征方法。SpChar采用基于树的模型,从性能监控计数器和矩阵中采集的硬件与输入相关指标出发,识别最相关的硬件与输入特征。我们的分析能够构建一个表征循环,通过将架构特征的影响映射到输入和算法选择上,促进稀疏计算的优化。我们将SpChar应用于SuiteSparse矩阵集合中的600多个矩阵以及三种先进的Arm CPU,以确定影响稀疏计算的关键硬件和软件特征。分析发现,高性能稀疏计算的最大限制因素包括:(1)内存系统的延迟;(2)分支预测错误导致的流水线清空开销;(3)缓存元素复用性差。然而,这些因素对CPU性能的影响程度在很大程度上取决于算法和输入数据。