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

[cugraph-pyg] Add TransformerConv and support for bipartite node features in GATConv #3489

Merged
merged 25 commits into from
May 12, 2023

Conversation

@tingyu66 tingyu66 requested a review from a team as a code owner April 14, 2023 21:59
@tingyu66 tingyu66 added feature request New feature or request non-breaking Non-breaking change labels Apr 17, 2023
@tingyu66 tingyu66 requested a review from a team as a code owner April 21, 2023 02:02
super().__init__()

if HAS_PYLIBCUGRAPHOPS is False:
raise ModuleNotFoundError(
Copy link
Contributor

Choose a reason for hiding this comment

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

You should also actually check for >= 23.04

Copy link
Member Author

Choose a reason for hiding this comment

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

We did check this implicitly via

try:  # pragma: no cover
    from pylibcugraphops.pytorch import (
        BipartiteCSC,
        SampledCSC,
        SampledHeteroCSC,
        StaticCSC,
        StaticHeteroCSC,
    )

as these structures are not available <23.04.

Do you prefer to explicitly check the version?

def forward(
self,
x: Union[torch.Tensor, Tuple[torch.Tensor, torch.Tensor]],
csc: Tuple[torch.Tensor, torch.Tensor, int],
Copy link
Contributor

Choose a reason for hiding this comment

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

I know that it is like that in upstream but in the longer term, we should have our own graph structure. I am in the process of defining a single class which can represent all our cases. This should make things less opaque and later allow things like using the (optional) "reverse graph structure".

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we can update all modules in one go after finalizing the god class that you have been working on.

representation to the desired format.
edge_attr: (torch.Tensor, optional) The edge features.
"""
bipartite = not isinstance(x, torch.Tensor)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
bipartite = not isinstance(x, torch.Tensor)
bipartite = isinstance(x, Tuple)

Copy link
Member Author

Choose a reason for hiding this comment

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

This was intended for also accepting a pair in list.

@tingyu66 tingyu66 self-assigned this Apr 21, 2023
@@ -179,6 +179,7 @@ if [[ "${RAPIDS_CUDA_VERSION}" == "11.8.0" ]]; then
--channel "${PYTHON_CHANNEL}" \
libcugraph \
pylibcugraph \
pylibcugraphops \
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
pylibcugraphops \

This list is reserved for only packages that are built as part of the cugraph repository workflow.

If this is a run time dependency, it should be added to the relevant conda recipe and the relevant dependencies.yaml section.

If it's strictly a test dependency, it should only be added to the relevant dependencies.yaml section so it can be used in the conda environment that's generated earlier in this script.

Copy link
Member Author

Choose a reason for hiding this comment

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

@ajschmidt8 I would still need to add pylibcugraphops to this file to enable relevant tests in cugraph_pyg.

I understand that this code block:
https://github.com/rapidsai/cugraph/blob/branch-23.06/ci/test_python.sh#L31-L38
is reserved for cugraph packages.

The one that I modified is in test_cugraph_pyg, which is intended for including additional test dependencies (like pytorch) without polluting the dependencies.yaml. @alexbarghi-nv, correct me if I am wrong, since I am not involved in the original discussion of this design.

If you look at the code block for test_cugraph_dgl, pylibcugraphops is already there.

tingyu66 and others added 3 commits April 26, 2023 16:23
Co-authored-by: AJ Schmidt <ajschmidt8@users.noreply.github.com>
@tingyu66
Copy link
Member Author

This PR now also adds GATv2Conv model.
Fixes https://github.com/rapidsai/graph_dl/issues/184.

@ajschmidt8 ajschmidt8 dismissed their stale review May 4, 2023 14:06

changes addressed

@tingyu66 tingyu66 requested a review from rlratzel May 10, 2023 21:34
@rlratzel
Copy link
Contributor

/merge

@tingyu66 tingyu66 requested a review from ajschmidt8 May 11, 2023 21:35
Copy link
Member

@ajschmidt8 ajschmidt8 left a comment

Choose a reason for hiding this comment

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

Approving ops-codeowner file changes

@rapids-bot rapids-bot bot merged commit c9234ef into rapidsai:branch-23.06 May 12, 2023
@tingyu66 tingyu66 deleted the transformer_conv branch May 12, 2023 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants