Abstract
Graph Neural Networks (GNNs) operate at the intersection of sparse graph structures and dense neural network embeddings. Current GNN frameworks typically employ "input-oblivious" execution paths, leading to suboptimal performance across diverse datasets. We introduce SENSEi, an input-sensitive compiler that automatically re-associates matrix operations to find the most efficient execution path for specific graph and hardware configurations. SENSEi utilizes an offline stage to generate semantically equivalent association trees and an online stage to select the optimal path using lightweight cost models. Our evaluation shows that SENSEi achieves speedups of up to 16x on GPUs and 26x on CPUs across popular models like GCN and GAT.
Introduction
The performance of GNNs is heavily influenced by the interplay between sparse graph data and dense feature vectors. Existing frameworks like DGL and PyG often use hard-coded execution orders—for instance, always performing feature transformation before neighbor aggregation. However, the optimal order is highly dependent on input characteristics: a massive sparse graph with small features requires a different strategy than a dense graph with large features. This "one-size-fits-all" approach results in inconsistent performance. SENSEi addresses this by making the execution pipeline sensitive to the input graph's structure, embedding sizes, and the underlying hardware.
SENSEi Architecture
SENSEi employs a two-stage approach to optimize GNN execution:
- Offline Compilation: The system translates GNN code into a tree-based Matrix Intermediate Representation (IR). It explores the mathematical property of associativity to generate all semantically equivalent operation orders (Association Trees). Rule-based pruning is applied to eliminate mathematically inefficient candidates.
- Online Runtime: At execution time, SENSEi extracts key features from the input graph (e.g., node/edge counts, density). It then uses XGBoost-based cost models to predict the execution time of various primitives (like SpMM or GEMM) on the target hardware, dynamically selecting the association tree with the lowest predicted cost.
Evaluation and Results
SENSEi was evaluated on a diverse set of graphs, including Reddit, ogbn-products, and specialized graphs from the SuiteSparse collection. The cost models were trained on approximately 8,000 data points to ensure robustness across various matrix shapes.
The system demonstrated significant performance improvements over default implementations:
- GCN: Achieved speedups up to 2.01x on GPUs and 1.85x on CPUs.
- GAT: Showed dramatic improvements, with speedups reaching 16.27x on CPUs for inference and up to 26.85x for training.
- Overhead: The runtime decision-making process is highly efficient, typically accounting for less than 5% of a single GNN iteration.
Conclusion
SENSEi demonstrates that input sensitivity is crucial for GNN acceleration. By decoupling the mathematical definition of a GNN from its execution order, SENSEi allows for dynamic optimization that adapts to the specific characteristics of the data and hardware. Future work includes expanding the system to handle more complex user-defined functions and exploring global optimizations across multiple network layers.
Summary updated