Skip to main content

Graph Neural Network (GNN) toolkit targeting scalable graph learning

Project description

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.

Library Highlights

  • High scalability: Follow the scalable design paradigm SGAP in PaSca, SGL scale to graph data with billions of nodes and edges.
  • Auto neural architecture search: Automatically choose decent neural architectures according to specific tasks, and pre-defined objectives (e.g., inference time).
  • Ease of use: User-friendly interfaces of 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 sgl.dataset.planetoid import Planetoid
from sgl.search.search_config import ConfigManager
from openbox.optimizer.generic_smbo import SMBO

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

initial_arch = [2, 0, 1, 2, 3, 0, 0]
configer = ConfigManager(initial_arch)
configer._setParameters(dataset, device, hiddim=64, epochs=200, lr=1e-2, wd=5e-4)

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)
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.

Related Publications

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

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%.

Graph Attention Multi-Layer Perceptron [PDF]
Wentao Zhang, Ziqi Yin, Zeang Sheng, Wen Ouyang, Xiaosen Li, Yangyu Tao, Zhi Yang, Bin Cui.
arXiv:2108.10097, 2021. (arXiv preprint).

License

The entire codebase is under MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sgl-dair-0.1.2.tar.gz (45.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sgl_dair-0.1.2-py3-none-any.whl (76.1 kB view details)

Uploaded Python 3

File details

Details for the file sgl-dair-0.1.2.tar.gz.

File metadata

  • Download URL: sgl-dair-0.1.2.tar.gz
  • Upload date:
  • Size: 45.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.8

File hashes

Hashes for sgl-dair-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0f5b9bae9c1445527fd19cb6d6fe8711064c775155767fe180432d3f03f7d170
MD5 83bb87e81032f2ca22bea275efae0b01
BLAKE2b-256 70db0553a6381ad70095f7dfc0f6c31ac056b7bef8c67567181d6c513df67fa5

See more details on using hashes here.

File details

Details for the file sgl_dair-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: sgl_dair-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 76.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.8

File hashes

Hashes for sgl_dair-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ba7f281093227ae593bcb80855144034112fa5476a878c6bb4a23776d4c778a6
MD5 5a913dec7a48837b9496fa66e3aef502
BLAKE2b-256 c23f93bfed941125e4f65e5e9b9fff82c9596d868b7903a064c5c71435c7c11c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page