arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.19489cs.PFcs.DCcs.MS
收藏

脏集如何移动:刻画增量稀疏矩阵乘法中的调度复用

How the Dirty Set Moves: Characterizing Schedule Reuse in Incremental Sparse Matrix Multiplication

HorneSci(霍恩科学);Loyola University Chicago, Chicago, IL, United States of America(芝加哥洛约拉大学)

Hunter Horne, Eric Spencer, Alex Henningfield, Arslan Bisharat

AI总结:

该研究通过实验表明,增量稀疏矩阵乘法中直接按列更新比分块调度复用更具收益,为开发者确定何时构建调度复用提供了指南。

摘要:

稀疏矩阵(其中大多数元素为零)是科学模拟、图分析和机器学习的核心,其与稠密输入的乘法是一种核心并行核函数。在许多应用中,矩阵保持固定,而每一步仅少数输入行发生变化,因此结果可仅通过这些行进行更新,我们将这些行称为脏集。稀疏核函数通常会基于 inspector-executor 原则添加第二种优化,其中分块调度会被准备一次并在多次调用中复用。然而,当脏集移动时,这种复用是否仍然具有收益尚未得到很好的刻画。在本文中,我们表明在增量稀疏矩阵乘法中,保留分块执行的性能很少能超过直接 CSC 方法,尽管增量执行本身仍然具有很高的收益。在 21 个 SuiteSparse 矩阵和受控的移动模式下,直接按列增量更新比包括 Intel oneMKL 和 PyTorch 在内的 8 种全重计算代码中最好的代码快 2.1-8.2 倍。然而,在 837 个工作负载中,相同的直接更新在 779 个工作负载中优于保留分块准备并缓存已组装调度的分块执行器。将复用分为逐分块准备和缓存调度表明,收益来自准备过程;额外的缓存容量很少有帮助,因为在不同分块介入后,分块集很少会再次出现。仅当分块将许多元素合并到每个输出写入中时,分块处理才会更快,这是一种我们在测量前预测并在同一家族的四个保留矩阵上得到证实的结构属性。这些结果表明,是矩阵的结构和脏集的移动,而非调度的复杂性,决定了复用是否具有收益。我们预计,我们的方法和指南将帮助开发者决定何时在增量稀疏运行时中构建调度复用。

英文摘要:

Sparse matrices, in which most entries are zero, are central to scientific simulation, graph analytics and machine learning, and their multiplication with dense inputs is a core parallel kernel. In many applications the matrix stays fixed while only a few input rows change per step, so the result can be updated from those rows alone, which we call the dirty set. Sparse kernels often add a second optimization based on the inspector-executor principle, in which a tiled schedule is prepared once and reused across calls. However, when this reuse remains profitable as the dirty set moves is not well characterized. In this paper, we show that retained tiled execution rarely beats direct CSC in incremental sparse matrix multiplication, although incremental execution itself remains highly profitable. Across 21 SuiteSparse matrices and controlled patterns of motion, a direct column-wise incremental update is 2.1-8.2x faster than the best of eight full-recomputation codes, among them Intel oneMKL and PyTorch. Yet the same direct update outperforms a tiled executor that retains tile preparation and caches assembled schedules in 779 of 837 workloads. Separating reuse into per-tile preparation and cached schedules shows that the benefit comes from preparation; extra cache capacity seldom helps because a tile set rarely returns after a different one has intervened. Tiling is faster only when tiles merge many entries into each output write, a structural property that we predicted before measurement and confirmed on four held-out matrices of the same family. These results show that the structure of the matrix and the motion of the dirty set, rather than the sophistication of the schedule, determine whether reuse is profitable. We anticipate that our methodology and guidelines will help developers decide when to build schedule reuse into incremental sparse runtimes.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