← 开源
rampasek

GraphGPS

Recipe for a General, Powerful, Scalable Graph Transformer

Model DevelopmentArchitecturePython
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
880
Star
160
Fork
+0
本周
2
贡献者
创建于 2022-05-24 · 更新于 2026-09-30 · 今日第 12950 名
主要开发者
rampasekluis-mueller

rampasek/GraphGPS 排名第 12,950,有 880 个星标。

同类别比较

rampasek/GraphGPS 排名第 12,950,此处有 8 个同类条目;nxxcxx/Neural-Network 排名第 12,949。

同类别比较
名称排名指标
malmaud/TensorFlow.jl12,941
语言:
Julia
星标数:
881
分叉数:
109
简介:
A Julia wrapper for TensorFlow
woven-by-toyota/l5kit12,943
语言:
Python
星标数:
881
分叉数:
271
简介:
L5Kit - https://woven.toyota
yzhangcs/parser12,944
语言:
Python
星标数:
881
分叉数:
158
简介:
:rocket: State-of-the-art parsers for natural language.
nxxcxx/Neural-Network12,949
语言:
JavaScript
星标数:
880
分叉数:
143
简介:
Abstract visualization of biological neural network
xlang-ai/Spider212,952
语言:
HTML
星标数:
880
分叉数:
153
简介:
[ICLR 2025 Oral] Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflows
QData/spacetimeformer12,955
语言:
Jupyter Notebook
星标数:
879
分叉数:
201
简介:
Multivariate Time Series Forecasting with efficient Transformers. Code for the paper "Long-Range Transformers for Dynamic Spatiotemporal Forecasting."
dmlc/dmlc-core12,959
语言:
C++
星标数:
878
分叉数:
525
简介:
A common bricks library for building scalable and portable distributed machine learning.
lucidrains/RETRO-pytorch12,961
语言:
Python
星标数:
878
分叉数:
108
简介:
Implementation of RETRO, Deepmind's Retrieval based Attention net, in Pytorch
关键参数与规格
关键参数与规格
参数值
语言Python
类别Model Development
子类别Architecture
关键词Benchmarks, Datasets, Graph, Research
星标数880
分叉数160
贡献者2
创建日期2022-05-24
更新日期2026-09-30
1 天星标数0
7 天星标数0
排名12,950
上次排名12,850
排名变化-100
7 天星标排名13,687
上次 7 天星标排名13,701
7 天星标排名变化14
总星标排名12,317
上次总星标排名12,294
总星标排名变化-23
国家UK
README 摘录

GraphGPS: General Powerful Scalable Graph Transformers How to build a graph Transformer? We provide a 3-part recipe on how to build graph Transformers with linear complexity. Our GPS recipe consists of choosing 3 main ingredients: 1. positional/structural encoding: LapPE, RWSE, SignNet, EquivStableLapPE 2. local message-passing mechanism: GatedGCN, GINE, PNA 3. global attention mechanism: Transformer, Performer, BigBird In this *GraphGPS* package we provide several positional/structural encodings and model choices, implementing the GPS recipe. GraphGPS is built using

PyG and GraphGym from PyG2. Python environment setup with Conda Running GraphGPS Running GraphGPS on OGB-LSC PCQM4Mv2 Training Expected performance Note 1: For training we set aside 150k molecules as a custom validation set for the model selection / early stopping. The official set is used as the testing set in our training setup. For running inference on and look further below. Note 2: GPS-medium took ~48h, GPS-deep ~60h to train on a single NVidia A100 GPU. Your

reproduced results may slightly vary. Note 3: This version of GPS **does not** use 3D atomic position information. 0852 | Inference and submission files for OGB-LSC leaderboard You need a saved pretrained model from the previous step, then run it with an "inference" script that loads official , , and splits, then runs inference, and the official OGB Evaluator. Benchmarking GPS on 11 datasets See script to run multiple random seeds per each of the 11 datasets. Alternatively, you can run them

in terminal following the example below. W&B logging To use W&B logging, set and have a entity set-up in your W&B account (or change it to whatever else you like by setting ). Unit tests To run all unit tests, execute from the project root directory: Or specify a particular test module, e. : Citation If you find this work useful, please cite our NeurIPS 2022 paper:

常见问题

记录了多少星标和分叉?

rampasek/GraphGPS 有 880 个星标和 160 个分叉。

仓库排名是多少?

rampasek/GraphGPS 排名第 12,950。

记录的语言和类别是什么?

rampasek/GraphGPS 有 880 个星标,语言为 Python,类别为 Model Development。

哪个仓库排名最接近?

rampasek/GraphGPS 与 nxxcxx/Neural-Network 比较,后者排名第 12,949,有 880 个星标。

README

GraphGPS: General Powerful Scalable Graph Transformers

How to build a graph Transformer? We provide a 3-part recipe on how to build graph Transformers with linear complexity. Our GPS recipe consists of choosing 3 main ingredients:

  1. positional/structural encoding: LapPE, RWSE, SignNet, EquivStableLapPE
  2. local message-passing mechanism: GatedGCN, GINE, PNA
  3. global attention mechanism: Transformer, Performer, BigBird

