Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/ruff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
cd stgraph/graph
ruff check .
cd ../../
cd stgraph/benchmark_tools
cd stgraph/utils
ruff check .
cd ../../
cd ../../
cd stgraph/nn/pytorch/static
ruff check gcn_conv.py
cd ../../../../
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

[![Documentation Status](https://readthedocs.org/projects/stgraph/badge/?version=latest)](https://stgraph.readthedocs.io/en/latest/?badge=latest)
[![TGL Workshop - @ NeurIPS'23](https://img.shields.io/badge/TGL_Workshop-%40_NeurIPS'23-6d4a8f)](https://neurips.cc/virtual/2023/76335)
[![GrAPL - @IPDPS'24](https://img.shields.io/badge/GrAPL-%40IPDPS'24-282792)](https://hpc.pnl.gov/grapl/index.html)
[![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/)

<div align="center">
Expand Down
4 changes: 2 additions & 2 deletions benchmarking/dynamic-temporal-tgcn/pygt/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import os
from model import PyGT_TGCN
from stgraph.dataset.LinkPredDataLoader import LinkPredDataLoader
from stgraph.benchmark_tools.table import BenchmarkTable
from stgraph.utils import DataTable
from utils import to_default_device, get_default_device

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

try:
# train
Expand Down
5 changes: 3 additions & 2 deletions benchmarking/dynamic-temporal-tgcn/seastar/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import sys
import os
from stgraph.dataset.LinkPredDataLoader import LinkPredDataLoader
from stgraph.benchmark_tools.table import BenchmarkTable
from stgraph.benchmark_tools.table import DataTable
from stgraph.utils import DataTable
from stgraph.graph.dynamic.gpma.gpma_graph import GPMAGraph
from stgraph.graph.dynamic.pcsr.pcsr_graph import PCSRGraph
from stgraph.graph.dynamic.naive.naive_graph import NaiveGraph
Expand Down Expand Up @@ -159,7 +160,7 @@ def main(args):
# metrics
dur = []
max_gpu = []
table = BenchmarkTable(
table = DataTable(
f"(STGraph Dynamic-Temporal) TGCN on {dataloader.name} dataset",
[
"Epoch",
Expand Down
2 changes: 1 addition & 1 deletion benchmarking/gat/seastar/model.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import torch.nn as nn
from stgraph.nn.pytorch.gat_conv import GATConv
from stgraph.nn.pytorch.static.gat_conv import GATConv

class GAT(nn.Module):
def __init__(self,
Expand Down
8 changes: 4 additions & 4 deletions benchmarking/gcn/seastar/model.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import torch.nn as nn
from stgraph.nn.pytorch.graph_conv import GraphConv
from stgraph.nn.pytorch.static.gcn_conv import GCNConv

class GCN(nn.Module):
def __init__(self,
Expand All @@ -13,12 +13,12 @@ def __init__(self,
self.g = g
self.layers = nn.ModuleList()
# input layer
self.layers.append(GraphConv(in_feats, n_hidden, activation))
self.layers.append(GCNConv(in_feats, n_hidden, activation))
# hidden layers
for i in range(n_layers - 1):
self.layers.append(GraphConv(n_hidden, n_hidden, activation))
self.layers.append(GCNConv(n_hidden, n_hidden, activation))
# output layer
self.layers.append(GraphConv(n_hidden, n_classes, None))
self.layers.append(GCNConv(n_hidden, n_classes, None))

def forward(self, g, features):
h = features
Expand Down
10 changes: 5 additions & 5 deletions benchmarking/results/result_generator_static.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import csv
from rich import inspect

from stgraph.benchmark_tools.table import BenchmarkTable
from stgraph.utils import DataTable

all_results = []

Expand Down Expand Up @@ -43,7 +43,7 @@ def get_dataset_name(parameters):


# forming the Table 1: Time measurements for varying feature sizes
table_1 = BenchmarkTable(f"Time measurements (s) for varying feature sizes - {dataset}", ["Hidden Dimension", "PyG-T", "STGraph"])
table_1 = DataTable(f"Time measurements (s) for varying feature sizes - {dataset}", ["Hidden Dimension", "PyG-T", "STGraph"])
pygt_results_table_1 = {}
seastar_results_table_1 = {}

Expand Down Expand Up @@ -72,7 +72,7 @@ def get_dataset_name(parameters):
table_1.display()

# forming the Table 2: Memory measurements for varying feature sizes
table_2 = BenchmarkTable(f"Memory taken (MB) for varying feature sizes - {dataset}", ["Hidden Dimension", "PyG-T", "STGraph"])
table_2 = DataTable(f"Memory taken (MB) for varying feature sizes - {dataset}", ["Hidden Dimension", "PyG-T", "STGraph"])
pygt_results_table_2 = {}
seastar_results_table_2 = {}

Expand Down Expand Up @@ -103,7 +103,7 @@ def get_dataset_name(parameters):
for dataset in dataset_names:

# forming the Table 1: Time measurements for varying sequence lengths
table_1 = BenchmarkTable(f"Time measurements (s) for varying sequence lengths - {dataset}", ["Hidden Dimension", "PyG-T", "STGraph"])
table_1 = DataTable(f"Time measurements (s) for varying sequence lengths - {dataset}", ["Hidden Dimension", "PyG-T", "STGraph"])
pygt_results_table_1 = {}
seastar_results_table_1 = {}

Expand Down Expand Up @@ -132,7 +132,7 @@ def get_dataset_name(parameters):
table_1.display()

# forming the Table 2: Memory measurements for varying sequence lengths
table_2 = BenchmarkTable(f"Memory taken (MB) for varying sequence lengths- {dataset}", ["Hidden Dimension", "PyG-T", "STGraph"])
table_2 = DataTable(f"Memory taken (MB) for varying sequence lengths- {dataset}", ["Hidden Dimension", "PyG-T", "STGraph"])
pygt_results_table_2 = {}
seastar_results_table_2 = {}

Expand Down
4 changes: 2 additions & 2 deletions benchmarking/static-temporal-tgcn/pygt/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from stgraph.dataset.METRLADataLoader import METRLADataLoader
from stgraph.dataset.MontevideoBusDataLoader import MontevideoBusDataLoader

from stgraph.benchmark_tools.table import BenchmarkTable
from stgraph.utils import DataTable
from utils import to_default_device, get_default_device

def main(args):
Expand Down Expand Up @@ -74,7 +74,7 @@ def main(args):
# metrics
dur = []
max_gpu = []
table = BenchmarkTable(f"(PyGT Static-Temporal) TGCN on {dataloader.name} dataset", ["Epoch", "Time(s)", "MSE", "Used GPU Memory (Max MB)"])
table = DataTable(f"(PyGT Static-Temporal) TGCN on {dataloader.name} dataset", ["Epoch", "Time(s)", "MSE", "Used GPU Memory (Max MB)"])

try:
# train
Expand Down
4 changes: 2 additions & 2 deletions benchmarking/static-temporal-tgcn/seastar/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from stgraph.dataset.METRLADataLoader import METRLADataLoader
from stgraph.dataset.MontevideoBusDataLoader import MontevideoBusDataLoader

from stgraph.benchmark_tools.table import BenchmarkTable
from stgraph.utils import DataTable
from utils import to_default_device, get_default_device

from rich import inspect
Expand Down Expand Up @@ -135,7 +135,7 @@ def main(args):
# metrics
dur = []
max_gpu = []
table = BenchmarkTable(
table = DataTable(
f"(STGraph Static-Temporal) TGCN on {dataloader.name} dataset",
["Epoch", "Time(s)", "MSE", "Used GPU Memory (Max MB)"],
)
Expand Down
4 changes: 4 additions & 0 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.wy-table-responsive table td {
word-wrap: break-word;
white-space: normal;
}
4 changes: 4 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,7 @@
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]

html_css_files = [
'custom.css',
]
11 changes: 11 additions & 0 deletions docs/source/generated/stgraph.benchmark_tools.BenchmarkTable.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. role:: hidden
:class: hidden-section
.. currentmodule:: stgraph.benchmark_tools


BenchmarkTable
==============

.. autoclass:: BenchmarkTable
:show-inheritance:
:members:
5 changes: 3 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Explore the STGraph documentation and tutorials to get started with writing and
:caption: Tutorials
:glob:

tutorials/gnn
tutorials/gcn_cora

.. toctree::
:maxdepth: 1
Expand All @@ -42,7 +42,8 @@ Explore the STGraph documentation and tutorials to get started with writing and
package_reference/stgraph.dataset
package_reference/stgraph.compiler
package_reference/stgraph.graph
package_reference/stgraph.benchmark_tools
package_reference/stgraph.utils
package_reference/stgraph.nn

.. toctree::
:maxdepth: 1
Expand Down
2 changes: 1 addition & 1 deletion docs/source/package_reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Package Reference
stgraph.dataset
stgraph.compiler
stgraph.graph
stgraph.benchmark_tools
stgraph.utils
12 changes: 0 additions & 12 deletions docs/source/package_reference/stgraph.benchmark_tools.rst

This file was deleted.

17 changes: 17 additions & 0 deletions docs/source/package_reference/stgraph.nn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
stgraph.nn
##########

.. currentmodule:: stgraph.nn
.. automodule:: stgraph.nn

PyTorch
=======

GNN layer implementation for PyTorch specific backend

.. autosummary::
:toctree: ../generated/
:nosignatures:
:template: class.rst

GCNConv
22 changes: 22 additions & 0 deletions docs/source/package_reference/stgraph.utils.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
stgraph.utils
#############

.. currentmodule:: stgraph.utils
.. automodule:: stgraph.utils

.. autosummary::
:toctree: ../generated/
:nosignatures:
:template: class.rst

DataTable

Constants
---------

.. autosummary::
:toctree: ../generated/
:nosignatures:
:template: class.rst

SizeConstants
Loading