Efficient GNN Training Through Structure-Aware Randomized Mini-Batching

Vignesh Balaji, Christos Kozyrakis, Gal Chechik, Haggai MaronarXiv 2025 · DOI

Abstract

Training Graph Neural Networks (GNNs) on large-scale graphs presents a significant challenge due to the conflict between the statistical benefits of random mini-batching and the hardware efficiency of structure-aware data access. This paper introduces COMM-RAND (Community-Structure-aware Randomized Mini-batching), a novel approach that balances these competing needs. By incorporating controllable structural bias into the sampling process via two tunable parameters, COMM-RAND achieves up to a 2.76x speedup in training time with negligible impact on model accuracy across various large-scale benchmarks.

1. Introduction: The Performance Dilemma

Graph Neural Networks (GNNs) have become essential for modeling complex relational data, such as social networks and citation graphs. However, the scale of real-world graphs often exceeds GPU memory capacity, necessitating mini-batch training.

Standard mini-batching techniques rely on uniform randomization to ensure that each batch contains a diverse set of nodes. While this diversity is crucial for model convergence and accuracy, it results in irregular memory access patterns. Because the GPU cannot predict which nodes will be required next, it frequently fetches data from slow main memory, creating a significant hardware bottleneck.

Conversely, "graph reordering" techniques group related nodes (communities) together to improve data locality and cache hits. While hardware-efficient, training exclusively on these tight-knit communities deprives the model of a "global view" of the graph, leading to poor generalization and slow convergence. This creates a "performance dilemma": how to maintain hardware locality without sacrificing the statistical diversity necessary for effective learning.

2. The COMM-RAND Framework

To resolve this dilemma, we propose COMM-RAND, which introduces "controllable" structural bias into the GNN training pipeline. The framework allows practitioners to navigate the spectrum between pure randomness and pure community focus using two primary mechanisms:

  1. Biased Root Partitioning ($k$): Instead of shuffling all training nodes individually, COMM-RAND treats detected communities as fundamental blocks. The parameter $k$ allows for "mixing" a specific number of communities into a super-community before shuffling, enabling a tunable balance between global randomness and local structure.
  2. Biased Neighborhood Sampling ($p$): During sub-graph construction for a batch, COMM-RAND uses a probability parameter $p$ to prioritize "intra-community" neighbors (nodes within the same group) over "inter-community" neighbors. This strategy keeps sub-graphs localized in memory, reducing the volume of data fetched from main memory.
Figure 4: Illustration of graph reordering and community partitioning. The original graph (top left) and its random adjacency matrix (bottom left) are transformed into a community-aware structure (top right) resulting in a block-diagonal adjacency matrix (bottom right) that improves hardware locality.

By adjusting $k$ and $p$, COMM-RAND optimizes the Entropy-Locality Trade-off. High label entropy (diversity) ensures fast convergence, while high locality ensures the GPU caches remain utilized, significantly reducing the "working set" size of input features.

3. Experimental Evaluation

The effectiveness of COMM-RAND was evaluated on four large-scale benchmarks: reddit, igb-small, ogbn-products, and the massive ogbn-papers100M (111M nodes, 3.2B edges).

3.1 Performance and Accuracy

COMM-RAND achieved an average total training speedup of 1.8x, with a peak speedup of 2.76x on the largest dataset (ogbn-papers100M). Crucially, this performance gain came with a minimal average accuracy drop of only 0.42% compared to standard random mini-batching.

3.2 Hardware Sensitivity and Scalability

A key finding is that the benefits of COMM-RAND scale with problem size. As the ratio of the graph data to the GPU's L2 cache capacity increases, the relative speedup provided by COMM-RAND's localized access patterns grows. Furthermore, unlike methods like ClusterGCN, which can struggle when training sets are sparse (e.g., only 1% labels), COMM-RAND maintains efficiency by only processing nodes necessary for the current batch.

4. Conclusion and Future Work

COMM-RAND demonstrates that structural bias, when applied controllably, is a powerful tool for optimizing GNN training. By bridging the gap between hardware efficiency and statistical diversity, it enables faster training on massive graphs with standard hardware.

Future research will focus on automating the tuning of the $k$ and $p$ hyperparameters and exploring the impact of different community detection algorithms. While the current implementation uses the fast "Rabbit" reordering algorithm (adding minimal overhead), further optimizing the pre-processing stage could enhance the overall efficiency of the pipeline.

Summary updated

BibTeX
@misc{balaji2025efficient,
  author = {Vignesh Balaji and Christos Kozyrakis and Gal Chechik and Haggai Maron},
  title = {{Efficient GNN Training Through Structure-Aware Randomized Mini-Batching}},
  year = {2025},
  eprint = {2504.18082},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.18082},
}
Figure