We identify three major families of graph layers, each suffering from memory bottlenecks in different ways:
- Convolutional layers which can be represented as Sparse-Dense Matrix Multiplication (SpMM), like Graph Convolutional Networks or Mean-Aggregation;
- Aggregation layers (such as min/max pooling);
- Attention-based layers, including GATv2 and Graph Transformers.
For attention-based architectures, we introduce IO-aware kernels inspired by FlashAttention. Intermediate edge-level attention values are never materialized in slow global memory. Instead, they are computed and consumed on the fly using an online softmax algorithm directly in SRAM. During the backward pass, attention weights are recomputed from compact statistics rather than stored explicitly, following ideas introduced in FlashAttention-2. We also propose a block-sparse graph representation that enables the use of tensor cores, providing the largest gains on locally dense graphs.
For aggregation layers, the key challenge comes from the heavy-tailed degree distribution commonly observed in real-world graphs. A small number of high-degree nodes can dominate execution time and limit parallelism. To address this, we introduce degree-aware tiling and additional parallelization strategies specifically designed for such nodes.
Interestingly, we find that for graph convolution layers, modern NVIDIA implementations combined with effective caching strategies already outperform many specialized alternatives. This suggests that custom kernels are not always necessary — a point that has often been overlooked in previous work.
Across a wide range of datasets and architectures, our implementations deliver up to 8.5× speedups while reducing peak memory consumption by more than an order of magnitude in some configurations. Importantly, we release all kernels as drop-in replacements for popular GNN frameworks, allowing practitioners to benefit from these improvements without rewriting existing models.