Dynasparse: Accelerating GNN Inference through Dynamic Sparsity Exploitation

Bingyi Zhang, Viktor K. Prasanna · DOI

Introduction

Graph Neural Networks (GNNs) have emerged as a powerful tool for processing non-Euclidean data, yet their computational demands pose significant challenges for real-time inference. While existing hardware accelerators effectively exploit the static sparsity of the input graph's adjacency matrix, they often overlook two other critical sources of sparsity: vertex feature sparsity and model weight sparsity. Vertex features frequently become sparse during execution (e.g., due to ReLU activations), and modern pruning techniques introduce significant sparsity into model weights.

Dynasparse is a novel hardware-software codesign for FPGAs designed to exploit this multi-dimensional sparsity. By profiling data at runtime and dynamically switching between dense and sparse computation primitives, Dynasparse achieves substantial performance gains over both general-purpose processors and specialized static accelerators.

The Problem: The Limitations of Static Mapping

Traditional GNN accelerators typically employ a static mapping strategy, where specific kernels (such as feature aggregation or vertex updates) are hardcoded to specific hardware primitives (like Sparse-Dense Matrix Multiplication). This approach is suboptimal because the efficiency of a primitive is highly dependent on the instantaneous density of the data. For instance, if a feature matrix is relatively dense, the overhead of managing sparse indices in a sparse primitive can actually make it slower than a standard dense GEMM (General Matrix Multiply). Existing systems lack the flexibility to adapt to these shifting "sweet spots" in sparsity.

System Architecture

Dynasparse addresses these limitations through a synergistic architecture comprising a specialized FPGA accelerator and a dynamic software runtime.

1. Agile Computation Module (ACM)

The ACM is the core hardware unit on the FPGA. Unlike fixed-function units, the ACM is reconfigurable on-the-fly to execute three distinct primitives:

  • GEMM (Dense-Dense): Optimized for high-density matrices using a 2D systolic array.
  • SpDMM (Sparse-Dense): Optimized for scenarios where one matrix is sparse.
  • SPMM (Sparse-Sparse): Optimized for high-sparsity scenarios, utilizing specialized "Scatter-Gather" logic and Index/Data Shuffle Networks.

2. Dynamic Kernel-to-Primitive (K2P) Mapping

The "brain" of the system is the K2P mapping engine, managed by a lightweight soft processor. It profiles the sparsity of incoming data and utilizes an analytical performance model to determine which of the three ACM primitives will provide the lowest latency for the current task. To ensure this decision-making does not become a bottleneck, the system performs mapping for the subsequent task while the accelerator is busy with the current one.

3. Auxiliary Hardware Module (AHM)

To mitigate the "sparsity tax"—the time spent converting data formats and profiling density—the authors implemented dedicated hardware for on-the-fly format transformation (e.g., converting dense arrays to Coordinate/COO format). This ensures that the main computation pipeline remains fed with correctly formatted data without stalling.

Evaluation and Results

The system was implemented on a Xilinx Alveo U250 FPGA and evaluated using four GNN models (GCN, GraphSAGE, GIN, and SGC) across six diverse datasets ranging from small citation networks (Cora) to large-scale graphs (Reddit, NELL).

Performance Highlights:

  • Superior Latency: Dynasparse reduces inference latency by an average of 3.73× compared to static mapping strategies.
  • Cross-Platform Speedup: The system achieves up to a 56.9× speedup over high-end CPUs (AMD Ryzen 3990x) and a 2.37× speedup over flagship GPUs (Nvidia RTX3090) for end-to-end inference.
  • State-of-the-Art Comparison: Compared to leading FPGA-based GNN accelerators like HyGCN and BoostGCN, Dynasparse is 2.7× faster on average.
  • Pruning Synergy: When applied to models with weights pruned to >90% sparsity, Dynasparse's ability to utilize its SPMM mode resulted in a nearly 16× speedup over standard sparse-dense methods.

Conclusion and Future Work

Dynasparse demonstrates that dynamic sparsity exploitation is a critical frontier for GNN acceleration. By decoupling abstract kernels from hardware primitives and providing a flexible, reconfigurable architecture, it overcomes the rigidities of previous designs.

While the current implementation significantly advances FPGA-based GNN processing, the authors identify the initial data partitioning on the host CPU as a remaining bottleneck (accounting for up to 43% of total time in some instances). Future iterations aim to multi-thread the compiler and explore tighter integration via PCIe 5.0 or heterogeneous systems to further reduce communication and preprocessing overhead.

Summary updated

BibTeX
@inproceedings{zhang2023dynasparse,
  author = {Bingyi Zhang and Viktor K. Prasanna},
  title = {{Dynasparse: Accelerating GNN Inference through Dynamic Sparsity Exploitation}},
  booktitle = {IPDPS},
  year = {2023},
  url = {https://openreview.net/forum?id=bg1bRlU2H3},
}
Figure