GNNFlow: A Distributed Framework for Continuous Temporal GNN Learning on Dynamic Graphs

Yuchen Zhong, Guangming Sheng, Tianzuo Qin, Minjie Wang, Quan Gan, Chuan WuarXiv 2023 · DOI

Abstract

GNNFlow is a distributed framework designed for "continuous learning" on dynamic, streaming graphs where new nodes and edges arrive constantly. By replacing slow, static graph structures with an adaptive block-based data structure and a specialized dynamic GPU cache, GNNFlow achieves up to a 21.1x speedup over existing systems and can scale to massive graphs with over 5 billion edges.

Introduction: The Challenge of Dynamic Graphs

Most Graph Neural Network (GNN) frameworks, such as DGL or PyG, are optimized for static graphs using formats like Compressed Sparse Row (CSR). While efficient for lookups, CSR is ill-suited for updates; adding a single edge often necessitates rebuilding the entire structure from scratch. In real-world applications like social networks or e-commerce, data arrives as a continuous stream. Training Temporal GNNs on these streams introduces significant overheads: graph rebuilding, computationally expensive k-hop temporal sampling, and memory limitations for massive graphs.

Execution time breakdown for various GNN models, highlighting the dominance of sampling and feature fetching.

As illustrated in Figure 2, sampling and feature fetching constitute the vast majority of the total execution time across various temporal GNN models, often dwarfing the actual computation time. GNNFlow is designed specifically to mitigate these bottlenecks.

GNNFlow System Architecture

GNNFlow reimagines the system stack for dynamic graphs through several key innovations focused on data movement and storage efficiency:

  • Adaptive Block-Based Storage: Instead of a static array, GNNFlow utilizes a time-indexed block-based adjacency list. This structure balances memory efficiency with update speed by grouping edges into blocks tailored to node degrees (e.g., larger blocks for "hub" nodes).
  • Hybrid GPU-CPU Placement: To accelerate sampling, lightweight metadata (node tables and block pointers) is kept on the GPU, while heavy edge data remains in host memory. This allows the GPU to navigate the graph structure without excessive CPU communication.
  • Vectorized Dynamic Cache: Feature fetching is a major bottleneck because edge features can account for 62% to 99% of data transmission. GNNFlow implements a dynamic GPU cache for node and edge features, featuring a "reuse and restoration" strategy to avoid "cold start" delays between training rounds.
  • Online Hash Partitioning: For distributed training, simple hash-based partitioning is used to avoid the high costs of complex re-partitioning algorithms like METIS on streaming data.
Overview of the GNNFlow distributed framework architecture, showing the flow from streaming data to GPU-accelerated training.

Evaluation and Key Results

The framework was evaluated on large-scale datasets including Reddit, Netflix (100M edges), GDELT (191M edges), MAG (1.3B edges), and a synthetic LDBC graph with 5.1B edges.

Performance and Scaling

GNNFlow demonstrates massive speedups, outperforming TGL (the previous state-of-the-art) by 9.4x to 21.1x on the GDELT dataset. On the Netflix graph, it can process a day's worth of updates and retrain the model in approximately 30 seconds, whereas previous systems took several minutes. Furthermore, it successfully scales to 5 billion edges across 8 machines, a feat beyond the reach of most existing dynamic frameworks.

Insights into Data Distribution

The authors observed that while node access follows a power-law distribution, edge access follows an exponential distribution. This insight led to the design of a specialized vectorized LRU/LFU cache. Additionally, the efficiency of GNNFlow allows for more frequent retraining—potentially on every batch—which was shown to improve model accuracy by up to 9%.

Conclusion

GNNFlow addresses the "rebuild trap" of static graph formats and the sampling bottlenecks inherent in temporal GNNs. By optimizing the storage and caching layers for the unique characteristics of dynamic edge data, it enables real-time continuous learning on a global scale. While hash partitioning is currently used for speed, future work may explore more sophisticated partitioning to further minimize network communication.

Summary updated

BibTeX
@misc{zhong2023gnnflow,
  author = {Yuchen Zhong and Guangming Sheng and Tianzuo Qin and Minjie Wang and Quan Gan and Chuan Wu},
  title = {{GNNFlow: A Distributed Framework for Continuous Temporal GNN Learning on Dynamic Graphs}},
  year = {2023},
  eprint = {2311.17410},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.17410},
}
Figure