DistGNN: scalable distributed training for large-scale graph neural networks

Vasimuddin Md, Sanchit Misra, Guixiang Ma, Ramanarayan Mohanty, Evangelos Georganas, Alexander Heinecke, Dhiraj D. Kalamkar, Nesreen K. Ahmed, Sasikanth Avancha · DOI

TL;DR

This paper introduces DistGNN, a system for efficiently training large-scale Graph Neural Networks (GNNs) on distributed CPU clusters. DistGNN significantly speeds up training by optimizing GNN operations for shared-memory CPUs, employing efficient graph partitioning, and introducing novel communication-avoiding algorithms, achieving up to 97x speedup on 128 CPU sockets.

What Problem Does This Paper Address?

Graph Neural Networks (GNNs) are powerful tools for learning from graph-structured data, finding applications in social networks, biology, and more. However, training GNNs on massive graphs (hundreds of millions of nodes and edges) is computationally challenging. This is due to:

  • High Memory Requirements: Large graphs demand substantial memory capacity, often exceeding what a single machine can provide.
  • Bandwidth Bottlenecks: Moving vertex features and gradients across nodes or even within a single node can become a bottleneck.
  • Communication Overhead: Distributed training inherently involves communication between nodes, which can be costly and slow down training.

While mini-batch training (sampling a small part of the graph for each training step) is a common workaround for memory limitations, it can sometimes lead to reduced accuracy. Full-batch training, which uses the entire graph, offers better accuracy but faces significant scaling challenges. Existing GNN libraries like DGL, while flexible, are not optimized for efficient full-batch training on distributed CPU systems.

Methods

DistGNN tackles these challenges through a multi-pronged approach:

  • Optimized Single-Socket Performance:
    • Architecture-Aware Aggregation Primitive: The core GNN aggregation operation (combining neighbor information) is re-implemented as a highly optimized SpMM (Sparse Matrix-Matrix Multiplication) kernel. This involves techniques like cache blocking, dynamic thread scheduling, and leveraging the LIBXSMM library for efficient loop reordering and vectorization.
  • Delayed Update Algorithms: To reduce communication, DistGNN introduces delayed update strategies. These algorithms allow parts of the computation to proceed with slightly stale data, overlapping communication with computation across epochs.
  • Scalable Distributed Training:
    • Vertex-Cut Graph Partitioning: The input graph is partitioned using a vertex-cut approach (specifically, using the Libra tool). This method distributes edges among partitions while allowing vertices to be split across multiple partitions. This aims to balance the workload and minimize communication between partitions.
  • Communication Avoidance Strategies: Three distributed algorithms are proposed:
  • 0c: This algorithm completely avoids communication by only using locally aggregated information, serving as an upper bound for performance.
  • cd-0: This algorithm performs full communication, synchronizing all partial aggregates, and is expected to achieve the same accuracy as single-socket training, serving as a lower bound for performance.
  • cd-r: This is the novel communication-avoiding algorithm. It overlaps remote aggregate communication with local computation by introducing a delay (r) in when partial aggregates are communicated and processed. This significantly reduces the impact of communication overhead.

Datasets

The paper evaluates DistGNN on five benchmark datasets:

  • AM: A dataset containing information about artifacts.
  • Reddit: A social network dataset.
  • OGBN-Products: A dataset from the Open Graph Benchmark for product classification.
  • Proteins: A dataset related to protein-protein interactions.
  • OGBN-Papers: A large dataset from the Open Graph Benchmark for paper citation prediction, containing over 111 million vertices and 1.6 billion edges.

Key Insights and Ideas

  • Aggregation is the Bottleneck: The paper strongly emphasizes that the aggregation primitive is the dominant factor in GNN training runtime, justifying the focus on optimizing it.
  • Communication Avoidance is Crucial for Scaling: Simply distributing the graph isn't enough; actively minimizing and overlapping communication is key to achieving significant speedups on large-scale distributed systems.
  • Delayed Updates Offer a Sweet Spot: The cd-r algorithm demonstrates that a controlled delay in communication can drastically improve performance without a substantial loss in accuracy, often staying within 1% of single-socket accuracy.
  • Graph Partitioning Matters: The quality of graph partitioning (specifically, the replication factor of split vertices) significantly impacts scalability. Denser graphs like Reddit show more challenges in partitioning compared to sparser ones like Proteins.
  • CPU Optimization is Viable: The work shows that with careful architecture-aware optimizations, distributed GNN training on CPU clusters can be highly competitive and scalable.

Key Results

  • Single-Socket Speedup: DistGNN achieves up to 3.7x speedup on a single CPU socket compared to the baseline DGL implementation.
  • Distributed Speedup: On a 128-socket cluster, DistGNN achieves up to 97x speedup compared to the baseline DGL single-socket performance.
  • Accuracy: The cd-r algorithm (with a delay of r=5 epochs) consistently achieves accuracy within 1% of the single-socket baseline across various datasets. In some cases, it even shows slightly improved accuracy, potentially due to clustering effects from partitioning.
  • Scalability: The cd-r algorithm demonstrates near-linear scaling for datasets with good partitioning properties (like Proteins), while showing sub-linear scaling for denser graphs (like Reddit) due to higher vertex replication.

Limitations and Future Work

  • Accuracy of 0c: The 0c algorithm, while fastest, sometimes shows superior accuracy on OGBN-Products, suggesting that partitioning might induce beneficial clustering. However, its accuracy is not always guaranteed to be as high as other methods.
  • Hyperparameter Tuning for OGBN-Papers: The authors note that further hyperparameter tuning is required for the OGBN-Papers dataset to achieve state-of-the-art accuracy.
  • Future Work:
    • Extend DistGNN to mini-batch training for even larger graphs.
  • Analyze the accuracy of 0c and cd-r on various datasets and GNN architectures.
  • Explore other GNN models beyond GraphSAGE.
  • Investigate the use of low-precision data formats (FP16, BFLOAT16) to further reduce communication volume and improve convergence.

Summary updated

BibTeX
@inproceedings{md2021distgnn,
  author = {Vasimuddin Md and Sanchit Misra and Guixiang Ma and Ramanarayan Mohanty and Evangelos Georganas and Alexander Heinecke and Dhiraj D. Kalamkar and Nesreen K. Ahmed and Sasikanth Avancha},
  title = {{DistGNN: scalable distributed training for large-scale graph neural networks}},
  booktitle = {SC},
  year = {2021},
  doi = {10.1145/3458817.3480856},
}
Figure