stgraph


Namestgraph JSON
Version 1.1.0 PyPI version JSON
download
home_pageNone
Summary🌟 Vertex Centric approach for building GNN/TGNNs
upload_time2024-09-09 14:04:56
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2023 STGraph Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords gnn tgnn gpu programming
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://github.com/bfGraph/STGraph/blob/main/assets/STGraph%20Banner%20%E2%80%93%20Dark.png?raw=true">
  <source media="(prefers-color-scheme: light)" srcset="https://github.com/bfGraph/STGraph/blob/main/assets/STGraph%20Banner%20New.png?raw=true">
  <img alt="STGraph Banner" src="https://github.com/bfGraph/STGraph/blob/main/assets/STGraph%20Banner%20New.png?raw=true">  
</picture>


[![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">
  <p align="center">
    <a href="https://stgraph.readthedocs.io/en/latest/"><strong>Explore the docs »</strong></a>
    <br />
    <br />
    <a href="https://github.com/bfGraph/STGraph/blob/main/INSTALLATION.md">Installation guide</a>
    ·
    <a href="https://github.com/bfGraph/STGraph/issues">Report Bug</a>
    ·
    <a href="https://github.com/bfGraph/STGraph/discussions">View Discussions</a>
    .
    <a href="https://openreview.net/forum?id=8PRRNv81qB">Paper</a>
  </p>
</div>


# 🌟 STGraph

STGraph is a framework designed for deep-learning practitioners to write and train Graph Neural Networks (GNNs) and Temporal Graph Neural Networks (TGNNs). It is built on top of _Seastar_ and utilizes the vertex-centric approach to produce highly efficient fused GPU kernels for forward and backward passes. It achieves better usability, faster computation time and consumes less memory than state-of-the-art graph deep-learning systems like DGL, PyG and PyG-T.

_NOTE: If the contents of this repository are used for research work, kindly cite the paper linked above._

## Why STGraph

![Seastar GCN Formula](https://github.com/bfGraph/STGraph/blob/main/assets/Seastar%20GCN%20Formula.png?raw=true)



The primary goal of _Seastar_ is more natural GNN programming so that the users learning curve is flattened. Our key observation lies in recognizing that the equation governing a GCN layer, as shown above, takes the form of vertex-centric computation and can be implemented succinctly with only one line of code. Moreover, we can see a clear correspondence between the GNN formulas and the vertex-centric implementations. The benefit is two-fold: users can effortlessly implement GNN models, while simultaneously understanding these models by inspecting their direct implementations.

The _Seastar_ system outperforms state-of-the-art GNN frameworks but lacks support for TGNNs. STGraph bridges that gap and enables users to to develop TGNN models through a vertex-centric approach. STGraph has shown to be significantly faster and more memory efficient that state-of-the-art frameworks like PyG-T for training TGNN models.

## Getting Started

### Installation for STGraph Package Users

This guide is tailored for users of the STGraph package, designed for constructing GNN and TGNN models. We recommend creating a new virtual environment with Python version `3.8` and installing `stgraph` inside that dedicated environment.

**Installing STGraph from PyPI**

```bash
pip install stgraph
```

**Installing PyTorch**

In addition, STGraph relies on PyTorch. Ensure it is installed in your virtual environment with the following command

```bash
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
```

Upon completion of the above steps, you have successfully installed STGraph. Proceed to write and train your first GNN model by referring to the provided [tutorial](examples/README.md).

### Installation for STGraph Package Developers

This guide is intended for those interested in developing and contributing to STGraph.

**Download source files from GitHub**

```bash
git clone https://github.com/bfGraph/STGraph.git
cd STGraph
```

**Create a dedicated virtual environment**

Inside the STGraph directory create and activate a dedicated virtual environment named `dev-stgraph` with Python version `3.8`.

```bash
python3.8 -m venv dev-stgraph
source dev-stgraph/bin/activate
```

**Install STGraph in editable mode**

Make sure to install the STGraph package in editable mode to ease your development process. 

```bash
pip install -e .[dev]
pip list
```

**Install PyTorch**

Ensure to install PyTorch as well for development

```bash
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
```

With this you have successfully installed STGraph locally to make development changes and contribute to the project. Head out to our [Pull Requests](https://github.com/bfGraph/STGraph/pulls) page and get started with your first contribution.

## Running your first STGraph Program

Please have a look inside the `tutorials/` directory to write and train your own GNNs using STGraph

## Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests, issues, etc to us.

## How to contribute to Documentation

We follow the PEP-8 format. [Black](https://pypi.org/project/black/) is used as the formatter and [pycodestyle](https://pypi.org/project/pycodestyle/) as the linter. The linter is is configure to work properly with black (set line length to 88)

Tutorial for Python Docstrings can be found [here](https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html)

```
sphinx-apidoc -o docs/developers_guide/developer_manual/package_reference/ python/stgraph/ -f
cd docs/
make clean
make html
```
## Authors

| Author                            | Bio                                                                   |
| --------------------------------- | --------------------------------------------------------------------- |
| `Joel Mathew Cherian`             | Computer Science Student at National Institute of Technology Calicut  |
| `Nithin Puthalath Manoj`          | Computer Science Student at National Institute of Technology Calicut  |
| `Dr. Unnikrishnan Cheramangalath` | Assistant Professor in CSED at Indian Institue of Technology Palakkad |
| `Kevin Jude`                      | Ph.D. in CSED at Indian Institue of Technology Palakkad               |

## References

| Author(s)                                                                                                                                                                         | Title                                                                                                    | Link(s)                                                                                                                          |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `Wu, Yidi and Ma, Kaihao and Cai, Zhenkun and Jin, Tatiana and Li, Boyang and Zheng, Chenguang and Cheng, James and Yu, Fan`                                                      | `STGraph: vertex-centric programming for graph neural networks, 2021`                                    | [paper](https://doi.org/10.1145/3447786.3456247), [code](https://zenodo.org/record/4988602)                                      |
| `Wheatman, Brian and Xu, Helen`                                                                                                                                                   | `Packed Compressed Sparse Row: A Dynamic Graph Representation, 2018`                                     | [paper](https://ieeexplore.ieee.org/abstract/document/8547566), [code](https://github.com/wheatman/Packed-Compressed-Sparse-Row) |
| `Sha, Mo and Li, Yuchen and He, Bingsheng and Tan, Kian-Lee`                                                                                                                      | `Accelerating Dynamic Graph Analytics on GPUs, 2017`                                                     | [paper](http://www.vldb.org/pvldb/vol11/p107-sha.pdf), [code](https://github.com/desert0616/gpma_demo)                           |
| `Benedek Rozemberczki, Paul Scherer, Yixuan He, George Panagopoulos, Alexander Riedel, Maria Astefanoaei, Oliver Kiss, Ferenc Beres, Guzmán López, Nicolas Collignon, Rik Sarkar` | `PyTorch Geometric Temporal: Spatiotemporal Signal Processing with Neural Machine Learning Models, 2021` | [paper](https://arxiv.org/pdf/2104.07788.pdf), [code](https://github.com/benedekrozemberczki/pytorch_geometric_temporal)         |

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "stgraph",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "GNN, TGNN, GPU Programming",
    "author": null,
    "author_email": "Joel Mathew Cherian <joelmathewcherian@gmail.com>, Nithin Puthalath Manoj <nithinp.manoj@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/4e/64/a030dc2dec94e491f6816a8d42d7832c5c5c86139a69ab33606e5d05dbb0/stgraph-1.1.0.tar.gz",
    "platform": null,
    "description": "<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/bfGraph/STGraph/blob/main/assets/STGraph%20Banner%20%E2%80%93%20Dark.png?raw=true\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\"https://github.com/bfGraph/STGraph/blob/main/assets/STGraph%20Banner%20New.png?raw=true\">\n  <img alt=\"STGraph Banner\" src=\"https://github.com/bfGraph/STGraph/blob/main/assets/STGraph%20Banner%20New.png?raw=true\">  \n</picture>\n\n\n[![Documentation Status](https://readthedocs.org/projects/stgraph/badge/?version=latest)](https://stgraph.readthedocs.io/en/latest/?badge=latest)\n[![TGL Workshop - @ NeurIPS'23](https://img.shields.io/badge/TGL_Workshop-%40_NeurIPS'23-6d4a8f)](https://neurips.cc/virtual/2023/76335)\n[![GrAPL - @IPDPS'24](https://img.shields.io/badge/GrAPL-%40IPDPS'24-282792)](https://hpc.pnl.gov/grapl/index.html)\n[![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/)\n\n<div align=\"center\">\n  <p align=\"center\">\n    <a href=\"https://stgraph.readthedocs.io/en/latest/\"><strong>Explore the docs \u00bb</strong></a>\n    <br />\n    <br />\n    <a href=\"https://github.com/bfGraph/STGraph/blob/main/INSTALLATION.md\">Installation guide</a>\n    \u00b7\n    <a href=\"https://github.com/bfGraph/STGraph/issues\">Report Bug</a>\n    \u00b7\n    <a href=\"https://github.com/bfGraph/STGraph/discussions\">View Discussions</a>\n    .\n    <a href=\"https://openreview.net/forum?id=8PRRNv81qB\">Paper</a>\n  </p>\n</div>\n\n\n# \ud83c\udf1f STGraph\n\nSTGraph is a framework designed for deep-learning practitioners to write and train Graph Neural Networks (GNNs) and Temporal Graph Neural Networks (TGNNs). It is built on top of _Seastar_ and utilizes the vertex-centric approach to produce highly efficient fused GPU kernels for forward and backward passes. It achieves better usability, faster computation time and consumes less memory than state-of-the-art graph deep-learning systems like DGL, PyG and PyG-T.\n\n_NOTE: If the contents of this repository are used for research work, kindly cite the paper linked above._\n\n## Why STGraph\n\n![Seastar GCN Formula](https://github.com/bfGraph/STGraph/blob/main/assets/Seastar%20GCN%20Formula.png?raw=true)\n\n\n\nThe primary goal of _Seastar_ is more natural GNN programming so that the users learning curve is flattened. Our key observation lies in recognizing that the equation governing a GCN layer, as shown above, takes the form of vertex-centric computation and can be implemented succinctly with only one line of code. Moreover, we can see a clear correspondence between the GNN formulas and the vertex-centric implementations. The benefit is two-fold: users can effortlessly implement GNN models, while simultaneously understanding these models by inspecting their direct implementations.\n\nThe _Seastar_ system outperforms state-of-the-art GNN frameworks but lacks support for TGNNs. STGraph bridges that gap and enables users to to develop TGNN models through a vertex-centric approach. STGraph has shown to be significantly faster and more memory efficient that state-of-the-art frameworks like PyG-T for training TGNN models.\n\n## Getting Started\n\n### Installation for STGraph Package Users\n\nThis guide is tailored for users of the STGraph package, designed for constructing GNN and TGNN models. We recommend creating a new virtual environment with Python version `3.8` and installing `stgraph` inside that dedicated environment.\n\n**Installing STGraph from PyPI**\n\n```bash\npip install stgraph\n```\n\n**Installing PyTorch**\n\nIn addition, STGraph relies on PyTorch. Ensure it is installed in your virtual environment with the following command\n\n```bash\npip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118\n```\n\nUpon completion of the above steps, you have successfully installed STGraph. Proceed to write and train your first GNN model by referring to the provided [tutorial](examples/README.md).\n\n### Installation for STGraph Package Developers\n\nThis guide is intended for those interested in developing and contributing to STGraph.\n\n**Download source files from GitHub**\n\n```bash\ngit clone https://github.com/bfGraph/STGraph.git\ncd STGraph\n```\n\n**Create a dedicated virtual environment**\n\nInside the STGraph directory create and activate a dedicated virtual environment named `dev-stgraph` with Python version `3.8`.\n\n```bash\npython3.8 -m venv dev-stgraph\nsource dev-stgraph/bin/activate\n```\n\n**Install STGraph in editable mode**\n\nMake sure to install the STGraph package in editable mode to ease your development process. \n\n```bash\npip install -e .[dev]\npip list\n```\n\n**Install PyTorch**\n\nEnsure to install PyTorch as well for development\n\n```bash\npip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118\n```\n\nWith this you have successfully installed STGraph locally to make development changes and contribute to the project. Head out to our [Pull Requests](https://github.com/bfGraph/STGraph/pulls) page and get started with your first contribution.\n\n## Running your first STGraph Program\n\nPlease have a look inside the `tutorials/` directory to write and train your own GNNs using STGraph\n\n## Contributing\n\nPlease read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests, issues, etc to us.\n\n## How to contribute to Documentation\n\nWe follow the PEP-8 format. [Black](https://pypi.org/project/black/) is used as the formatter and [pycodestyle](https://pypi.org/project/pycodestyle/) as the linter. The linter is is configure to work properly with black (set line length to 88)\n\nTutorial for Python Docstrings can be found [here](https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html)\n\n```\nsphinx-apidoc -o docs/developers_guide/developer_manual/package_reference/ python/stgraph/ -f\ncd docs/\nmake clean\nmake html\n```\n## Authors\n\n| Author                            | Bio                                                                   |\n| --------------------------------- | --------------------------------------------------------------------- |\n| `Joel Mathew Cherian`             | Computer Science Student at National Institute of Technology Calicut  |\n| `Nithin Puthalath Manoj`          | Computer Science Student at National Institute of Technology Calicut  |\n| `Dr. Unnikrishnan Cheramangalath` | Assistant Professor in CSED at Indian Institue of Technology Palakkad |\n| `Kevin Jude`                      | Ph.D. in CSED at Indian Institue of Technology Palakkad               |\n\n## References\n\n| Author(s)                                                                                                                                                                         | Title                                                                                                    | Link(s)                                                                                                                          |\n| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| `Wu, Yidi and Ma, Kaihao and Cai, Zhenkun and Jin, Tatiana and Li, Boyang and Zheng, Chenguang and Cheng, James and Yu, Fan`                                                      | `STGraph: vertex-centric programming for graph neural networks, 2021`                                    | [paper](https://doi.org/10.1145/3447786.3456247), [code](https://zenodo.org/record/4988602)                                      |\n| `Wheatman, Brian and Xu, Helen`                                                                                                                                                   | `Packed Compressed Sparse Row: A Dynamic Graph Representation, 2018`                                     | [paper](https://ieeexplore.ieee.org/abstract/document/8547566), [code](https://github.com/wheatman/Packed-Compressed-Sparse-Row) |\n| `Sha, Mo and Li, Yuchen and He, Bingsheng and Tan, Kian-Lee`                                                                                                                      | `Accelerating Dynamic Graph Analytics on GPUs, 2017`                                                     | [paper](http://www.vldb.org/pvldb/vol11/p107-sha.pdf), [code](https://github.com/desert0616/gpma_demo)                           |\n| `Benedek Rozemberczki, Paul Scherer, Yixuan He, George Panagopoulos, Alexander Riedel, Maria Astefanoaei, Oliver Kiss, Ferenc Beres, Guzm\u00e1n L\u00f3pez, Nicolas Collignon, Rik Sarkar` | `PyTorch Geometric Temporal: Spatiotemporal Signal Processing with Neural Machine Learning Models, 2021` | [paper](https://arxiv.org/pdf/2104.07788.pdf), [code](https://github.com/benedekrozemberczki/pytorch_geometric_temporal)         |\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 STGraph  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "\ud83c\udf1f Vertex Centric approach for building GNN/TGNNs",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/bfGraph/STGraph"
    },
    "split_keywords": [
        "gnn",
        " tgnn",
        " gpu programming"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f5cb4e124e97ded386f41314370a30ed80529b025d435d0d4e77a2e2df2c2415",
                "md5": "98005f463d5b9dada6bd82ef53c5f083",
                "sha256": "12b34af18d399c60d9a4b1106c4533b39ae67911178577d0fa6005c7a23d8c6b"
            },
            "downloads": -1,
            "filename": "stgraph-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "98005f463d5b9dada6bd82ef53c5f083",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 29996155,
            "upload_time": "2024-09-09T14:04:30",
            "upload_time_iso_8601": "2024-09-09T14:04:30.136791Z",
            "url": "https://files.pythonhosted.org/packages/f5/cb/4e124e97ded386f41314370a30ed80529b025d435d0d4e77a2e2df2c2415/stgraph-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4e64a030dc2dec94e491f6816a8d42d7832c5c5c86139a69ab33606e5d05dbb0",
                "md5": "a9bc554c778d2e9b96a63b03fa404512",
                "sha256": "2544b1b8a06ad8fb9f377fb7554317ee6c5aabbc04bd577b2ec1f44348530dc4"
            },
            "downloads": -1,
            "filename": "stgraph-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a9bc554c778d2e9b96a63b03fa404512",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 26288355,
            "upload_time": "2024-09-09T14:04:56",
            "upload_time_iso_8601": "2024-09-09T14:04:56.323826Z",
            "url": "https://files.pythonhosted.org/packages/4e/64/a030dc2dec94e491f6816a8d42d7832c5c5c86139a69ab33606e5d05dbb0/stgraph-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-09 14:04:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bfGraph",
    "github_project": "STGraph",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "stgraph"
}
        
Elapsed time: 0.34218s