Skip to content

Graph Sage OGBN Example with Scheduler #9877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 16, 2025

Conversation

RorryB
Copy link
Contributor

@RorryB RorryB commented Dec 17, 2024

This PR is to update the ogbn example to have a scheduler, improving performance from a test accuracy of 75.52% to 77.19%

…ng, that file with an added scheduler, and the scheduler file with Perforated Backpropagation
@RorryB RorryB requested a review from wsad1 as a code owner December 17, 2024 20:09
@RorryB RorryB closed this Dec 18, 2024
@RorryB RorryB reopened this Dec 18, 2024
@RorryB RorryB changed the title Graph Sage OGBN Example with Perforated Backpropagation Graph Sage OGBN Example with Scheduler Jan 8, 2025
@puririshi98 puririshi98 self-requested a review January 16, 2025 22:32
Copy link
Contributor

@puririshi98 puririshi98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for addressing my offline comments, this looks good now

@puririshi98 puririshi98 merged commit 6a1db07 into pyg-team:master Jan 16, 2025
16 checks passed
puririshi98 pushed a commit that referenced this pull request Apr 22, 2025
This PR is to include an example of how Perforated Backpropagation can
be used to improve pytorch_geometric models. It adds on the [previous
PR](#9877) which added
a scheduler, both of which improve upon the test accuracy of the
original ogbn_train.py example.

Perforated Backpropagation empowers each neuron in a PyTorch network
with Dendrite nodes. These nodes are outside the network, but able to
inform the neurons inside the network to make better decisions by
leveraging a covariance based learning rule to reduce residual error.
The PyTorch add-on combines modern neuroscience with modern software to
create neural networks that are smarter, smaller, and more accurate.

Run docker from torch_geometric directory

docker run --gpus all -i --shm-size=8g -v .:/pai -w /pai -t
nvcr.io/nvidia/pyg:24.11-py3 /bin/bash

Within Docker

    pip install -e .
    pip install safetensors
    pip install perforatedai

    
Ran original with:

CUDA_VISIBLE_DEVICES=0 python examples/ogbn_train.py --dataset
ogbn-products --batch_size 128 --model sage

Results:

    Test Accuracy: 77.06%
    
Run PAI with:

PAIEMAIL=YourEmail PAITOKEN=YourToken CUDA_VISIBLE_DEVICES=0 python
ogbn_train_perforatedai.py --dataset ogbn-products --batch_size 128
--saveName ogbnPAI --model sage
    
Results:

    Test Accuracy: 78.05%

Update: Example updated to include base usage with default SGFormer.

Original:

CUDA_VISIBLE_DEVICES=0 python ogbn_train.py --dataset ogbn-products
--batch_size 128
 
Results:

    Test Accuracy: 80.86%
 
PAI:

PAIEMAIL=YourEmail PAITOKEN=YourToken CUDA_VISIBLE_DEVICES=0 python
ogbn_train_perforatedai.py --dataset ogbn-products --batch_size 128
--saveName ogbnPAI
 
Results:

    Test Accuracy: 81.27%

---------

Co-authored-by: Akihiro Nitta <nitta@akihironitta.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants