Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e9cfc2e
Clean Up CuGraph-ops
puririshi98 Jul 24, 2025
c9d33d1
Update rgcn_conv.py
puririshi98 Jul 24, 2025
331e203
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 24, 2025
ee37a44
Update sage_conv.py
puririshi98 Jul 24, 2025
6a5f9fd
Merge branch 'master' into puririshi98-patch-2
puririshi98 Jul 29, 2025
f9ea537
Merge branch 'master' into puririshi98-patch-2
puririshi98 Aug 12, 2025
a3756ca
Merge branch 'master' into puririshi98-patch-2
puririshi98 Aug 26, 2025
4c77838
Merge branch 'master' into puririshi98-patch-2
puririshi98 Aug 26, 2025
9710deb
Merge branch 'master' into puririshi98-patch-2
puririshi98 Aug 26, 2025
dcc8c58
Merge branch 'master' into puririshi98-patch-2
puririshi98 Aug 27, 2025
6e8bdca
Merge branch 'master' into puririshi98-patch-2
puririshi98 Aug 28, 2025
5e04eb9
Update gat_conv.py
puririshi98 Aug 29, 2025
1eb8230
Update rgcn_conv.py
puririshi98 Aug 29, 2025
5087a29
Update sage_conv.py
puririshi98 Aug 29, 2025
fe68f02
Update installation.rst
puririshi98 Aug 29, 2025
4a1363a
Merge branch 'master' into puririshi98-patch-2
puririshi98 Sep 3, 2025
2bf89a8
Merge branch 'master' into puririshi98-patch-2
puririshi98 Sep 4, 2025
68d8609
Update gat_conv.py
puririshi98 Sep 4, 2025
e262c41
Update rgcn_conv.py
puririshi98 Sep 4, 2025
4ac4567
Update sage_conv.py
puririshi98 Sep 4, 2025
cfdce86
Update CHANGELOG.md
puririshi98 Sep 4, 2025
4519627
Update test_cugraph_gat_conv.py
puririshi98 Sep 4, 2025
bea1d91
Update gat_conv.py
puririshi98 Sep 4, 2025
ad0141a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 4, 2025
e1b220c
Update rgcn_conv.py
puririshi98 Sep 4, 2025
c4f6925
Update sage_conv.py
puririshi98 Sep 4, 2025
6ec3eb0
Merge branch 'master' into puririshi98-patch-2
puririshi98 Sep 9, 2025
07ae4ff
Update test_cugraph_gat_conv.py
puririshi98 Sep 9, 2025
117e95e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 9, 2025
4bf8a66
Update CHANGELOG.md
akihironitta Oct 31, 2025
69c87d8
Update docs/source/install/installation.rst
akihironitta Oct 31, 2025
4306b7b
Update test/nn/conv/cugraph/test_cugraph_gat_conv.py
akihironitta Oct 31, 2025
65bb7c0
trigger CI
puririshi98 Oct 31, 2025
ef0136f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 31, 2025
79657f3
empty commit to retriger
puririshi98 Nov 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

### Changed

