Skip to content

Commit ae0410a

Browse files
Merge pull request #142 from bfGraph/develop
📦 STGraph v1.1.0
2 parents 54d364f + 25b6c64 commit ae0410a

File tree

199 files changed

+7553
-2337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+7553
-2337
lines changed

.github/workflows/pytest.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Run Unit Test via Pytest
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ["3.8"]
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Set up Python ${{ matrix.python-version }}
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: ${{ matrix.python-version }}
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install -e .[dev]
22+
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
23+
- name: Test with pytest
24+
run: |
25+
coverage run -m pytest -v -s -p no:warnings
26+
- name: Generate Coverage Report
27+
run: |
28+
coverage report -m

.github/workflows/ruff.yaml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Ruff Linting
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ["3.8"]
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Set up Python ${{ matrix.python-version }}
14+
uses: actions/setup-python@v3
15+
with:
16+
python-version: ${{ matrix.python-version }}
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install ruff
21+
- name: Analysing the code with ruff
22+
run: |
23+
cd stgraph/dataset/
24+
ruff check .
25+
cd ../../
26+
cd stgraph/graph
27+
ruff check .
28+
cd ../../
29+
cd stgraph/utils
30+
ruff check .
31+
cd ../../
32+
cd stgraph/nn/pytorch/static
33+
ruff check gcn_conv.py
34+
cd ../../../../

.gitignore

+9-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ benchmarking/results/
1313
*.egg-info/
1414
stgraph/build/
1515
stgraph/dist/
16+
dev-stgraph/
1617
docs/_build
18+
docs_old/
19+
docs_v2/
1720
__pycache__/
1821
.DS_Store
1922
build
@@ -25,4 +28,9 @@ dist
2528
*.svg
2629
*.json
2730
*.npy
28-
dev-stgraph/
31+
.coverage
32+
dev-stgraph/
33+
htmlconv/
34+
*.txt
35+
egl_kernel.cu
36+
egl_kernel.ptx

.idea/STGraph.iml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

+50
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.pylintrc

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[FORMAT]
2+
3+
# Set the maximum line length to a value that suits your project
4+
max-line-length = 120
5+
6+
[MESSAGES CONTROL]
7+
8+
# Disable specific messages by adding them to the "disable" option
9+
disable=
10+
line-too-long,
11+
too-many-instance-attributes,
12+
too-many-arguments,
13+
import-error,
14+
too-few-public-methods,
15+
# Add more disabled messages here if needed

.readthedocs.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ build:
1313

1414
# Build documentation in the "docs/" directory with Sphinx
1515
sphinx:
16-
configuration: docs/conf.py
16+
configuration: docs/source/conf.py
1717

1818
# Optional but recommended, declare the Python requirements required
1919
# to build your documentation
2020
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
2121
python:
2222
install:
23-
- requirements: requirements.txt
23+
- requirements: docs/requirements.txt
2424
- method: pip
2525
path: .

README.md

