Skip to main content

SGL: Scalable Graph Learning

SGL is a Graph Neural Network (GNN) toolkit targeting scalable graph learning, which supports deep graph learning on extremely large datasets. SGL allows users to easily implement scalable graph neural networks and evaluate its performance on various downstream tasks like node classification, node clustering, and link prediction. Further, SGL supports auto neural architecture search functionality based on OpenBox. SGL is designed and developed by the graph learning team from the DAIR Lab at Peking University.

Why SGL?

The key difference between SGL and existing GNN toolkits, such as PyTorch Geometric (PyG) and Deep Graph Library (DGL), is that, SGL enjoys the characteristics of the follwing three perspectives.

  • High scalability: Following the scalable design paradigm SGAP in PaSca, SGL can scale to graph data with billions of nodes and edges.
  • Auto neural architecture search: SGL can automatically choose decent and scalable graph neural architectures according to specific tasks and pre-defined multiple objectives (e.g., inference time, memory cost, and predictive performance).
  • Ease of use: SGL has user-friendly interfaces for implementing existing scalable GNNs and executing various downstream tasks.

Installation

Some datasets in SGL are constructed based on PyG. Please follow the link below to install PyG first before installing SGL: https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html.

Install from pip

To install SGL from PyPI:

pip install sgl-dair

Quick Start

A quick start example is given by:

from sgl.dataset import Planetoid
from sgl.models.homo import SGC
from sgl.tasks import NodeClassification

dataset = Planetoid("pubmed", "./", "official")
model = SGC(prop_steps=3, feat_dim=dataset.num_features, num_classes=dataset.num_classes)

device = "cuda:0"
test_acc = NodeClassification(dataset, model, lr=0.1, weight_decay=5e-5, epochs=200, device=device).test_acc

An example of the auto neural network search functionality is as follows:

import torch
from openbox.optimizer.generic_smbo import SMBO

from sgl.dataset.planetoid import Planetoid
from sgl.search.search_config import ConfigManager

dataset = Planetoid("cora", "./", "official")
device = torch.device(f"cuda:{0}" if torch.cuda.is_available() else "cpu")

## Define Initial Arch and Configuration
initial_arch = [2, 0, 1, 2, 3, 0, 0]
configer = ConfigManager(initial_arch)
configer._setParameters(dataset, device, 128, 200, 1e-2, 5e-4)

## Define Search Parameters
dim = 7
bo = SMBO(configer._configFunction,
          configer._configSpace(),
          num_objs=2,
          num_constraints=0,
          max_runs=3500,
          surrogate_type='prf',
          acq_type='ehvi',
          acq_optimizer_type='local_random',
          initial_runs=2 * (dim + 1),
          init_strategy='sobol',
          ref_point=[-1, 0.00001],
          time_limit_per_trial=5000,
          task_id='quick_start',
          random_state=1)

## Search
history = bo.run()
print(history)

The distributed version of the graph neural architecture search is built on the code used by our cooperation partner Tencent, and we will release this part ASAP.

PaSca: a Graph Neural Architecture Search System under the Scalable Paradigm[PDF]
Wentao Zhang, Yu Shen, Zheyu Lin, Yang Li, Xiaosen Li, Wen Ouyang, Yangyu Tao, Zhi Yang, and Bin Cui.
The world wide web conference.
WWW 2022, CCF-A, 🏆 Best Student Paper Award (among 1822 submmisions)

Node Dependent Local Smoothing for Scalable Graph Learning [PDF]
Wentao Zhang, Mingyu Yang, Zeang Sheng, Yang Li, Wen Ouyang, Yangyu Tao, Zhi Yang, Bin Cui.
Thirty-fifth Conference on Neural Information Processing Systems.
NeurIPS 2021, CCF-A, Spotlight Presentation, Acceptance Rate: < 3%.

