Graph Neural Networks on large graphs commonly rely on in-memory graph storage with ad hoc data processing pipelines for both training and inference. Graph databases provide scalable storage and efficient traversal for graphs that can evolve over time, but their applicability in GNN training and inference are rarely studied. We show that graph DBs can be used in GNN training and inference directly, executing sampling, feature retrieval, and even the full forward pass. We show different GNN training pipelines can perform on-the-fly sampling and retrieval in graph DBs using Cypher. We further provide optimisations that speed up the training process by ~2.5x while maintaining the same accuracy. We illustrate that fully in-DB inference is possible, independent of how the GNNs are trained. Our inference setup can be >10x faster than cold loading the graph into RAM with no extra memory overhead on real-world graphs. Our work lays the foundation for in-graph-DB GNN training and inference.
Figures & tables
Figure 1. Illustration of computations that happen in the training process and the graph database when processing a batch. Note that the training process can live in the same or different machine to the graph DB.
Cora
CoAuthor
arXiv
products
papers100M
# nodes
2,708
34,493
169,343
2,449,029
111,059,956
# edges
10,556
495,924
1,166,243
61,859,140
1,615,685,872
Avg degree
3.90
14.38
6.89
25.26
14.55
Training nodes
140
20,696
90,941
196,615
1,207,179
Validation nodes
500
3,449
29,799
39,323
125,268
Test nodes
1,000
10,348
48,603
2,213,091
214,338
Table 1. Dataset statistics and training configuration.
Figure 2. Validation accuracy on Cora for GraphSAGE and GraphSAINT sampling implemented in PyG, Cypher and UDP. Each line shows the mean validation accuracy over 10 runs, and the shaded region shows the 95% interval.
Figure 3. ogbn-papers100M , GraphSAGE-sampling. Breakdown of time spent in training. baseline_neo4j represents Cypher implementation. Using UDP drastically reduces both data transfer and sampling execution time. Using UDF speeds up baseline_neo4j by 2̃.5 times. Using pre-aggregation does not provide improvement in latency for the when feature dimension is low in this case.
Figure 4. Per-operator execution-time breakdown of the Cypher GraphSAGE sampler on ogbn-papers100M . Graph traversal ( Expand(All) ) accounts for roughly 14.6 ms, less than the combined cost of Projection and OrderedAggregation , which only build and sort intermediate lists rather than touch the graph.
Figure 5. Database hits vs. rows produced per operator for the GraphSAGE sampling-query on ogbn-papers100M (log-log, y-axis starts at 100). The Expand operator produces over 10,000 rows, well above the necessary 128⋅(1+10+10⋅5)=7808 nodes, for fanout [10, 5] and batch_size=128 , showing that the database fetches raw relationships later discarded during sampling.
Figure 6. GraphSAGE-sampling. Pre-aggregation reduces data sent from the DB to training process between ca. 40% - 60% for Fanout [10, 5] .
Figure 7. CoAuthor Physics . GraphSAGE-sampling. Having the highest feature dimensionality, this dataset benefits most from pre-aggregation, as the added DB-side compute and querying cost is outweighed by lower Network + driver recv time from sending less data.
Figure 8. Benchmark of inference in databases.
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 9. Representing embedding properties as byte[] reduces the time taken by driver by more than half, compared to float64[] format, due to the large reduction in the packstream decode operation in the Bolt client driver.
Figure 10. ogbn-products . Breakdown of time spent in training.
Graph Neural Network (GNN) inference on billion-scale graphs is challenging due to the large memory footprint of features and embeddings and high disk I/O costs in out-of-core settings. Existing distributed GNN systems incur high communication times and infrastructure costs, while disk-based GNN systems are primarily tailored to training and experience massive wasted reads during inference on the entire graph. We present Taurus, a single-machine system for GNN inference on graphs that do not fit in RAM, supporting both exact full-graph inference and fanout-sampled inference. To avoid random and repeated feature gathers, Taurus reformulates layer-wise inference as source-centric broadcasts over sequential SSD scans, backed by a pipelined GPU-CPU-SSD hierarchy, topology-aware reordering, pending-message eviction, and a GPU-resident store for high-degree vertices. It further uses non-buffered sequential reads and GPU-backed writes to reduce page-cache pollution, host-memory pressure, and write overheads. On out-of-core graphs with up to 269M vertices, 4B edges, and 514 GiB of features, Taurus outperforms the strongest layer-wise baseline, DGI, by 7-25×, and vertex-wise baselines by 40-140×.
Pranjal Naman, Yogesh Simmhan
Department of Computational and Data Sciences (CDS), Indian Institute of Science (IISc), Bangalore 560012 India
Full-graph GNN training delivers high accuracy but scales poorly on multi-server clusters due to heavy, irregular inter-node embedding exchanges. We present SNI-GNN, a SmartNIC-assisted full-graph training system that reduces communication while preserving accuracy by predicting remote embeddings in-network. SNI-GNN deploys a lightweight linear-trend predictor on SmartNICs to refine cached historical embeddings, coupled with an importance-based boundary-node sampling policy and an asynchronous DPU--GPU data pipeline with intermediate-result reuse. We provide error and convergence bounds showing that predictor bias remains controlled under bounded second-order dynamics and yields standard non-convex convergence with inexact gradients. Implemented on NVIDIA BlueField-3, SNI-GNN integrates with state-of-the-art full-graph systems, cuts communication by 21--45%, achieves 1.3--3.6× end-to-end speedups over BNS-GCN and up to 1.29× over baseline SANCUS, with accuracy loss ≤0.01, and scales efficiently to 16 GPUs on graphs with up to tens of millions of edges. These results indicate SmartNIC-based in-network prediction is a practical complement to partitioning and compression techniques for communication-efficient full-graph GNN training at scale.
Guofan Yu, Sitian Chen, Zhenheng Tang +2
Hong Kong Baptist University · Hong Kong University of Science and Technology · Hong Kong University of Science and Technology (Guangzhou)
Efficient inference for graph neural networks (GNNs) on large knowledge graphs (KGs) is essential for many real-world applications. GNN inference queries are computationally expensive and vary in complexity, as each involves a different number of target nodes linked to subgraphs of diverse densities and structures. Existing acceleration methods, such as pruning, quantization, and knowledge distillation, instantiate smaller models but do not adapt them to the structure or semantics of individual queries. They also store models as monolithic files that must be fully loaded, and miss the opportunity to retrieve only the neighboring nodes and corresponding model components that are semantically relevant to the target nodes. These limitations lead to excessive data loading and redundant computation on large KGs. This paper presents KG-WISE, a task-driven inference paradigm for large KGs. KG-WISE decomposes trained GNN models into fine-grained components that can be partially loaded based on the structure of the queried subgraph. It employs large language models (LLMs) to generate reusable query templates that extract semantically relevant subgraphs for each task, enabling query-aware and compact model instantiation. We evaluate KG-WISE on six large KGs with up to 42 million nodes and 166 million edges. KG-WISE achieves up to 28x faster inference and 98% lower memory usage than state-of-the-art systems while maintaining or improving accuracy across both commercial and open-weight LLMs.