-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy path_doctor_check.py
More file actions
44 lines (33 loc) · 1.29 KB
/
_doctor_check.py
File metadata and controls
44 lines (33 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# 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 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."
)