Skip to content
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

Serialize of ProxyObject to pickle fixed attributes #1137

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions dask_cuda/proxy_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,10 @@ def obj_pxy_dask_serialize(obj: ProxyObject):
header, frames = pxy.serialize(serializers=("dask", "pickle"))
obj._pxy_set(pxy)

return {"proxied-header": header, "obj-pxy-detail": pxy.get_init_args()}, frames
return {
"proxied-header": header,
"obj-pxy-detail": pickle.dumps(pxy.get_init_args()),
}, frames


@distributed.protocol.cuda.cuda_serialize.register(ProxyObject)
Expand All @@ -860,7 +863,10 @@ def obj_pxy_cuda_serialize(obj: ProxyObject):
# the worker's data store.
header, frames = pxy.serialize(serializers=("cuda",))

return {"proxied-header": header, "obj-pxy-detail": pxy.get_init_args()}, frames
return {
"proxied-header": header,
"obj-pxy-detail": pickle.dumps(pxy.get_init_args()),
}, frames


@distributed.protocol.dask_deserialize.register(ProxyObject)
Expand All @@ -872,7 +878,7 @@ def obj_pxy_dask_deserialize(header, frames):
deserialized using the same serializers that were used when the object was
serialized.
"""
args = header["obj-pxy-detail"]
args = pickle.loads(header["obj-pxy-detail"])
if args["subclass"] is None:
subclass = ProxyObject
else:
Expand Down