TL;DR
This paper introduces the first FPGA-based algorithm for approximating maximum matchings in large graphs, achieving significant speedups and energy efficiency compared to CPU-based methods. By employing a novel "substream-centric" approach, it effectively leverages FPGA parallelism while minimizing data transfer bottlenecks.
What Problem Does This Paper Address?
Analyzing large graphs is crucial in many fields, from social network analysis to computational biology. A fundamental problem in graph analysis is finding maximum matchings, which are sets of edges with no shared vertices. While exact maximum matching is computationally expensive, approximate solutions are often sufficient and more practical. However, processing massive graphs (trillions of edges) presents challenges: high memory requirements, power consumption, and the need for efficient algorithms. Existing graph processing paradigms, like vertex-centric approaches, often incur substantial communication costs, making them less suitable for hardware accelerators like FPGAs. This paper aims to bridge this gap by developing a high-performance, energy-efficient, and accurate maximum matching algorithm specifically designed for FPGAs.
Methods
The core innovation is the substream-centric approach. Instead of processing the entire graph at once or using traditional vertex-centric methods, the input stream of edges is divided into smaller substreams. These substreams are then processed independently and in parallel on the FPGA. This strategy significantly reduces communication overhead by processing data locally.
Key techniques include:
- Streaming Graph Algorithms: The approach is grounded in the theory of streaming graph algorithms, particularly the semi-streaming model, which assumes edges are processed sequentially with limited memory.
- Substream Division: The input edge stream is partitioned based on edge weights into $L$ substreams. Each substream is designed to form a maximum cardinality matching (MCM).
- Parallel MCM Computation: The $L$ MCMs are computed in parallel on the FPGA.
- Greedy Merging: The final approximate maximum weighted matching (MWM) is obtained by greedily merging the $L$ MCMs on the CPU. This offloads the less parallelizable part to the CPU for better performance.
- Blocking Optimization: To further reduce data transfer latency and improve performance, adjacent rows of the adjacency matrix are merged into "epochs." This allows for more efficient data loading and processing.
- Lexicographic Ordering: Edges within an epoch are ordered lexicographically to ensure consistent processing and facilitate the merging process.
- Hardware Design: The FPGA implementation utilizes a pipelined architecture with dedicated modules for edge reception, processing, matching bit management, and output writing, all orchestrated by a state controller.
Datasets
The paper evaluates its approach using:
- Synthetic Power-Law Kronecker Graphs: These graphs are generated with varying sizes (up to $n=2^{21}$ vertices and $m \approx 48n$ edges) to test scalability.
- Real-World Graphs: Datasets from KONECT and SNAP repositories are used, including social networks (Gowalla, Flickr, LiveJournal1, Orkut), hyperlink graphs (Stanford, Berkeley), and citation graphs (arXiv hep-th). For unweighted graphs, weights were assigned uniformly at random.
Key Insights and Ideas
- Substream-Centricity is Key: The paper demonstrates that breaking down graph processing into parallel substreams is a highly effective strategy for FPGAs, overcoming the communication bottlenecks of other paradigms.
- FPGA for Parallelism, CPU for Merging: The hybrid CPU-FPGA approach is optimal because FPGAs excel at parallel, repetitive tasks (MCM computation), while CPUs are better suited for sequential, less parallelizable tasks (final merging).
- Blocking Reduces DRAM Bottlenecks: The "blocking" optimization significantly reduces the number of DRAM transfers by processing data in larger epochs, leading to substantial performance gains.
- Lexicographic Ordering Enables Efficient Merging: A well-defined ordering of edges is crucial for the efficient merging of substreams and for managing data dependencies.
- FPGA Offers Significant Energy Savings: The FPGA implementation achieves dramatic energy reductions (up to 88%) compared to tuned CPU variants, making it ideal for power-constrained applications.
Key Results
- Speedup: The proposed SC-OPT (Substream-Centric Optimized) FPGA+CPU implementation achieves speedups of up to 2× over the best CPU implementations and up to 55× faster than a sequential CPU baseline. For synthetic graphs, it reaches ≈140M edges/s, outperforming CPU targets.
- Energy Efficiency: The FPGA design consumes at least 88% less energy than a tuned CPU variant.
- Resource Utilization: The FPGA implementation uses a modest amount of resources, with 21% of Arria-10's BRAM and 32% of ALMs for a design that significantly outperforms other targets.
- Accuracy: The algorithm provides a (4 + ɛ)-approximation to the maximum weighted matching, with empirical results showing accuracy comparable to CPU methods.
Limitations and Future Work
- Complexity of SC-OPT: The paper notes that the SC-OPT design is complex, limiting its ability to run at higher clock frequencies (e.g., 400MHz). The authors suggest future work on optimizing BRAM signal propagation and pipelined reset mechanisms.
- Generalization: While the substream-centric approach is promising, the paper suggests that it could be extended to other streaming graph algorithms beyond maximum matching.
- Parameter Tuning: The performance is influenced by parameters like $L$ (number of substreams) and $K$ (block size). Further exploration of optimal parameter settings for diverse graph types could be beneficial.
- Other Matching Schemes: The authors acknowledge that other matching algorithms might be suitable for FPGA implementation and leave this as future work.
Summary updated