Trust: Triangle Counting Reloaded on GPUs

Santosh Pandey, Zhibin Wang, Sheng Zhong, Chen Tian, Bolong Zheng, Xiaoye Li, Lingda Li, Adolfy Hoisie, Caiwen Ding, Dong Li, Hang LiuIEEE TPDS 2021 · DOI

Abstract

Triangle counting is a building block for a wide range of graph applications. Traditional wisdom suggests that i) hashing is not suitable for triangle counting, ii) edge-centric triangle counting beats vertex-centric design, and iii) communication-free and workload balanced graph partitioning is a grand challenge for triangle counting. On the contrary, we advocate that i) hashing can help the key operations for scalable triangle counting on Graphics Processing Units (GPUs), i.e., list intersection and graph partitioning, ii) vertex-centric design reduces both hash table construction cost and memory consumption, which is limited on GPUs. In addition, iii) we exploit graph and workload collaborative, and hashing-based 2D partitioning to scale vertex-centric triangle counting over 1,000 GPUs with sustained scalability. In this work, we present TRUST which performs triangle counting with the hash operation and vertex-centric mechanism at the core. To the best of our knowledge, TRUST is the first work that achieves over one trillion Traversed Edges Per Second (TEPS) rate for triangle counting.

TL;DR

TRUST is a high-performance triangle counting system for GPUs that shatters traditional graph processing wisdom. By combining a vertex-centric design with optimized hashing and a novel 2D partitioning scheme, it becomes the first framework to surpass the milestone of one trillion Traversed Edges Per Second (TEPS), outperforming state-of-the-art systems by orders of magnitude.

Introduction: Challenging Traditional Wisdom

Triangle counting—identifying sets of three mutually connected vertices—is a fundamental operation in graph analytics used for community detection, anomaly discovery, and network robustness analysis. However, as graphs grow to billions of edges, counting triangles becomes a massive computational burden.

The "traditional wisdom" in the field suggested that:

  1. Hashing is bad for triangle counting due to memory overhead and collisions.
  2. Edge-centric designs are superior to vertex-centric ones because they balance workloads better.
  3. Communication-free partitioning for distributed GPUs is nearly impossible to achieve while maintaining a balanced workload.

The authors of TRUST argue that these assumptions are outdated for modern GPU architectures. They set out to prove that a vertex-centric, hashing-based approach can actually be faster and more memory-efficient if implemented with hardware-aware optimizations.

Methods: The TRUST Architecture

TRUST (Triangle counting Reloaded on gUst on gPUs) introduces several key technical innovations to overcome the limitations of traditional methods.

Comparison of various list intersection methods for triangle counting, including neighbor list, merge-path, binary-search, hashing, and matrix multiplication.
  • Vertex-Centric Hashing: Unlike edge-centric methods that build hash tables for every edge, TRUST builds them per vertex. This reduces hash table construction time by an average of 92x and significantly lowers memory consumption because it doesn't require storing the graph in an edge-list format.
  • Hardware-Friendly Hash Layout: To minimize the cost of collisions, TRUST uses an interleaved hash table layout that ensures coalesced memory access on the GPU. It also caches the most frequently accessed hash buckets in fast on-chip shared memory.
  • Graph Reordering: The authors use two heuristics—reordering by "indegree" and "collective outdegree"—to assign vertex IDs. This ensures that high-degree vertices (which cause the most collisions) are spread across different hash buckets, reducing the "max collision" count from hundreds down to less than 16.
  • Virtual Combination: To solve the "intra-vertex" workload imbalance, TRUST virtually merges neighbor lists on the fly, allowing threads to work across a balanced, combined workload without the memory cost of actually merging the lists.
  • 2D Hashing-Based Partitioning: For multi-GPU scaling, TRUST uses a 2D partitioning scheme based on hashing rather than vertex ranges. This ensures a balanced workload across thousands of GPUs while remaining entirely communication-free during the counting phase.

Key Insights: Why Hashing Wins

The core of TRUST's performance lies in its rejection of binary search in favor of hashing.

TRUST's hashing-based intersection mechanism using linear probing to handle collisions efficiently on GPUs.
  • Hashing > Binary Search: While binary search is $O(\log N)$, hashing is $O(1)$. On GPUs, the "random access" penalty of hashing is mitigated by TRUST's interleaved layout and shared memory caching, making it far faster than the binary search methods used in previous "optimal" systems like TriCore.
  • Vertex-Centric is Memory-Efficient: By avoiding the edge-list format, TRUST saves roughly 2/3 of the data movement traffic compared to edge-centric designs.
  • Reordering is the Secret Sauce: Graph reordering isn't just for locality; it's a powerful tool for managing hash collisions. By strategically reassigning vertex IDs, the authors turned a "gigantic memory" problem into a manageable one that fits in GPU caches.

Key Results

  • Performance: TRUST achieved an average speedup of 50.1x over TriCore (the 2018 GraphChallenge champion) and 4,177.4x over Ligra (a popular CPU framework).
  • Throughput: It is the first system to achieve over 1.0 Trillion TEPS on datasets like rMat and 3Dgrid.
  • Scalability: The system demonstrated "sustained scalability" up to 1,024 GPUs on the Summit supercomputer. For medium-sized graphs, it achieved a 600x speedup when moving from 1 to 1,024 GPUs.

Limitations and Future Work

On very small graphs, the system struggles to scale to 1,000+ GPUs because there simply isn't enough work to keep all GPU cores busy. Additionally, while the triangle counting itself is lightning-fast, graph reordering and partitioning take time. Future work could focus on accelerating these preprocessing steps or adapting these hashing techniques to dynamic graphs that change in real-time.

Summary updated

BibTeX
@article{pandey2021trust,
  author = {Santosh Pandey and Zhibin Wang and Sheng Zhong and Chen Tian and Bolong Zheng and Xiaoye Li and Lingda Li and Adolfy Hoisie and Caiwen Ding and Dong Li and Hang Liu},
  title = {{Trust: Triangle Counting Reloaded on GPUs}},
  journal = {IEEE Trans. Parallel Distributed Syst.},
  year = {2021},
  doi = {10.1109/tpds.2021.3064892},
}
Figure