Abstract
In recent years, Graph Neural Networks (GNNs) have ignited a surge of innovation, significantly enhancing the processing of geometric data structures such as graphs, point clouds, and meshes. As the domain continues to evolve, a series of frameworks and libraries are being developed to push GNN efficiency to new heights. While graph-centric libraries have achieved success in the past, the advent of efficient tensor compilers has highlighted the urgent need for tensor-centric libraries. Yet, efficient tensor-centric frameworks for GNNs remain scarce due to unique challenges and limitations encountered when implementing segment reduction in GNN contexts. We introduce GeoT, a cutting-edge tensor-centric library designed specifically for GNNs via efficient segment reduction. GeoT debuts innovative parallel algorithms that not only introduce new design principles but also expand the available design space. Importantly, GeoT is engineered for straightforward fusion within a computation graph, ensuring compatibility with contemporary tensor-centric machine learning frameworks and compilers. Setting a new performance benchmark, GeoT marks a considerable advancement by showcasing an average operator speedup of 1.80x and an end-to-end speedup of 1.68x.
Introduction: The Challenge of Segment Reduction
In the world of GNNs, the "aggregation" step—where a node gathers information from its neighbors—is a massive performance hurdle. In tensor-centric frameworks like PyTorch, this is implemented as segment reduction.
While graph-centric libraries have existed for years, the industry is shifting toward "tensor-centric" designs to better integrate with modern compilers (like TVM or Triton). However, existing segment reduction implementations suffer from three main issues:
- Under-exploited Design Space: They don't fully utilize GPU hardware features like memory coalescing and warp-level primitives for variable-length inputs.
- Static Heuristics: Most libraries use "one-size-fits-all" settings, leading to sub-optimal performance when graph density or embedding sizes change.
- Fusion Friction: Combining the "message" and "aggregation" steps into a single operation (fusion) usually requires specific, rigid sparse formats (like CSR), which limits flexibility.
Methods: The GeoT Approach
GeoT introduces a "Geometric Tensor" approach centered on three technical pillars:
- Tunable Hierarchical Tiling: Instead of standard thread mapping, GeoT uses a two-level tiling system. It partitions data into Blocks and then into Thread Groups (flexible clusters of threads, e.g., 8, 16, or 32). This allows the library to fine-tune how many threads work on a single segment versus how many work across different feature dimensions.
- Complete Reduction Space (SR & PR): The library supports both Sequential Reduction (SR), where one thread handles a segment, and Parallel Reduction (PR), which uses GPU "shuffle" instructions to aggregate data across multiple threads simultaneously.
- Data-Aware Decision Tree: To solve the tuning problem, the authors trained a multi-output decision tree. At runtime, this tree looks at simple features (like the average number of neighbors and the feature vector size) and picks the optimal kernel configuration in nanoseconds.
- Format-Agnostic Fusion: GeoT provides a fused operator (
index_segment_reduce) that merges indexing and reduction without requiring the user to convert their data into complex sparse formats.
Evaluation and Datasets
The authors evaluated GeoT using a diverse set of standard GNN benchmarks:
- Small/Medium Graphs: Citeseer, Cora, PPI, Pubmed, Amazon-Photo.
- Large Graphs: Flickr, Ogbn-Arxiv, Ogbl-Collab, Reddit2.
- Synthetic Expansion: To train the decision tree, they took 51 raw datasets and applied "noising and scaling" to generate 3,060 augmented datasets, ensuring the auto-tuner could handle a wide variety of graph topologies.
Key Insights
- The "Thread Group" Advantage: Moving away from the rigid 32-thread "warp" model to flexible "thread groups" is crucial for graphs. Because neighbor counts vary wildly, being able to assign, say, exactly 8 threads to a node's aggregation prevents hardware idling.
- Feature Size Matters: A key discovery was that Parallel Reduction (PR) is superior for very small feature sizes ($F \le 4$), but Sequential Reduction (SR) wins as $F$ grows because it avoids the memory bandwidth bottlenecks associated with non-coalesced atomic updates.
- Zero-Overhead Intelligence: By using a decision tree instead of a deep learning model for auto-tuning, the library gains "intelligence" with virtually zero runtime cost. The logic compiles down to simple
if-elsestatements.
Performance Results
- Operator Speedup: GeoT achieved a 1.80x average speedup for Sparse Matrix-Matrix Multiplication (SpMM) compared to PyTorch Geometric’s implementation.
- End-to-End Performance: For full GNN models (GCN, GIN, GraphSAGE), GeoT provided an average speedup of 1.68x, with peaks reaching 3.56x on specific datasets.
- Memory Efficiency: The fused kernels reduced the time spent on SpMM operations by an average of 39.1%, significantly lowering the DRAM traffic.
- Portability: The library demonstrated consistent gains across different generations of hardware, including the NVIDIA A100, H100, and RTX 3090Ti.
Limitations and Future Work
- Atomic Bottlenecks: For extremely large feature sizes ($F > 100$), the performance gains diminish because the GPU's atomic memory units become a physical bottleneck that software tiling cannot fully overcome.
- Inference Focus: The current work focuses primarily on inference. Adding
autogradsupport for training is a priority for future versions. - Hardware-Specific Tuning: While portable, the decision tree rules were specifically trained on A100 data. To get absolute peak performance on a new architecture (like H100), a new performance database would need to be generated and the tree re-trained.
Summary updated