We describe a simple parallel-friendly lightweight graph reordering algorithm for COO graphs (edge lists). Our ``Batched Order By Attachment'' (BOBA) algorithm is linear in the number of edges in terms of reads and linear in the number of vertices for writes through to main memory. It is highly parallelizable on GPUs\@. We show that, compared to a randomized baseline, the ordering produced gives improved locality of reference in sparse matrix-vector multiplication (SpMV) as well as other graph algorithms. Moreover, it can substantially speed up the conversion from a COO representation to the compressed format CSR, a very common workflow. Thus, it can give \emph{end-to-end} speedups even in SpMV\@. Unlike other lightweight approaches, this reordering does not rely on explicitly knowing the degrees of the vertices, and indeed its runtime is comparable to that of computing degrees. Instead, it uses the structure and edge distribution inherent in the input edge list, making it a candidate for default use in a pragmatic graph creation pipeline. This algorithm is suitable for road-type networks as well as scale-free. It improves cache locality on both CPUs and GPUs, achieving hit rates similar to the heavyweight techniques (e.g., for SpMV, 7--52\% and 11--67\% in the L1 and L2 caches, respectively). Compared to randomly labeled graphs, BOBA-reordered graphs achieve end-to-end speedups of up to 3.45. The reordering time is approximately one order of magnitude faster than existing lightweight techniques and up to 2.5 orders of magnitude faster than heavyweight techniques.
翻译:本文提出了一种适用于COO图(边列表)的简单且易于并行的轻量级图重排序算法。我们的"批量按附件排序"(BOBA)算法在读取操作上与边数呈线性关系,在写入主存操作上与顶点数呈线性关系,且高度适用于GPU并行化。研究表明,与随机基线相比,该算法生成的排序在稀疏矩阵向量乘法(SpMV)及其他图算法中显著改善了引用局部性。此外,它还能大幅加速从COO表示到压缩格式CSR的转换过程(一种常见工作流),即使在SpMV中也能实现端到端的加速效果。与其他轻量级方法不同,本重排序算法无需显式依赖顶点度数信息,其运行时间与计算度数相当。相反,它利用输入边列表固有的结构和边分布特性,使其成为实用图创建流程中默认算法的候选方案。该算法既适用于道路型网络,也适用于无标度网络,能够同时提升CPU和GPU的缓存局部性,达到与重量级技术相似的高速缓存命中率(例如SpMV中L1和L2缓存的命中率分别提升7-52%和11-67%)。与随机标签图相比,经BOBA重排序的图可实现高达3.45倍的端到端加速。其重排序时间比现有轻量级技术快约一个数量级,比重型技术快达2.5个数量级。