- Cite this project and paper.
@inproceedings{TC-GNN,
title={TC-GNN: Accelerating Sparse Graph Neural Network Computation Via Dense Tensor Core on GPUs},
author={Yuke Wang and Boyuan Feng and Zheng Wang and Guyue Huang and Yufei Ding},
booktitle={USENIX Annual Technical Conference},
year={2023}
}
- Clone this project.
git clone git@github.com:YukeWang96/TCGNN-Pytorch.git
- OS & Compiler:
Ubuntu 16.04+gcc >= 7.5cmake >= 3.14CUDA >= 11.0andnvcc >= 11.0
config.py: the configuration file for the shape of a TC block.bench.py: the benchmark file for invokingmain_tcgnn.pyfor various datasets and models.main_tcgnn.py: the main entry for running TC-GNN.count_TC_blocks.py: counting the total number of TC blocks without sparse-graph translation.proc_prof.py: get the detailed GPU kernel metrics from the ncu csv output.TCGNN_conv/: the directory for core TC-GNN implementations, includingTCGNN_kernel.cuandTCGNN.cpp.
- Go to
Docker/ - Run
./build.sh - Run
./launch.sh
- Install
condaon system Toturial. - Create a
condaenvironment:
conda create -n env_name python=3.6
- Install
Pytorch:
conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c conda-forge
or using pip [Note that make sure the pip you use is the pip from current conda environment. You can check this by which pip]
pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html
- Install
Deep Graph Library (DGL).
conda install -c dglteam dgl-cuda11.0
pip install torch requests tqdm
- Install
Pytorch-Geometric (PyG).
pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.8.0+cu111.html
pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.8.0+cu111.html
pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-1.8.0+cu111.html
pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.8.0+cu111.html
pip install torch-geometric
Go to TCGNN_conv/, then run
./build.sh
to install the TCGNN_conv modules with Pytorch binding. Note that this step is required for both Docker and Conda setup.
Get the preprocessed datasets in .npy at here,
then run
wget https://storage.googleapis.com/graph_dataset/tcgnn-ae-graphs.tar.gz
tar -zxvf tcgnn-ae-graphs.tar.gz
- Go to
pyg_baseline/directory;- Pass the
--modelparameter inpyg_main.pywithgcnandginto profile the example GCN and GIN model, respectively;./0_bench.py| tee run_pyg.logto run the script and the report 10 epoch runtime for all evaluated datasets../1_log2csv.pyto convert therun_pyg.logtorun_pyg.csvfor ease of analysis.
- Go to
dgl_baseline/directory- Pass the
--modelparameter indgl_main.pywithgcnandginto profile the example GCN and GIN model, respectively;./0_bench.py| tee run_dgl.logto run the script and the report 10 epoch runtime for all evaluated datasets../1_log2csv.pyto convert therun_dgl.logtorun_dgl.csvfor ease of visualization.
- Under the current project directory
./0_bench.py| tee run_TCGNN.logto run the script and the report 10 epoch runtime for all evaluated datasets../1_log2csv.pyto convert therun_TCGNN.logtorun_TCGNN.csvfor ease of analysis.