In this GraphGPS package we provide several positional/structural encodings and model choices, implementing the GPS recipe. GraphGPS is built using PyG and GraphGym from PyG2. Specifically PyG v2.2 is required.

Python environment setup with Conda

conda create -n graphgps python=3.10
conda activate graphgps

conda install pytorch=1.13 torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
conda install pyg=2.2 -c pyg -c conda-forge
pip install pyg-lib -f https://data.pyg.org/whl/torch-1.13.0+cu117.html

# RDKit is required for OGB-LSC PCQM4Mv2 and datasets derived from it.  
conda install openbabel fsspec rdkit -c conda-forge

pip install pytorch-lightning yacs torchmetrics
pip install performer-pytorch
pip install tensorboardX
pip install ogb
pip install wandb

conda clean --all

Running GraphGPS

conda activate graphgps

# Running GPS with RWSE and tuned hyperparameters for ZINC.
python main.py --cfg configs/GPS/zinc-GPS+RWSE.yaml  wandb.use False

# Running config with tuned SAN hyperparams for ZINC.
python main.py --cfg configs/SAN/zinc-SAN.yaml  wandb.use False

# Running a debug/dev config for ZINC.
python main.py --cfg tests/configs/graph/zinc.yaml  wandb.use False

Running GraphGPS on OGB-LSC PCQM4Mv2

Training

# "small" GPS (GatedGCN+Transformer) with RWSE: 5layers, 304dim, 6152001 params 
python main.py --cfg configs/GPS/pcqm4m-GPS+RWSE.yaml
# "medium" GPS (GatedGCN+Transformer) with RWSE: 10layers, 384dim, 19414641 params
python main.py --cfg configs/GPS/pcqm4m-GPSmedium+RWSE.yaml
# "deep" GPS (GatedGCN+Transformer) with RWSE: 16layers, 256dim, 13807345 params
python main.py --cfg configs/GPS/pcqm4m-GPSdeep+RWSE.yaml

Expected performance

  • Note 1: For training we set aside 150k molecules as a custom validation set for the model selection / early stopping. The official valid set is used as the testing set in our training setup. For running inference on test-dev and test-challenge look further below.

  • Note 2: GPS-medium took ~48h, GPS-deep ~60h to train on a single NVidia A100 GPU. Your reproduced results may slightly vary.

  • Note 3: This version of GPS does not use 3D atomic position information.

Model config parameters train MAE custom valid MAE official valid MAE
GPS-small 6,152,001 0.0638 0.0849 0.0937
GPS-medium 19,414,641 0.0726 0.0805 0.0858
GPS-deep 13,807,345 0.0641 0.0796 0.0852

Inference and submission files for OGB-LSC leaderboard

You need a saved pretrained model from the previous step, then run it with an "inference" script that loads official valid, test-dev, and test-challenge splits, then runs inference, and the official OGB Evaluator.

# You can download our pretrained GPS-deep (151 MB).
wget https://www.dropbox.com/s/aomimvak4gb6et3/pcqm4m-GPS%2BRWSE.deep.zip
unzip pcqm4m-GPS+RWSE.deep.zip -d pretrained/

# Run inference and official OGB Evaluator.
python main.py --cfg configs/GPS/pcqm4m-GPSdeep-inference.yaml 

# Result files for OGB-LSC Leaderboard.
results/pcqm4m-GPSdeep-inference/0/y_pred_pcqm4m-v2_test-challenge.npz
results/pcqm4m-GPSdeep-inference/0/y_pred_pcqm4m-v2_test-dev.npz

Benchmarking GPS on 11 datasets

See run/run_experiments.sh script to run multiple random seeds per each of the 11 datasets. We rely on Slurm job scheduling system.

Alternatively, you can run them in terminal following the example below. Configs for all 11 datasets are in configs/GPS/.

conda activate graphgps
# Run 10 repeats with 10 different random seeds (0..9):
python main.py --cfg configs/GPS/zinc-GPS+RWSE.yaml  --repeat 10  wandb.use False
# Run a particular random seed:
python main.py --cfg configs/GPS/zinc-GPS+RWSE.yaml  --repeat 1  seed 42  wandb.use False

W&B logging

To use W&B logging, set wandb.use True and have a gtransformers entity set-up in your W&B account (or change it to whatever else you like by setting wandb.entity).

Unit tests

To run all unit tests, execute from the project root directory:

python -m unittest -v

Or specify a particular test module, e.g.:

python -m unittest -v unittests.test_eigvecs

Citation

If you find this work useful, please cite our NeurIPS 2022 paper:

@article{rampasek2022GPS,
  title={{Recipe for a General, Powerful, Scalable Graph Transformer}}, 
  author={Ladislav Ramp\'{a}\v{s}ek and Mikhail Galkin and Vijay Prakash Dwivedi and Anh Tuan Luu and Guy Wolf and Dominique Beaini},
  journal={Advances in Neural Information Processing Systems},
  volume={35},
  year={2022}
}
排名相邻
同类项目