Pangolin: An Efficient and Flexible Graph Mining System on CPU and GPU

Xuhao Chen, Roshan Dathathri, Gurbinder Gill, Keshav Pingali

TL;DR

Pangolin is a high-performance framework for Graph Pattern Mining (GPM) that bridges the massive performance gap between general-purpose frameworks and hand-optimized code. By introducing a flexible "extend-reduce-filter" programming model and novel GPU-specific abstractions, it achieves up to 88x speedups over existing systems and enables mining on graphs with over 50 billion edges.

What Problem Does This Paper Address?

Graph Pattern Mining (GPM)—the process of finding structural motifs like triangles, cliques, or frequent subgraphs—is a "computational nightmare." Unlike simpler graph analytics (like PageRank), GPM suffers from a combinatorial explosion of intermediate data and requires expensive isomorphism tests to ensure the same subgraph isn't counted twice.

Existing frameworks like Arabesque or RStream prioritize ease of use but are often orders of magnitude slower than hand-optimized, application-specific solvers. This is because they hide low-level execution details, preventing developers from applying domain-specific pruning or skipping redundant isomorphism tests. Furthermore, most existing systems are designed for distributed or out-of-core environments, failing to exploit the massive parallel potential of modern shared-memory CPUs and GPUs.

Methods

The authors introduce Pangolin, which uses a new programming model called Extend-Reduce-Filter:

  1. Extend: Generates new subgraphs (embeddings) by adding a vertex or edge. Pangolin allows users to define toAdd and toExtend functions to prune the search space early.
  2. Reduce: Extracts statistical information (like frequency). Users can provide custom logic to classify patterns, often replacing expensive general isomorphism tests with simple edge counts.
  3. Filter: Removes embeddings that are no longer of interest (e.g., infrequent patterns in mining).

Key Technical Innovations:

  • GPU Abstractions: Pangolin is the first GPM system to provide high-level abstractions specifically for GPUs, handling the complexities of GPU memory management and thread synchronization.
  • Structure of Arrays (SoA): Instead of storing subgraphs as a list of objects (Array of Structures), Pangolin uses an SoA layout. This ensures that when the GPU accesses vertex IDs, the memory requests are "coalesced," significantly boosting bandwidth.
  • Inspection-Execution: To handle the unpredictable memory needs of GPM without slow global locks, Pangolin uses a two-pass approach. It first "inspects" how much memory each thread needs, performs a parallel prefix sum to allocate a giant block, and then "executes" the actual writing.
  • Adaptive Pruning: It supports techniques like DAG Orientation (converting undirected graphs to directed acyclic graphs) to eliminate redundant search paths by construction.

Datasets

The system was evaluated on a diverse set of real-world graphs:

  • Small/Medium: Mico (collaboration), Patents, Youtube, ProteinDB.
  • Large: LiveJournal, Orkut, Twitter.
  • Massive: Gsh-2015, a web-crawl graph with 988 million vertices and 51.3 billion edges. This is used to demonstrate the system's scalability.

Key Insights and Ideas

  • The "Generality Tax" is too high: The authors argue that the reason previous frameworks were slow wasn't just bad code, but a lack of "hooks" for application-specific optimizations. By exposing the "Extend" and "Reduce" phases, Pangolin lets developers inject "aha" optimizations (like: "I know a 4-clique must contain a 3-clique, so stop looking elsewhere").
  • BFS vs. DFS: While many hand-optimized solvers use Depth-First Search (DFS) to save memory, Pangolin uses Breadth-First Search (BFS). While BFS uses more memory, it provides much better parallelism and load balancing, which is critical for saturating a GPU.
  • Isomorphism Eliding: For many common patterns (like 3-vertex motifs), you don't actually need a complex graph isomorphism algorithm. Pangolin allows users to replace these tests with simple property checks (e.g., counting edges), providing a massive speed boost.

Key Results

  • CPU Performance: On a 28-core CPU, Pangolin outperformed Arabesque by 49x, RStream by 88x, and Fractal by 80x on average.
  • GPU Acceleration: Moving from a 28-core CPU to an NVIDIA V100 GPU provided an additional 15x speedup on average.
  • Record-Breaking Scale: Pangolin successfully mined 4-cliques on the 51-billion-edge Gsh graph in approximately 6.5 hours. To the authors' knowledge, this is the largest graph ever subjected to 4-clique mining.
  • Efficiency: Despite being a general framework, Pangolin's performance is competitive with (and sometimes faster than) state-of-the-art hand-optimized solvers like KClist and PGD.

Limitations and Future Work

  • GPU Memory Bottleneck: While Pangolin is fast on GPUs, the limited on-board memory of GPUs (e.g., 16-32GB) means it cannot handle the most complex Frequent Subgraph Mining (FSM) tasks on massive graphs without falling back to the CPU.
  • BFS Memory Usage: The BFS approach, while great for speed, can lead to memory exhaustion on very deep patterns. The authors suggest exploring hybrid BFS/DFS strategies in the future.
  • Pattern Support: The current implementation focuses on connected patterns; extending this to disconnected patterns or more complex labeled graph constraints is a potential area for growth.

Summary updated

BibTeX
@article{chen2020pangolin,
  author = {Xuhao Chen and Roshan Dathathri and Gurbinder Gill and Keshav Pingali},
  title = {{Pangolin: An Efficient and Flexible Graph Mining System on CPU and GPU}},
  journal = {Proc. VLDB Endow.},
  year = {2020},
  doi = {10.14778/3389133.3389137},
}
Figure