gMatch: Fine-Grained and Hardware-Efficient Subgraph Matching on GPUs

Weitian Chen, Shixuan Sun, Cheng Chen, Yongmin Hu, Yingqian Hu, Minyi Guo

TL;DR

gMatch introduces a fine-grained parallel execution model for subgraph matching on GPUs, shifting the primary unit of work from the warp level down to individual threads. By combining this thread-level execution with warp-level batch exploration and a self-sustaining load-balancing strategy, it eliminates the massive memory overhead and thread underutilization common in power-law graph processing. The resulting system is highly scalable, achieving up to a 36× speedup over state-of-the-art methods while completely avoiding out-of-memory errors on massive datasets.

What Problem Does This Paper Address?

Subgraph matching—finding all instances of a small query graph within a larger data graph—is a fundamental but computationally expensive (NP-complete) problem used in social network analysis, fraud detection, and bioinformatics.

Example query graph and data graph

To accelerate this process, modern approaches leverage GPUs using either Breadth-First Search (BFS) or Depth-First Search (DFS) strategies. However, existing GPU solutions rely on a coarse-grained parallel execution model, where an entire warp (a group of 32 threads executing in lockstep) is assigned to expand a single partial match. This design creates two severe bottlenecks when dealing with real-world "power-law" graphs (where a few nodes have millions of connections, but most have very few):

  1. Memory Explosion: To handle highly connected nodes, each warp must pre-allocate a massive execution stack proportional to the maximum degree ($d_{max}$) of the graph. On large benchmarks, this can require gigabytes of memory just for the stacks, leading to Out-of-Memory (OOM) errors.
  2. Thread Underutilization: When a warp processes a node with fewer neighbors than the warp size (32), the majority of the threads sit idle, wasting the GPU's parallel compute power.

Methods

The authors propose gMatch, a hardware-efficient subgraph matching framework that fundamentally rethinks how graph traversal maps to GPU architecture:

  • Fine-Grained Parallel Execution: Instead of treating a partial match expansion as an indivisible warp task, gMatch breaks it down so that each thread handles a single candidate validation task. This slashes the execution stack space complexity per warp from $O(|V(Q)| \times d_{max})$ to just $O(|V(Q)|)$, allowing the stack to fit entirely within fast GPU shared memory.
  • Warp-Level Batch Exploration: To prevent threads from idling when candidate sets are small, gMatch groups multiple partial matches into a single virtual task pool shared by the warp. Threads pull tasks dynamically using lightweight pointers. To keep memory usage minimal, partial matches are reconstructed on-the-fly by traversing the execution stack backwards rather than being fully materialized in memory.
  • Lightweight Load Balancing: Subgraph matching workloads naturally expand exponentially as the search deepens. gMatch exploits this by using a brief initial BFS phase to pre-populate a massive pool of initial tasks (up to a threshold $\tau = 10^6$). Because this initial pool is so large, work is naturally smoothed out across the GPU's processing units, making expensive runtime work-stealing mechanisms mostly unnecessary.

Datasets

The authors evaluated gMatch across 11 diverse real-world and synthetic datasets, split into two distinct workload types:

  1. Large queries on medium-sized, multi-labeled graphs: Enron (en), GitHub (gh), Gowalla (gw), DBLP (db), and WikiTalk (wt).
  2. Small queries on large-scale, unlabeled graphs: Pokec (pk), LiveJournal (lj), Orkut (ot), LDBC (ld), Friendster (fr), and a synthetic RMAT graph (rm) containing up to 2.8 billion edges.

Key Insights and Ideas

  • The Power-Law Mismatch: Coarse-grained parallel models are fundamentally incompatible with power-law graphs on SIMT (Single Instruction, Multiple Threads) architectures. Designing for the worst-case node degree destroys memory scalability, while executing on the average-case node degree destroys thread utilization.
  • On-the-Fly Path Reconstruction: Rather than saving every intermediate partial match state at every level of the search tree—which causes severe memory bloat—storing compact parent pointers in the stack allows paths to be reconstructed efficiently only when needed.
  • Harnessing Exponential Growth for Load Balancing: While the root of a search tree offers very little parallelism, the search space explodes exponentially just a few levels down. Pre-populating the task pool past a high threshold turns a notoriously difficult dynamic scheduling problem into an easily manageable, embarrassingly parallel one.
The search tree of coarse-grained parallel execution

Key Results

  • Robust Scalability: gMatch was the only method capable of completing all query patterns across all 11 datasets without timing out or running out of memory. Baselines like STMatch and T-DFS consistently failed on large graphs like Friendster and LDBC due to memory constraints.
  • Significant Speedups: On large queries, gMatch achieved an average speedup of 36.58× on the Gowalla dataset and 20.23× on the DBLP dataset compared to the state-of-the-art EGSM framework.
  • High Hardware Efficiency: gMatch successfully reduced the thread idle rate to under 5% across all tested datasets, whereas traditional coarse-grained approaches suffered from idle rates as high as 70%.

Limitations and Future Work

  • In-Memory Constraint: gMatch operates entirely in-memory, meaning the data graph itself must fit within the GPU's global memory. While it drastically reduces the execution stack memory footprint, it does not natively support out-of-core or multi-GPU partitioned graph matching for graphs that exceed a single GPU's total VRAM capacity.
  • Comparison to Specialized Mining Systems: While gMatch scales exceptionally well to large queries and massive datasets, specialized graph pattern mining systems (like BEEP or $G^2$Miner) can still outperform it on very small, specific structural patterns on smaller datasets due to their matrix-based neighborhood optimizations.

Summary updated

Abstract

Subgraph matching is a core operation in graph analytics, supporting a broad spectrum of applications from social network analysis to bioinformatics. Recent GPU-based approaches accelerate subgraph matching by leveraging parallelism but rely on a coarse-grained execution model that suffers from scalability and efficiency issues due to high memory overhead and thread underutilization. In this paper, we propose gMatch, a hardware-efficient subgraph matching approach on GPUs. gMatch introduces a fine-grained execution model that reduces memory consumption and enables flexible task scheduling among threads. We further design warp-level batch exploration and lightweight load balancing to improve execution efficiency and scalability. Experiments on diverse workloads and real-world datasets show that gMatch outperforms state-of-the-art subgraph matching methods, including STMatch, T-DFS, and EGSM, in both performance and scalability. We also compare against state-of-the-art systems for mining small patterns, such as BEEP and G$^2$Miner. While these systems achieve better performance on small datasets, gMatch scales to substantially larger queries and datasets, where existing approaches degrade or fail to complete.
BibTeX
@article{chen2026gmatch,
  author = {Weitian Chen and Shixuan Sun and Cheng Chen and Yongmin Hu and Yingqian Hu and Minyi Guo},
  title = {{gMatch: Fine-Grained and Hardware-Efficient Subgraph Matching on GPUs}},
  journal = {Proc. VLDB Endow.},
  year = {2026},
}

Loading related content...

Figure