Skip to content

Commit

Permalink
Avoid importing loads_function from distributed (#1220)
Browse files Browse the repository at this point in the history
Closes #1219

Not sure if we need the caching behavior originally included in `loads_function`, or if `pickle.loads` is sufficient. Any idea @madsbk ?

Authors:
  - Richard (Rick) Zamora (https://github.com/rjzamora)

Approvers:
  - Mads R. B. Kristensen (https://github.com/madsbk)
  - Peter Andreas Entschev (https://github.com/pentschev)

URL: #1220
  • Loading branch information
rjzamora authored Aug 17, 2023
1 parent f06d0af commit 62fb56a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions dask_cuda/proxy_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import distributed.utils
from dask.sizeof import sizeof
from distributed.protocol.compression import decompress
from distributed.worker import dumps_function, loads_function

from dask_cuda.disk_io import disk_read

Expand Down Expand Up @@ -85,7 +84,7 @@ def asproxy(
subclass = ProxyObject
subclass_serialized = None
else:
subclass_serialized = dumps_function(subclass)
subclass_serialized = pickle.dumps(subclass)

ret = subclass(
ProxyDetail(
Expand Down Expand Up @@ -440,7 +439,7 @@ def __reduce__(self):
pxy = self._pxy_get(copy=True)
pxy.serialize(serializers=("pickle",))
if pxy.subclass:
subclass = loads_function(pxy.subclass)
subclass = pickle.loads(pxy.subclass)
else:
subclass = ProxyObject

Expand Down Expand Up @@ -882,7 +881,7 @@ def obj_pxy_dask_deserialize(header, frames):
if args["subclass"] is None:
subclass = ProxyObject
else:
subclass = loads_function(args["subclass"])
subclass = pickle.loads(args["subclass"])
pxy = ProxyDetail(obj=(header["proxied-header"], frames), **args)
if pxy.serializer == "disk":
header, _ = pxy.obj
Expand Down

0 comments on commit 62fb56a

Please sign in to comment.