Skip to content
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

[Sparse] Add a graphSAGE example #6481

Merged
merged 10 commits into from
Nov 3, 2023

Conversation

xiangyuzhi
Copy link
Collaborator

@xiangyuzhi xiangyuzhi commented Oct 20, 2023

Description

A sparse graphSAGE example.
Run example:

$ python examples/sparse/graphsage.py
Training in gpu mode.
Loading data
Training...
[W TensorAdvancedIndexing.cpp:1615] Warning: scatter_reduce() is in beta and the API may change at any time. (function operator())
Epoch 00000 | Loss 2.0963 | Accuracy 0.7756 
Epoch 00001 | Loss 0.8108 | Accuracy 0.8443 
Epoch 00002 | Loss 0.6264 | Accuracy 0.8593 
Epoch 00003 | Loss 0.5662 | Accuracy 0.8675 
Epoch 00004 | Loss 0.5311 | Accuracy 0.8721 
Epoch 00005 | Loss 0.5047 | Accuracy 0.8744 
Epoch 00006 | Loss 0.4846 | Accuracy 0.8759 
Epoch 00007 | Loss 0.4766 | Accuracy 0.8756 
Epoch 00008 | Loss 0.4674 | Accuracy 0.8796 
Epoch 00009 | Loss 0.4528 | Accuracy 0.8799 
Testing...
Test accuracy 0.7216

Checklist

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [$CATEGORY] (such as [NN], [Model], [Doc], [Feature]])
  • I've leverage the tools to beautify the python and c++ code.
  • The PR is complete and small, read the Google eng practice (CL equals to PR) to understand more about small PR. In DGL, we consider PRs with less than 200 lines of core code change are small (example, test and documentation could be exempted).
  • All changes have test coverage
  • Code is well-documented
  • To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change
  • Related issue is referred in this PR
  • If the PR is for a new model/paper, I've updated the example index here.

Changes

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 20, 2023

To trigger regression tests:

  • @dgl-bot run [instance-type] [which tests] [compare-with-branch];
    For example: @dgl-bot run g4dn.4xlarge all dmlc/master or @dgl-bot run c5.9xlarge kernel,api dmlc/master

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 20, 2023

Commit ID: d426263f8e759366aab80b486033a939d10ad04e

Build ID: 1

Status: ✅ CI test succeeded.

Report path: link

Full logs path: link

examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 23, 2023

Commit ID: c930fd0e02292d7c4e9edb856b2e8b2d4c2637f7

Build ID: 2

Status: ❌ CI test failed in Stage [Torch GPU Unit test].

Report path: link

Full logs path: link

@xiangyuzhi
Copy link
Collaborator Author

@dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 23, 2023

Commit ID: 77d8be953322cfb7ed14bb28bbbdcd80d620d213

Build ID: 3

Status: ✅ CI test succeeded.

Report path: link

Full logs path: link

@czkkkkkk
Copy link
Collaborator

This should serve as a sampling-based training example, illustrating how sparse APIs support sampling. Let's have a chat tomorrow to discuss how to implement these changes.

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 26, 2023

Commit ID: 7f2f74b623954199831445b81b79704bebe5f836

Build ID: 4

Status: ⚪️ CI test cancelled due to overrun.

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 26, 2023

Commit ID: f4c1cf9a2263547f580188ffc32023b64a92dcb9

Build ID: 5

Status: ✅ CI test succeeded.

Report path: link

Full logs path: link

examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 30, 2023

Commit ID: e5afbe9b22165ea84a36d3c88a905c2b4dd711b6

Build ID: 6

Status: ✅ CI test succeeded.

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Oct 30, 2023

Commit ID: 64412c2bb24a3941ac45aaaac5b16a0273a943bb

Build ID: 7

Status: ✅ CI test succeeded.

Report path: link

Full logs path: link

Copy link
Collaborator

@czkkkkkk czkkkkkk left a comment

Choose a reason for hiding this comment

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

LGTM

examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/graphsage.py Outdated Show resolved Hide resolved
@dgl-bot
Copy link
Collaborator

dgl-bot commented Nov 1, 2023

Commit ID: a9ef2eed3c011da9ff2b6698e44ecba6a7764ec4

Build ID: 8

Status: ✅ CI test succeeded.

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Nov 1, 2023

Commit ID: bfaf79a50a6480d0243404c0e13eab9725e908f8

Build ID: 9

Status: ✅ CI test succeeded.

Report path: link

Full logs path: link

examples/sparse/sampling/graphsage.py Outdated Show resolved Hide resolved
examples/sparse/sampling/graphsage.py Outdated Show resolved Hide resolved
@dgl-bot
Copy link
Collaborator

dgl-bot commented Nov 2, 2023

Commit ID: 14402b3d18c7fa3d54829c08730cc67d4769bc45

Build ID: 10

Status: ✅ CI test succeeded.

Report path: link

Full logs path: link

Copy link
Collaborator

@czkkkkkk czkkkkkk left a comment

Choose a reason for hiding this comment

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

LGTM

@xiangyuzhi xiangyuzhi merged commit 419799b into dmlc:master Nov 3, 2023
2 checks passed
peizhou001 pushed a commit to peizhou001/dgl that referenced this pull request Nov 27, 2023
DominikaJedynak pushed a commit to DominikaJedynak/dgl that referenced this pull request Mar 12, 2024
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.

None yet

4 participants