+2-62
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
[![Documentation Status](https://readthedocs.org/projects/stgraph/badge/?version=latest)](https://stgraph.readthedocs.io/en/latest/?badge=latest)
99
[![TGL Workshop - @ NeurIPS'23](https://img.shields.io/badge/TGL_Workshop-%40_NeurIPS'23-6d4a8f)](https://neurips.cc/virtual/2023/76335)
10+
[![GrAPL - @IPDPS'24](https://img.shields.io/badge/GrAPL-%40IPDPS'24-282792)](https://hpc.pnl.gov/grapl/index.html)
1011
[![PyPI - 1.0.0](https://img.shields.io/static/v1?label=PyPI&message=1.0.0&color=%23ffdf76&logo=Python)](https://pypi.org/project/stgraph/)
1112

1213
<div align="center">
@@ -104,68 +105,7 @@ With this you have successfully installed STGraph locally to make development ch
104105

105106
## Running your first STGraph Program
106107

107-
In this is quick mini tutorial, we will show you how to train a simple GCN model on the Cora dataset. After installing STGraph and entering the STGraph directory, enter the following commands to reach the GCN `benchmarking` folder
108-
109-
```
110-
cd benchmarking/gcn/stgraph
111-
```
112-
113-
Run the `train.py`, with 100 epochs and specify the dataset name. For this example, we shall use Cora
114-
115-
```
116-
python3 train.py --num_epochs 100 --dataset cora
117-
```
118-
119-
You should get an output like this. The initial prints are truncated.
120-
121-
```
122-
.
123-
.
124-
.
125-
Epoch 00090 | Time(s) 0.0048 | train_acc 0.303791 | Used_Memory 32.975098 mb
126-
Epoch 00091 | Time(s) 0.0024 | train_acc 0.303791 | Used_Memory 32.975098 mb
127-
Epoch 00092 | Time(s) 0.0029 | train_acc 0.303791 | Used_Memory 32.975098 mb
128-
Epoch 00093 | Time(s) 0.0029 | train_acc 0.303791 | Used_Memory 32.975098 mb
129-
Epoch 00094 | Time(s) 0.0027 | train_acc 0.303791 | Used_Memory 32.975098 mb
130-
Epoch 00095 | Time(s) 0.0030 | train_acc 0.303791 | Used_Memory 32.975098 mb
131-
Epoch 00096 | Time(s) 0.0024 | train_acc 0.303791 | Used_Memory 32.975098 mb
132-
Epoch 00097 | Time(s) 0.0022 | train_acc 0.303791 | Used_Memory 32.975098 mb
133-
Epoch 00098 | Time(s) 0.0022 | train_acc 0.303791 | Used_Memory 32.975098 mb
134-
Epoch 00099 | Time(s) 0.0036 | train_acc 0.303791 | Used_Memory 32.975098 mb
135-
136-
^^^0.032202^^^0.003098
137-
```
138-
139-
If you don't get this output and have followed every single step in the setting up and installation section, please raise an issue we will look into it.
140-
141-
## How to build STGraph
142-
143-
This is for users who want to make changes to the STGraph codebase and get it build each time. Follow the steps mentioned to properly build STGraph.
144-
145-
### Compiling the CUDA code
146-
147-
The following steps need to be done if you made any changes to any CUDA files within the `stgraph/graph` directory for each graph representation.
148-
149-
STGraph supports training dynamic and static graphs. To handle all the graph representations logic, it is written as a PyBind11 module over a CUDA file. As of now the following CUDA code for different graph representations exists
150-
151-
1. `csr.cu`
152-
2. `pcsr.cu`
153-
3. `gpma.cu`
154-
155-
To compile the `[name].cu` file, run the following command
156-
157-
```
158-
/usr/local/cuda-11.7/bin/nvcc $(python3 -m pybind11 --includes) -shared -rdc=true --compiler-options '-fPIC' -D__CDPRT_SUPPRESS_SYNC_DEPRECATION_WARNING -o [name].so [name].cu
159-
```
160-
This would generate the [name].so shared object file, that is used in the STGraph module.
161-
162-
### Building STGraph
163-
164-
Make sure to go back to the root directory and run the following to build and install STGraph
165-
166-
```
167-
python3 -m build && pip uninstall stgraph -y && pip install dist/stgraph-1.0.0-py3-none-any.whl
168-
```
108+
Please have a look inside the `tutorials/` directory to write and train your own GNNs using STGraph
169109

170110
## Contributing
171111

benchmarking/dynamic-temporal-tgcn/pygt/train.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import os
1010
from model import PyGT_TGCN
1111
from stgraph.dataset.LinkPredDataLoader import LinkPredDataLoader
12-
from stgraph.benchmark_tools.table import BenchmarkTable
12+
from stgraph.utils import DataTable
1313
from utils import to_default_device, get_default_device
1414

1515
def main(args):
@@ -71,7 +71,7 @@ def main(args):
7171
# metrics
7272
dur = []
7373
max_gpu = []
74-
table = BenchmarkTable(f"(PyGT Dynamic-Temporal) TGCN on {dataloader.name} dataset", ["Epoch", "Time(s)", "MSE", "Used GPU Memory (Max MB)"])
74+
table = DataTable(f"(PyGT Dynamic-Temporal) TGCN on {dataloader.name} dataset", ["Epoch", "Time(s)", "MSE", "Used GPU Memory (Max MB)"])
7575

7676
try:
7777
# train

0 commit comments

Comments
 (0)