FAST: FPGA-based Subgraph Matching on Massive Graphs

Xin Jin, Zhengyi Yang, Xuemin Lin, Shiyu Yang, Lu Qin, You Peng

Abstract

Subgraph matching is a computationally intensive task critical for domains ranging from social network analysis to bioinformatics. However, it faces significant scalability issues on traditional CPU architectures due to its NP-hard nature and irregular memory access patterns. This paper presents FAST, a novel CPU-FPGA co-designed framework that accelerates subgraph matching on massive graphs. By utilizing a partitionable Candidate Search Tree (CST) and a high-throughput hardware pipeline, FAST achieves up to 462x speedup over state-of-the-art CPU algorithms and is the first to successfully process graphs with over a billion edges on a single machine.

Introduction

Finding all instances of a query graph within a larger data graph—known as subgraph matching—is fundamental to modern data science. Despite its utility, the problem is NP-hard and typically relies on backtracking algorithms that scale poorly. On general-purpose CPUs, these algorithms suffer from limited parallelism and poor cache performance due to irregular data access. While FPGAs offer massive parallelism, their limited on-chip memory (BRAM) makes direct implementation of recursive backtracking difficult. FAST overcomes these hurdles by reimagining the search space and the execution model.

System Architecture

FAST addresses these challenges through a hybrid CPU-FPGA architecture. The CPU (host) handles the initial construction and partitioning of the search space, while the FPGA (kernel) performs high-speed matching.

The FAST system architecture showing the interaction between the Host CPU and the FPGA Kernel via PCIe.

The workflow begins with the CPU constructing a Candidate Search Tree (CST) from the data graph and query. The CST is then partitioned into smaller chunks that can fit entirely within the FPGA's fast on-chip BRAM. This "BRAM-only" matching strategy is a cornerstone of the design, reducing memory access latency from the multiple cycles required for external DRAM to a single cycle.

The Candidate Search Tree (CST)

The CST is a novel auxiliary data structure that serves as a complete, self-contained search space for the matching process. Unlike traditional structures that require frequent lookups to the original data graph, the CST encapsulates all necessary connectivity information.

An example of a BFS Tree and its corresponding Candidate Search Tree (CST) structure.

As shown in Figure 3, the CST is built based on a BFS tree of the query graph. Each node in the CST represents a candidate vertex in the data graph for a specific query vertex. By partitioning this tree, FAST ensures that the FPGA can process independent branches of the search space in parallel without needing to access slow external memory during the core matching phase.

Hardware Pipeline and Optimizations

The FPGA implementation features a three-stage streaming pipeline designed for high throughput:

  1. Generator: Expands partial results by identifying candidate matches for the next query vertex.
  2. Validator: Performs parallel "Visited Validation" (to ensure vertex uniqueness) and "Edge Validation" (to verify connectivity).
  3. Synchronizer: Collects, buffers, and streams out the final valid results.

To maximize throughput, FAST employs task parallelism to overlap these stages and separates task generators to prevent bottlenecks. This approach reimagines backtracking as a non-recursive, high-throughput stream of partial results flowing through hardware units simultaneously.

Performance Evaluation

The framework was evaluated using the industry-standard LDBC Social Network Benchmark. FAST demonstrated exceptional performance, outperforming state-of-the-art CPU algorithms like DAF and CECI by up to 462x and 150x, respectively. Notably, FAST was the only solution capable of handling the DG60 dataset—a massive graph with 1.25 billion edges—on a single machine, whereas other algorithms either timed out or ran out of memory (OOM).

Conclusion

FAST represents a significant leap in subgraph matching performance by effectively combining CPU flexibility with FPGA parallelism. Its BRAM-centric design and streaming pipeline overcome the traditional memory and complexity bottlenecks of graph processing. Future work includes scaling FAST to multi-FPGA environments and integrating it into mainstream graph database engines to bring these hardware-level speedups to end-users.

Summary updated

BibTeX
@inproceedings{jin2021fast,
  author = {Xin Jin and Zhengyi Yang and Xuemin Lin and Shiyu Yang and Lu Qin and You Peng},
  title = {{FAST: FPGA-based Subgraph Matching on Massive Graphs}},
  booktitle = {ICDE},
  year = {2021},
  url = {https://openreview.net/forum?id=1iRG4P36wVU},
}
Figure