Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

[Model] Add dgl.nn.CuGraphGATConv model #5168

Merged
merged 16 commits into from
Mar 4, 2023
Merged

[Model] Add dgl.nn.CuGraphGATConv model #5168

merged 16 commits into from
Mar 4, 2023

Conversation

tingyu66
Copy link
Contributor

@tingyu66 tingyu66 commented Jan 12, 2023

Description

This PR adds a GATConv model Add dgl.nn.CuGraphGATConv that uses the accelerated sparse aggregation primitives in cugraph-ops. It requires pylibcugraphops >= 23.02.

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

  • new nn.Module CuGraphGATConv
  • test to verify CuGraphGATConv

Notes

Fixes rapidsai/cugraph-ops#181.

@dgl-bot
Copy link
Collaborator

dgl-bot commented Jan 12, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Jan 12, 2023

Commit ID: 77190b5

Build ID: 1

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Jan 12, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Jan 12, 2023

Commit ID: 0a38b87

Build ID: 2

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@tingyu66 tingyu66 marked this pull request as draft January 12, 2023 21:12
@dgl-bot
Copy link
Collaborator

dgl-bot commented Jan 19, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Jan 19, 2023

Commit ID: 491556ea28f3af0d3e5666d6606a82945a849c4f

Build ID: 3

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@tingyu66 tingyu66 marked this pull request as ready for review January 20, 2023 03:57
@dgl-bot
Copy link
Collaborator

dgl-bot commented Jan 20, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Jan 20, 2023

Commit ID: 3de8a1162c329228359c46bf417ec82d94cddc3c

Build ID: 4

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Jan 26, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Jan 26, 2023

Commit ID: 2b1466f96f7e896a10f0a071563ca8e1aa0a6641

Build ID: 5

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@tingyu66 tingyu66 changed the title [DO NOT MERGE][Model] Add dgl.nn.CuGraphGATConv model [Model] Add dgl.nn.CuGraphGATConv model Feb 2, 2023
@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 2, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 2, 2023

Commit ID: 6cc6d9da8c9133983d58918ea8c2041297dbcf00

Build ID: 6

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 22, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 22, 2023

Commit ID: 00caff3

Build ID: 7

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@tingyu66 tingyu66 marked this pull request as draft February 22, 2023 03:45
@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 22, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 22, 2023

Commit ID: 8772917

Build ID: 8

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 22, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@mufeili
Copy link
Member

mufeili commented Feb 27, 2023

@dgl-bot

@mufeili
Copy link
Member

mufeili commented Feb 27, 2023

@mufeili This PR for CuGraphGATConv is also ready for review.

Compared to GATConv, the cugraph variant lacks support for:

  • attn_drop option to drop out attention weights
  • different feature sizes for source and destination nodes

Performance-wise, in the examples/pytorch/gat/train.py (full-graph) example with pubmed dataset, CuGraphGATConv takes 4e-03s per epoch, while GATConv takes 1.2e-02s. Runs with other datasets demonstrated similar speedup numbers.

How about model accuracy?

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 27, 2023

Commit ID: b1882bb9c5937c882c40758664fb88bc0f78fb49

Build ID: 14

Status: ❌ CI test failed in Stage [Tensorflow CPU Unit test].

Report path: link

Full logs path: link

If not None, applies an activation function to the updated node features.
Default: ``None``.
bias : bool, optional
If True, learns a bias term. Defaults: ``True``.
Copy link
Member

Choose a reason for hiding this comment

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

What if the graph has zero-degree nodes?

Copy link
Contributor Author

@tingyu66 tingyu66 Feb 28, 2023

Choose a reason for hiding this comment

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

Their output features would be zero.

Copy link
Member

Choose a reason for hiding this comment

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

Is this consistent with the behavior of GATConv?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, GATConv also outputs zeros for zero-degree nodes.

Copy link
Member

@mufeili mufeili left a comment

Choose a reason for hiding this comment

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

done a pass

Co-authored-by: Mufei Li <mufeili1996@gmail.com>
@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 28, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 28, 2023

Commit ID: a86fb29131898b12330787d8ae7d843015e6f7ad

Build ID: 15

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

Co-authored-by: Mufei Li <mufeili1996@gmail.com>
@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 28, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 28, 2023

Commit ID: 6a69aa2a7e98219e0c9a5aa2dfb2bc9608d6abc6

Build ID: 16

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 28, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Feb 28, 2023

Commit ID: fd1dd5d3dc293c239cbc1d45f9bdd2d19cdf1544

Build ID: 17

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@tingyu66
Copy link
Contributor Author

@mufeili This PR for CuGraphGATConv is also ready for review.
Compared to GATConv, the cugraph variant lacks support for:

  • attn_drop option to drop out attention weights
  • different feature sizes for source and destination nodes

Performance-wise, in the examples/pytorch/gat/train.py (full-graph) example with pubmed dataset, CuGraphGATConv takes 4e-03s per epoch, while GATConv takes 1.2e-02s. Runs with other datasets demonstrated similar speedup numbers.

How about model accuracy?

We get the same accuracy number as the DGL in those examples.

@dgl-bot
Copy link
Collaborator

dgl-bot commented Mar 1, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Mar 1, 2023

Commit ID: 23d4485

Build ID: 18

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

Copy link
Member

@mufeili mufeili left a comment

Choose a reason for hiding this comment

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

I'm good.

@dgl-bot
Copy link
Collaborator

dgl-bot commented Mar 2, 2023

Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment:

  • @dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Mar 2, 2023

Commit ID: 0d6f3c4

Build ID: 19

Status: ❌ CI test failed in Stage [Authentication].

Report path: link

Full logs path: link

@mufeili
Copy link
Member

mufeili commented Mar 2, 2023

@dgl-bot

@dgl-bot
Copy link
Collaborator

dgl-bot commented Mar 2, 2023

Commit ID: 0d6f3c4

Build ID: 20

Status: ✅ CI test succeeded.

Report path: link

Full logs path: link

@mufeili mufeili merged commit bfd411d into dmlc:master Mar 4, 2023
@tingyu66 tingyu66 deleted the cugraphops-gatconv branch March 4, 2023 10:16
DominikaJedynak pushed a commit to DominikaJedynak/dgl that referenced this pull request Mar 12, 2024
* add CuGraphGATConv model

* lintrunner

* update model to reflect changes in make_mfg_csr(), move max_in_degree to forward()

* simplify pytest markers

* fall back to FG option for large fanout

* update error msg

* add feat_drop and activation options

* add residual option

* Update python/dgl/nn/pytorch/conv/cugraph_gatconv.py

Co-authored-by: Mufei Li <mufeili1996@gmail.com>

* Update python/dgl/nn/pytorch/conv/cugraph_gatconv.py

Co-authored-by: Mufei Li <mufeili1996@gmail.com>

* reset res_fc

---------

Co-authored-by: Mufei Li <mufeili1996@gmail.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.

3 participants