PyTorch implementation of optimizing the GNN inference for dynamic graphs via incremental computing. InkStream is able to reduce the inference time to milliseconds for dynamic graphs evolving with minor changes each time.
InkStream: Instantaneous GNN Inference on Dynamic Graphs via Incremental Update
Dan Wu*, Zhaoying Li*, Tulika Mitra*
*National University of Singapore
- Create docker container with conda environments:
baseline
andinkstream
.cd docker docker build -t inkstream_image . docker run --name inkstream_container --gpus all --shm-size=32g -it inkstream_image
- Run InkStream:
python inkstream_<gcn/sage/gin>.py --dataset <cora/PubMed/yelp/reddit/products/papers> --model <GCN/SAGE/GIN> --save_int --aggr <min/max/mean/sum> --perbatch <number of changed edges> --stream <mix/add/delete>
e.g., python inkstream_gcn.py --dataset cora --model GCN --save_int --aggr min --perbatch 100 --stream mix
Note:
Inkstream can only be executed in inkstream
conda environment inside the docker, as we made modifications to the torch_geometric library. Baseline methods should be executed in baseline
conda environment.
- Run baseline (k-hop):
conda activate baseline python timing_original.py --dataset cora --model GCN --aggr min --perbatch 100 --stream mix --range affected
If you find this project useful in your research, please cite our paper:
@article{wu2023inkstream,
title={InkStream: Instantaneous GNN Inference on Dynamic Graphs via Incremental Update},
author={Wu, Dan and Li, Zhaoying and Mitra, Tulika},
journal={arXiv preprint arXiv:2309.11071},
year={2023}
}