{"id":13605279,"url":"https://github.com/MachineLearningSystem/ATC23-TCGNN-Pytorch","last_synced_at":"2025-04-12T05:32:34.114Z","repository":{"id":185461624,"uuid":"634468889","full_name":"MachineLearningSystem/ATC23-TCGNN-Pytorch","owner":"MachineLearningSystem","description":"TC-GNN with Pytorch integration","archived":false,"fork":true,"pushed_at":"2023-04-28T16:16:20.000Z","size":76979,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-08-02T19:37:11.521Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"YukeWang96/TC-GNN_ATC23","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MachineLearningSystem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-04-30T08:11:49.000Z","updated_at":"2023-04-30T08:11:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/MachineLearningSystem/ATC23-TCGNN-Pytorch","commit_stats":null,"previous_names":["machinelearningsystem/atc23-tcgnn-pytorch"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MachineLearningSystem%2FATC23-TCGNN-Pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MachineLearningSystem%2FATC23-TCGNN-Pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MachineLearningSystem%2FATC23-TCGNN-Pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MachineLearningSystem%2FATC23-TCGNN-Pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MachineLearningSystem","download_url":"https://codeload.github.com/MachineLearningSystem/ATC23-TCGNN-Pytorch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223497738,"owners_count":17155199,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T19:00:56.933Z","updated_at":"2024-11-07T10:30:22.368Z","avatar_url":"https://github.com/MachineLearningSystem.png","language":null,"readme":"# TC-GNN (Running Sparse GNN on Dense Tensor Core on Ampere GPU)\n\n+ **Cite this project and [paper](https://arxiv.org/abs/2112.02052).**\n```\n@inproceedings{TC-GNN,\n  title={TC-GNN: Accelerating Sparse Graph Neural Network Computation Via Dense Tensor Core on GPUs},\n  author={Yuke Wang and Boyuan Feng and Zheng Wang and Guyue Huang and Yufei Ding},\n  booktitle={USENIX Annual Technical Conference},\n  year={2023}\n}\n```\n\n+ **Clone this project**.\n```\ngit clone git@github.com:YukeWang96/TCGNN-Pytorch.git\n```\n\n+ **OS \u0026 Compiler**: \n\u003e + `Ubuntu 16.04+`\n\u003e + `gcc \u003e= 7.5`\n\u003e + `cmake \u003e= 3.14`\n\u003e + `CUDA \u003e= 11.0` and `nvcc \u003e= 11.0`\n\n## Files and Directories.\n+ `config.py`: the configuration file for the shape of a TC block.\n+ `bench.py`: the benchmark file for invoking `main_tcgnn.py` for various datasets and models.\n+ `main_tcgnn.py`: the main entry for running TC-GNN.\n+ `count_TC_blocks.py`: counting the total number of TC blocks without sparse-graph translation.\n+ `proc_prof.py`: get the detailed GPU kernel metrics from the ncu csv output. \n+ `TCGNN_conv/`: the directory for core TC-GNN implementations, including `TCGNN_kernel.cu` and `TCGNN.cpp`.\n\n## Environment Setup.\n### [**Method-1**] Install via Docker (Recommended).\n+ Go to `Docker/`\n+ Run `./build.sh`\n+ Run `./launch.sh`\n\n### [**Method-2**] Install via Conda.\n+ Install **`conda`** on system **[Toturial](https://www.digitalocean.com/community/tutorials/how-to-install-anaconda-on-ubuntu-18-04-quickstart)**.\n+ Create a **`conda`** environment: \n```\nconda create -n env_name python=3.6\n```\n+ Install **`Pytorch`**: \n```\nconda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c conda-forge\n```\nor using `pip` [**Note that make sure the `pip` you use is the `pip` from current conda environment. You can check this by `which pip`**]\n```\npip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html\n```\n+ Install [**`Deep Graph Library (DGL)`**](https://github.com/dmlc/dgl).\n```\nconda install -c dglteam dgl-cuda11.0\npip install torch requests tqdm\n```\n\n+ Install [**`Pytorch-Geometric (PyG)`**](https://github.com/rusty1s/pytorch_geometric).\n```\npip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.8.0+cu111.html\npip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.8.0+cu111.html\npip install torch-cluster -f https://pytorch-geometric.com/whl/torch-1.8.0+cu111.html\npip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.8.0+cu111.html\npip install torch-geometric\n```\n\n### Install **`TC-GNN`**.\nGo to `TCGNN_conv/`, then run\n```\n./build.sh\n``` \nto install the TCGNN_conv modules with Pytorch binding. \n**Note that this step is required for both Docker and Conda setup.**\n\n\n### Download graph datasets.\nGet the preprocessed datasets in `.npy` at [here](https://storage.googleapis.com/graph_dataset/tcgnn-ae-graphs.tar.gz), \nthen run\n```\nwget https://storage.googleapis.com/graph_dataset/tcgnn-ae-graphs.tar.gz\ntar -zxvf tcgnn-ae-graphs.tar.gz\n``` \n\n## Running **PyG** baseline.\n\u003e +  Go to **`pyg_baseline/`** directory;\n\u003e + Pass the `--model` parameter in `pyg_main.py` with `gcn` and `gin` to profile the example GCN and GIN model, respectively;\n\u003e + `./0_bench.py| tee run_pyg.log` to run the script and the report 10 epoch runtime for all evaluated datasets. \n\u003e + `./1_log2csv.py` to convert the `run_pyg.log` to `run_pyg.csv` for ease of analysis.\n\n## Running **DGL** baseline.\n\u003e +  Go to **`dgl_baseline/`** directory\n\u003e +  Pass the `--model` parameter in `dgl_main.py` with `gcn` and  `gin` to profile the example GCN and GIN model, respectively;\n\u003e + `./0_bench.py| tee run_dgl.log` to run the script and the report 10 epoch runtime for all evaluated datasets. \n\u003e + `./1_log2csv.py` to convert the `run_dgl.log` to `run_dgl.csv` for ease of visualization.\n\n## Running **TC-GNN**.\n\u003e +  Under the current project directory \n\u003e + `./0_bench.py| tee run_TCGNN.log` to run the script and the report 10 epoch runtime for all evaluated datasets. \n\u003e + `./1_log2csv.py` to convert the `run_TCGNN.log` to `run_TCGNN.csv` for ease of analysis.\n","funding_links":[],"categories":["Paper-Code"],"sub_categories":["GNN"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMachineLearningSystem%2FATC23-TCGNN-Pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMachineLearningSystem%2FATC23-TCGNN-Pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMachineLearningSystem%2FATC23-TCGNN-Pytorch/lists"}