Skip to content

Commit

Permalink
Handle importing relocated dispatch functions (#623)
Browse files Browse the repository at this point in the history
Requires PR ( rapidsai/cudf#8342 )

As these functions recently got relocated, handle `import`ing from the new location with a fallback to the old location.

xref: dask/dask#7503
xref: dask/dask#7505

Authors:
  - https://github.com/jakirkham

Approvers:
  - GALI PREM SAGAR (https://github.com/galipremsagar)
  - Benjamin Zaitlen (https://github.com/quasiben)

URL: #623
  • Loading branch information
jakirkham authored May 26, 2021
1 parent ab1d35c commit 1ef38b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions dask_cuda/proxy_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
from dask.sizeof import sizeof
from distributed.worker import dumps_function, loads_function

try:
from dask.dataframe.backends import concat_pandas
except ImportError:
from dask.dataframe.methods import concat_pandas

from .get_device_memory_objects import get_device_memory_objects
from .is_device_object import is_device_object

Expand Down Expand Up @@ -726,10 +731,10 @@ def wrapper(*args, **kwargs):

# Register dispatch of ProxyObject on all known dispatch objects
for dispatch in (
dask.dataframe.utils.hash_object_dispatch,
dask.dataframe.core.hash_object_dispatch,
dask.dataframe.utils.make_meta,
dask.dataframe.utils.make_scalar,
dask.dataframe.utils.group_split_dispatch,
dask.dataframe.core.group_split_dispatch,
dask.array.core.tensordot_lookup,
dask.array.core.einsum_lookup,
dask.array.core.concatenate_lookup,
Expand All @@ -745,5 +750,5 @@ def wrapper(*args, **kwargs):
# deserialize all ProxyObjects before concatenating
dask.dataframe.methods.concat_dispatch.register(
(pandas.DataFrame, pandas.Series, pandas.Index),
unproxify_input_wrapper(dask.dataframe.methods.concat_pandas),
unproxify_input_wrapper(concat_pandas),
)
1 change: 1 addition & 0 deletions dask_cuda/tests/test_ucx_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def _test_global_option(seg_size):
assert conf["SEG_SIZE"] == seg_size


@pytest.mark.xfail(reason="https://github.com/rapidsai/dask-cuda/issues/627")
def test_global_option():
for seg_size in ["2K", "1M", "2M"]:
p = mp.Process(target=_test_global_option, args=(seg_size,))
Expand Down

0 comments on commit 1ef38b4

Please sign in to comment.