-
Notifications
You must be signed in to change notification settings - Fork 36
Add RAPIDS Doctor Check for cuGraph-PyG and pylibwholegraph #418
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
Open
alexbarghi-nv
wants to merge
15
commits into
rapidsai:main
Choose a base branch
from
alexbarghi-nv:feature/rapids-doctor-cugraph-pyg-pylibwholegraph
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
40cf546
Add smoke check entry points for pylibwholegraph and cugraph-pyg
alexbarghi-nv 1aef531
Update entry points for smoke checks in pylibwholegraph and cugraph-pyg
alexbarghi-nv f44a527
fix copyrights/style
alexbarghi-nv 2622444
remove debug files
alexbarghi-nv 3db88f6
update smoke test to test torch
alexbarghi-nv cb93dc2
remove cugraph-pyg check since it requires creating a process group
alexbarghi-nv d9e7947
fix import
alexbarghi-nv 96b7b26
add missing whitespace
alexbarghi-nv 6be24a0
add check for cuda support
alexbarghi-nv 0c623f7
check for cuda support in pytorch for cugraph-pyg
alexbarghi-nv 6c3ecd0
reset environment variables
alexbarghi-nv 23b948b
fix assertion/exception handling issues
alexbarghi-nv fa5a5a6
fix environment variable reset
alexbarghi-nv 25f0541
ensure destroy process group is only called if initialized
alexbarghi-nv 02c66e4
Merge branch 'main' into feature/rapids-doctor-cugraph-pyg-pylibwhole…
alexbarghi-nv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """ | ||
| Smoke check for `rapids doctor` (RAPIDS CLI). | ||
|
|
||
| See: https://github.com/rapidsai/rapids-cli#check-plugins | ||
| """ | ||
|
|
||
|
|
||
| def cugraph_pyg_smoke_check(**kwargs): | ||
| """ | ||
| A quick check to ensure cugraph-pyg can be imported and its core | ||
| submodules are loadable. | ||
| """ | ||
| try: | ||
| import cugraph_pyg | ||
|
|
||
| # Ensure core submodules load (touches pylibwholegraph, torch-geometric, etc.) | ||
| import cugraph_pyg.data | ||
| import cugraph_pyg.tensor | ||
|
|
||
| except ImportError as e: | ||
| raise ImportError( | ||
| "cugraph-pyg or its dependencies could not be imported. " | ||
| "Tip: install with `pip install cugraph-pyg` or use a RAPIDS conda environment." | ||
| ) from e | ||
|
|
||
| if not hasattr(cugraph_pyg, "__version__") or not cugraph_pyg.__version__: | ||
| raise AssertionError( | ||
| "cugraph-pyg smoke check failed: __version__ not found or empty" | ||
| ) | ||
|
|
||
| from cugraph_pyg.utils.imports import import_optional, MissingModule | ||
|
|
||
| torch = import_optional("torch") | ||
|
|
||
| if isinstance(torch, MissingModule): | ||
| import warnings | ||
|
|
||
| warnings.warn( | ||
| "PyTorch is required to use cuGraph-PyG. " | ||
| "Please install PyTorch from PyPI or Conda-Forge." | ||
| ) | ||
| else: | ||
| import os | ||
| from cugraph_pyg.data import GraphStore | ||
|
|
||
| os.environ["MASTER_ADDR"] = "localhost" | ||
| os.environ["MASTER_PORT"] = "29505" | ||
| os.environ["LOCAL_RANK"] = "0" | ||
| os.environ["WORLD_SIZE"] = "1" | ||
| os.environ["LOCAL_WORLD_SIZE"] = "1" | ||
| os.environ["RANK"] = "0" | ||
alexbarghi-nv marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| torch.distributed.init_process_group("nccl") | ||
alexbarghi-nv marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| graph_store = GraphStore() | ||
| graph_store.put_edge_index( | ||
| torch.tensor([[0, 1], [1, 2]]), | ||
| ("person", "knows", "person"), | ||
| "coo", | ||
| False, | ||
| (3, 3), | ||
| ) | ||
| edge_index = graph_store.get_edge_index(("person", "knows", "person"), "coo") | ||
| assert edge_index.shape == torch.Size([2, 2]) | ||
alexbarghi-nv marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| torch.distributed.destroy_process_group() | ||
alexbarghi-nv marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """ | ||
| Smoke check for `rapids doctor` (RAPIDS CLI). | ||
|
|
||
| See: https://github.com/rapidsai/rapids-cli#check-plugins | ||
| """ | ||
|
|
||
|
|
||
| def pylibwholegraph_smoke_check(**kwargs): | ||
| """ | ||
| A quick check to ensure pylibwholegraph can be imported and the | ||
| native library loads correctly. | ||
alexbarghi-nv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| """ | ||
| try: | ||
| import pylibwholegraph | ||
| except ImportError as e: | ||
| raise ImportError( | ||
| "pylibwholegraph or its dependencies could not be imported. " | ||
| "Tip: install with `pip install pylibwholegraph` or use a RAPIDS conda environment." | ||
| ) from e | ||
|
|
||
| if not hasattr(pylibwholegraph, "__version__") or not pylibwholegraph.__version__: | ||
| raise AssertionError( | ||
| "pylibwholegraph smoke check failed: __version__ not found or empty" | ||
| ) | ||
|
|
||
| from pylibwholegraph.utils import import_optional, MissingModule | ||
alexbarghi-nv marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| torch = import_optional("torch") | ||
|
|
||
| if isinstance(torch, MissingModule): | ||
| import warnings | ||
|
|
||
| warnings.warn( | ||
| "PyTorch is required to use pylibwholegraph." | ||
| "Please install PyTorch from PyPI or Conda-Forge." | ||
| ) | ||
alexbarghi-nv marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.