- Added `edge_attr` in `CuGraphGATConv` ([#10383](https://github.com/pyg-team/pytorch_geometric/pull/10383))
- Adapt `dgcnn_classification` example to work with `ModelNet` and `MedShapeNet` Datasets ([#9823](https://github.com/pyg-team/pytorch_geometric/pull/9823))
- Chained exceptions explicitly instead of implicitly ([#10242](https://github.com/pyg-team/pytorch_geometric/pull/10242))
- Updated cuGraph examples to use buffered sampling which keeps data in memory and is significantly faster than the deprecated buffered sampling ([#10079](https://github.com/pyg-team/pytorch_geometric/pull/10079))
Expand Down
7 changes: 7 additions & 0 deletions docs/source/install/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,13 @@ If :conda:`null` :obj:`conda` does not pick up the correct CUDA version of :pyg:

conda install pyg=*=*cu* -c pyg

Enabling Accelerated cuGraph GNNs
---------------------------------

Currently, NVIDIA recommends `NVIDIA PyG Container <https://catalog.ngc.nvidia.com/orgs/nvidia/containers/pyg/tags>_` to use cuGraph integration in PyG.
This functionality is planned to be enabled through cuDNN which is part of PyTorch builds. We still recommend using the NVIDIA PyG Container regardless to have the fastest and most stable build of the NVIDIA CUDA stack combined with PyTorch and PyG.


Frequently Asked Questions
--------------------------

Expand Down
30 changes: 21 additions & 9 deletions test/nn/conv/cugraph/test_cugraph_gat_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
@pytest.mark.parametrize('bias', [True, False])
@pytest.mark.parametrize('bipartite', [True, False])
@pytest.mark.parametrize('concat', [True, False])
@pytest.mark.parametrize('edge_attr', [True, False])
@pytest.mark.parametrize('heads', [1, 2, 3])
@pytest.mark.parametrize('max_num_neighbors', [8, None])
def test_gat_conv_equality(bias, bipartite, concat, heads, max_num_neighbors):
def test_gat_conv_equality(bias, bipartite, concat, edge_attr, heads,
max_num_neighbors):
in_channels, out_channels = 5, 2
kwargs = dict(bias=bias, concat=concat)

Expand All @@ -32,17 +34,27 @@ def test_gat_conv_equality(bias, bipartite, concat, heads, max_num_neighbors):
conv2.lin.weight.data[:, :] = conv1.lin.weight.data
conv2.att.data[:heads * out_channels] = conv1.att_src.data.flatten()
conv2.att.data[heads * out_channels:] = conv1.att_dst.data.flatten()
if edge_attr and not bipartite:
e_attrs = torch.randn(size=(edge_index.size(1), 10))
out1 = conv1(x, edge_index, edge_attr=e_attrs)

if bipartite:
out1 = conv1((x, x[:size[1]]), edge_index)
out2 = conv2(
x,
EdgeIndex(edge_index, sparse_size=size),
max_num_neighbors=max_num_neighbors,
edge_attr=e_attrs,
)
else:
out1 = conv1(x, edge_index)
if bipartite:
out1 = conv1((x, x[:size[1]]), edge_index)
else:
out1 = conv1(x, edge_index)

out2 = conv2(
x,
EdgeIndex(edge_index, sparse_size=size),
max_num_neighbors=max_num_neighbors,
)
out2 = conv2(
x,
EdgeIndex(edge_index, sparse_size=size),
max_num_neighbors=max_num_neighbors,
)
assert torch.allclose(out1, out2, atol=1e-3)

grad_output = torch.rand_like(out1)
Expand Down
10 changes: 8 additions & 2 deletions torch_geometric/nn/conv/cugraph/gat_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class CuGraphGATConv(CuGraphModule): # pragma: no cover
:class:`~torch_geometric.nn.conv.GATConv` based on the :obj:`cugraph-ops`
package that fuses message passing computation for accelerated execution
and lower memory footprint.
The current method to enable :obj:`cugraph-ops`
is to use `The NVIDIA PyG Container
<https://catalog.ngc.nvidia.com/orgs/nvidia/containers/pyg>`_.
"""
def __init__(
self,
Expand Down Expand Up @@ -67,6 +70,7 @@ def forward(
self,
x: Tensor,
edge_index: EdgeIndex,
edge_attr: Tensor,
max_num_neighbors: Optional[int] = None,
) -> Tensor:
graph = self.get_cugraph(edge_index, max_num_neighbors)
Expand All @@ -75,10 +79,12 @@ def forward(

if LEGACY_MODE:
out = GATConvAgg(x, self.att, graph, self.heads, 'LeakyReLU',
self.negative_slope, False, self.concat)
self.negative_slope, False, self.concat,
edge_feat=edge_attr)
else:
out = GATConvAgg(x, self.att, graph, self.heads, 'LeakyReLU',
self.negative_slope, self.concat)
self.negative_slope, self.concat,
edge_feat=edge_attr)

if self.bias is not None:
out = out + self.bias
Expand Down
3 changes: 3 additions & 0 deletions torch_geometric/nn/conv/cugraph/rgcn_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class CuGraphRGCNConv(CuGraphModule): # pragma: no cover
:class:`~torch_geometric.nn.conv.RGCNConv` based on the :obj:`cugraph-ops`
package that fuses message passing computation for accelerated execution
and lower memory footprint.
The current method to enable :obj:`cugraph-ops`
is to use `The NVIDIA PyG Container
<https://catalog.ngc.nvidia.com/orgs/nvidia/containers/pyg>`_.
"""
def __init__(self, in_channels: int, out_channels: int, num_relations: int,
num_bases: Optional[int] = None, aggr: str = 'mean',
Expand Down
3 changes: 3 additions & 0 deletions torch_geometric/nn/conv/cugraph/sage_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class CuGraphSAGEConv(CuGraphModule): # pragma: no cover
:class:`~torch_geometric.nn.conv.SAGEConv` based on the :obj:`cugraph-ops`
package that fuses message passing computation for accelerated execution
and lower memory footprint.
The current method to enable :obj:`cugraph-ops`
is to use `The NVIDIA PyG Container
<https://catalog.ngc.nvidia.com/orgs/nvidia/containers/pyg>`_.
"""
def __init__(
self,
Expand Down
Loading