项目文件夹

文件
Quan (Andy) Gan d41d07d0f6 [Doc and bugfix] Add docs and user guide and update tutorial for sampling pipeline (#3774)
* huuuuge update

* remove

* lint

* lint

* fix

* what happened to nccl

* update multi-gpu unsupervised graphsage example

* replace most of the dgl.mp.process with torch.mp.spawn

* update if condition for use_uva case

* update user guide

* address comments

* incorporating suggestions from @jermainewang

* oops

* fix tutorial to pass CI

* oops

* fix again

Co-authored-by: Xin Yao <xiny@nvidia.com>
2022-02-28 02:21:51 +08:00
..

Baseline Code for MAG240M

The code is ported from the R-GAT examples here. Please refer to the OGB-LSC paper for the detailed setting.

Installation Requirements

ogb>=1.3.0
torch>=1.7.0

Running Preprocessing Script

python preprocess.py \
    --rootdir . \
    --author-output-path ./author.npy \
    --inst-output-path ./inst.npy \
    --graph-output-path ./graph.dgl \
    --graph-as-homogeneous \
    --full-output-path ./full.npy

This will give you the following files:

  • author.npy: The author features, preprocessed by averaging the neighboring paper features.
  • inst.npy: The institution features, preprocessed by averaging the neighboring author features.
  • graph.dgl: The homogenized DGL graph stored in CSC format, which is friendly for neighbor sampling. Edge types are stored on the edges as an int8 feature. Nodes are in the order of author, institution, and paper.
  • full.npy: The concatenated author, institution, and paper features.

Since that will usually take a long time, we also offer the above files for download:

In addition, we offer

  • full_feat.npy: The preprocessed full feature matrix for running OGB's own baseline. Note that the features are concatenated in the order of paper, author, and institution, unlike the one in our baseline code. It is also preprocessed in float32 arithmetics instead of float16 arithmetics.

Running Training Script

python train.py \
    --rootdir . \
    --graph-preprocess-path ./graph.dgl \
    --full-preprocess-path ./full.npy

The validation accuracy is 0.701. We do not have ground truth test labels so we do not report test accuracy.

Hardware configurations

We successfully run 8 experiments in parallel on an AWS p4d.24x large instance with the preprocessed feature matrices stored on an NVMe SSD to enable fast disk read. Each experiment requires less than 128GB CPU memory and less than 12GB GPU memory to run. Every epoch takes around 6 minutes 30 seconds to train and 1 minutes 40 seconds to validate.

If your hard drive is slow, it is best to load all the features into memory for a reasonable training speed. The CPU memory consumption will go up to as large as 512GB though.