Abstract
Graph processing performance often relies on ad-hoc optimizations like direction-optimized Breadth-First Search (BFS). This paper bridges the gap between high-performance graph frameworks and the GraphBLAS linear algebra standard. By decomposing the "push-pull" optimization into separable linear algebraic primitives—specifically masked matrix-vector multiplication—the authors achieve state-of-the-art performance on GPUs, reaching 101 GTEPS. This work demonstrates that elegant mathematical abstractions can achieve competitive speed with specialized implementations.
Introduction
The irregular memory access patterns inherent in graph processing make optimization a significant challenge. For years, the "gold standard" for Breadth-First Search (BFS) has been the push-pull optimization, also known as direction-optimization. In the "push" phase, the current frontier updates its neighbors, which is efficient when the frontier is small. Conversely, in the "pull" phase, unvisited nodes check if any of their neighbors are in the frontier, which is more efficient when the frontier is large.
While specialized frameworks like Gunrock or Ligra implement these heuristics effectively, the GraphBLAS community—which treats graphs as sparse linear algebra—has historically struggled to match their performance. This paper explores how to express these low-level optimizations using the formal language of matrices and vectors without sacrificing efficiency.
Methods: Linear Algebra Primitives for Graph Traversal
The authors factor the push-pull optimization into three distinct, separable optimizations expressed through linear algebra:
- Change of Direction: They identify that the "push" phase corresponds to column-based matrix-vector multiplication (SpMSpV), while the "pull" phase corresponds to row-based multiplication (SpMV).
- Masking: This is the paper's core contribution. They formalize the "pull" phase as a masked matrix-vector multiplication (matvec). By using a mask representing the list of unvisited nodes, the algorithm achieves an asymptotic speedup by only performing computations for rows where the mask is non-zero.
- Early-exit: In the pull phase, once a node finds a single parent in the frontier, it can stop its search. The authors show this is mathematically equivalent to a short-circuiting logical OR operation within a Boolean semiring.
Beyond these, the authors introduce "Operand Reuse" (using the visited bitset directly) and "Structure-only" operations (treating the matrix as Boolean) to further streamline execution.
Key Insights
The "aha moment" of the research is the realization that push and pull are not fundamentally different algorithms, but rather the same linear algebraic operation ($y = A^T x$) viewed through different execution strategies (row- vs. column-traversal). Furthermore, masking is not merely a post-processing filter; when applied during the row-based matvec, it reduces complexity from $O(Edges)$ to $O(Unvisited\_Nodes \times Degree)$. This formalism is generalizable to any algorithm where output sparsity is known beforehand, such as PageRank or Triangle Counting.
Results and Performance
The implementation was evaluated on 11 diverse datasets, including social networks (soc-orkut), web graphs (indochina-04), and synthetic scale-free graphs (RMAT). On a Scale 22 RMAT graph using an NVIDIA K40c GPU, the implementation achieved a peak performance of 101 GTEPS (Giga-Traversed Edges Per Second).
In comparative benchmarks, the optimized GraphBLAS implementation was 122x faster than the reference SuiteSparse implementation and 3.5x faster than the CPU-based Ligra framework on scale-free datasets. Remarkably, it came within 34% of Gunrock, the fastest specialized GPU graph library, despite the constraints of the GraphBLAS abstraction. The "Early-exit" optimization was identified as the single most impactful improvement, providing a roughly 4x speedup.
Conclusion and Future Work
While the approach excels on power-law graphs, performance on high-diameter road networks remains a challenge, trailing Ligra by 3.2x. These graphs lack the "supernodes" that make direction-optimization effective. Future work will focus on integrating hardware-specific optimizations like "local culling" into the GraphBLAS standard and extending the masked matvec formalism to distributed GPU systems and other complex graph algorithms.
Summary updated