Towards Efficient Large-Scale Graph Neural Network Computing

Lingxiao Ma, Zhi Yang, Youshan Miao, Jilong Xue, Ming Wu, Lidong Zhou, Yafei DaiarXiv 2018 · OpenReview

Abstract

Recent deep learning models have moved beyond low-dimensional regular grids such as image, video, and speech, to high-dimensional graph-structured data, such as social networks, brain connections, and knowledge graphs. This evolution has led to large graph-based irregular and sparse models that go beyond what existing deep learning frameworks are designed for. Further, these models are not easily amenable to efficient, at scale, acceleration on parallel hardwares (e.g. GPUs). We introduce NGra, the first parallel processing framework for graph-based deep neural networks (GNNs). NGra presents a new SAGA-NN model for expressing deep neural networks as vertex programs with each layer in well-defined (Scatter, ApplyEdge, Gather, ApplyVertex) graph operation stages. This model not only allows GNNs to be expressed intuitively, but also facilitates the mapping to an efficient dataflow representation. NGra addresses the scalability challenge transparently through automatic graph partitioning and chunk-based stream processing out of GPU core or over multiple GPUs, which carefully considers data locality, data movement, and overlapping of parallel processing and data movement. NGra further achieves efficiency through highly optimized Scatter/Gather operators on GPUs despite its sparsity. Our evaluation shows that NGra scales to large real graphs that none of the existing frameworks can handle directly, while achieving up to about 4 times speedup even at small scales over the multiple-baseline design on TensorFlow.

Introduction

Graph Neural Networks (GNNs) have emerged as a powerful tool for analyzing non-Euclidean data structures like social networks and knowledge graphs. However, scaling GNNs presents a unique challenge. Traditional graph processing engines are adept at handling irregular structures but lack the tensor computation capabilities required for deep learning. Conversely, deep learning frameworks like TensorFlow or PyTorch are optimized for dense, regular grids and often struggle with the extreme sparsity and massive scale of real-world graphs. When a graph exceeds the memory capacity of a single GPU, these frameworks typically suffer from severe performance degradation or failure.

NGra addresses these issues by providing a system that is both graph-aware and hardware-efficient, enabling the processing of massive datasets that were previously inaccessible to standard deep learning pipelines.

The SAGA-NN Programming Model

A core contribution of NGra is the SAGA-NN model. This abstraction decomposes a GNN layer into four distinct, well-defined stages:

  • Scatter: Distributes vertex features to incident edges.
  • ApplyEdge: Performs computations on edge-level data.
  • Gather: Aggregates edge-level information back to the vertices.
  • ApplyVertex: Updates vertex states based on aggregated information.
The SAGA-NN model decomposes a GNN layer into Scatter, ApplyEdge, Gather, and ApplyVertex stages.

By formalizing GNNs through this model, NGra can automatically derive the necessary backward pass for training and optimize the underlying dataflow. This vertex-centric approach also allows for significant computational savings; for instance, redundant edge-level operations can be automatically hoisted to the vertex stage.

Scalable Execution and Streaming

To handle graphs that exceed GPU memory, NGra employs a 2D Graph Partitioning strategy. The adjacency matrix is divided into "chunks" or tiles, which are then streamed into the GPU for processing.

2D graph partitioning and chunk-based streaming dataflow in NGra.

This chunk-based streaming engine treats the graph as a continuous data stream rather than a static object in memory. By carefully scheduling these chunks, NGra can overlap data movement (from host to device) with computation, effectively hiding the latency of PCIe transfers. For multi-GPU setups, NGra utilizes a ring-based topology to pass data chunks directly between cards, avoiding CPU bottlenecks and achieving near-linear speedup.

Implementation and Optimization

NGra further enhances efficiency through custom-designed kernels. While standard libraries like cuSPARSE are designed for general sparse matrix operations, NGra's kernels are specifically tuned for the dense feature vectors typical of GNNs. These optimized Scatter and Gather operators achieve up to 6.3x speedup over generic implementations.

Experimental Evaluation

The framework was evaluated using a variety of datasets, ranging from small citation networks (Pubmed) to massive real-world graphs like Reddit-Full (2.2M vertices, 571M edges) and enwiki (3.2M vertices, 222M edges).

Key results include:

  • Performance: NGra is up to 4x faster than TensorFlow on graphs that fit in memory.
  • Scalability: It successfully processed massive graphs that caused standard frameworks to crash.
  • Multi-GPU Efficiency: Moving from 1 to 2 GPUs yielded a 1.93x speedup, demonstrating the effectiveness of the ring-based streaming architecture.
  • Kernel Gains: Custom kernels outperformed cuSPARSE by 1.6x to 6.3x across various graph densities.

Conclusion and Future Work

NGra represents a significant step toward making large-scale GNN training practical. By bridging the gap between graph processing and deep learning frameworks, it enables researchers to work with datasets of unprecedented size.

Future work includes addressing NUMA-related memory bottlenecks more automatically and extending the framework to support dynamic graphs where connections evolve over time. Additionally, exploring distributed execution across multiple server nodes remains an open area for scaling beyond single-server multi-GPU configurations.

Summary updated

BibTeX
@misc{ma2018towards,
  author = {Lingxiao Ma and Zhi Yang and Youshan Miao and Jilong Xue and Ming Wu and Lidong Zhou and Yafei Dai},
  title = {{Towards Efficient Large-Scale Graph Neural Network Computing}},
  year = {2018},
  eprint = {1810.08403},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1810.08403},
}
Figure