NAFS: A Simple yet Tough-to-beat Baseline for Graph Representation Learning. [To appear]
Wentao Zhang, Zeang Sheng, Mingyu Yang, Yang Li, Yu Shen, Zhi Yang, Bin Cui.
The 39th International Conference on Machine Learning.
ICML 2022, CCF-A.

Deep and Flexible Graph Neural Architecture Search. [To appear]
Wentao Zhang, Yu Shen, Zheyu Lin, Yang Li, Zhi Yang, Bin Cui.
The 39th International Conference on Machine Learning.
ICML 2022, CCF-A.

An Empirical Study of Deep Graph Neural Networks. [To appear]
Wentao Zhang, Zeang Sheng, Yuezihan Jiang, Yikuan Xia, Jun Gao, Zhi Yang, Bin Cui.
SIGKDD Conference on Knowledge Discovery and Data Mining.
KDD 2022, CCF-A.

Graph Attention Multi-Layer Perceptron [PDF]
Wentao Zhang, Ziqi Yin, Zeang Sheng, Wen Ouyang, Xiaosen Li, Yangyu Tao, Zhi Yang, Bin Cui.
ACM SIGKDD Conference on Knowledge Discovery and Data Mining.
KDD 2022, CCF-A, Rank #1 in Open Graph Benchmark

OpenBox: A Generalized Black-box Optimization Service [PDF]
Yang Li, Yu Shen, Wentao Zhang, Yuanwei Chen, ..., Wentao Wu, Zhi Yang, Ce Zhang, Bin Cui.
ACM SIGKDD Conference on Knowledge Discovery and Data Mining.
KDD 2021, CCF-A, top prize in open-source innovation competition @ 2021 CCF ChinaSoft

Citing SGL

Please cite our paper if you find SGL useful in your work:

@inproceedings{zhang2022pasca,
  title={PaSca: A Graph Neural Architecture Search System under the Scalable Paradigm},
  author={Zhang, Wentao and Shen, Yu and Lin, Zheyu and Li, Yang and Li, Xiaosen and Ouyang, Wen and Tao, Yangyu and Yang, Zhi and Cui, Bin},
  booktitle={Proceedings of the ACM Web Conference 2022},
  pages={1817--1828},
  year={2022}
}

Contact

If you have any technical questions, please submit new issues.

If you have any other questions, please contact: Wentao Zhang[wentao.zhang@pku.edu.cn] and Zeang Sheng[shengzeang18@pku.edu.cn].

License

The entire codebase is under MIT license.

Metadata

Release files for sgl-dair 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sgl-dair 0.1.5
File Size Uploaded Provenance Actions
sgl-dair-0.1.5.tar.gz 69.2 kB Without provenance Details for sgl-dair-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sgl-dair 0.1.5
File Interpreter ABI Platform Actions
sgl_dair-0.1.5-py3-none-any.whl Python 3 none any Details for sgl_dair-0.1.5-py3-none-any.whl

Total release size: 177.0 kB

Release files / sgl-dair-0.1.5.tar.gz

Download URL sgl-dair-0.1.5.tar.gz
Size 69.2 kB
Tags Source
SHA-256 checksum
How to use checksums
99827f41882e303a526c72373cf05d00ef40594a5d39013937829e4c6553c760
BLAKE2b-256 checksum
How to use checksums
1e5d315b4ddb93420ac4468d9e8c4e1e69e484b88d505af7ac9f74c1648c192b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/35.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.50.2 importlib-metadata/4.11.3 keyring/21.4.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.5

Release files / sgl_dair-0.1.5-py3-none-any.whl

Download URL sgl_dair-0.1.5-py3-none-any.whl
Size 107.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a528fd321c2c167ec16fe9eef741af7c90d5d0003f517e91b098bb722a19778a
BLAKE2b-256 checksum
How to use checksums
7e1fc4cf24eb55632d9dfc1bac0d9b158dabd0530d64bcaa254a7d83f3ebae1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/35.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.50.2 importlib-metadata/4.11.3 keyring/21.4.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.5

Security for sgl-dair 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page