Skip to content

Commit

Permalink
[HOTFIX] Generalize ModuleNotFoundError exception handling to ImportE…
Browse files Browse the repository at this point in the history
…rror for Amazon SMS libnuma.so.1 bug (#2385)

Generalize ModuleNotFoundError exception handling to ImportError for Amazon SMS libnuma.so.1 bug
#2113

This allows cugraph to be imported in a SageMaker environment without having to remove `ucx-py`

Authors:
   - Dylan Chima-Sanchez (https://github.com/betochimas)
   - Rick Ratzel (https://github.com/rlratzel)

Approvers:
   - Brad Rees (https://github.com/BradReesWork)
  • Loading branch information
rlratzel authored Jul 12, 2022
1 parent 467a674 commit 76800bc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion conda/recipes/libcugraph/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ requirements:
- libraft-headers {{ minor_version }}.*
- libcugraphops {{ minor_version }}.*
- librmm {{ minor_version }}.*
- cudf {{ minor_version }}.*
- libcudf {{ minor_version }}.*
- boost-cpp {{ boost_cpp_version }}
- nccl {{ nccl_version }}
- ucx-proc=*=gpu
Expand Down
6 changes: 4 additions & 2 deletions python/cugraph/cugraph/dask/common/input_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
from cugraph.dask.common.read_utils import MissingUCXPy
try:
from raft.dask.common.utils import get_client
except ModuleNotFoundError as err:
if err.name == "ucp":
except ImportError as err:
# FIXME: Generalize since err.name is arr when
# libnuma.so.1 is not available
if err.name == "ucp" or err.name == "arr":
get_client = MissingUCXPy()
else:
raise
Expand Down
6 changes: 4 additions & 2 deletions python/cugraph/cugraph/dask/common/mg_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
from cugraph.dask.common.read_utils import MissingUCXPy
try:
from raft.dask.common.utils import default_client
except ModuleNotFoundError as err:
if err.name == "ucp":
except ImportError as err:
# FIXME: Generalize since err.name is arr when
# libnuma.so.1 is not available
if err.name == "ucp" or err.name == "arr":
default_client = MissingUCXPy()
else:
raise
Expand Down
6 changes: 4 additions & 2 deletions python/cugraph/cugraph/dask/comms/comms.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
try:
from raft.dask.common.comms import Comms as raftComms
from raft.dask.common.comms import get_raft_comm_state
except ModuleNotFoundError as err:
if err.name == "ucp":
except ImportError as err:
# FIXME: Generalize since err.name is arr when
# libnuma.so.1 is not available
if err.name == "ucp" or err.name == "arr":
raftComms = MissingUCXPy()
get_raft_comm_state = MissingUCXPy()
else:
Expand Down

0 comments on commit 76800bc

Please sign in to comment.