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

Remove type from pickle header for CumlArray #6120

Merged
Merged
Show file tree
Hide file tree
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
7 changes: 2 additions & 5 deletions python/cuml/cuml/internals/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,9 +728,8 @@ def host_serialize(self):

@classmethod
def host_deserialize(cls, header, frames):
typ = pickle.loads(header["type-serialized"])
assert all(not is_cuda for is_cuda in header["is-cuda"])
obj = typ.deserialize(header, frames)
obj = cls.deserialize(header, frames)
return obj

@nvtx_annotate(
Expand All @@ -748,9 +747,8 @@ def device_serialize(self):

@classmethod
def device_deserialize(cls, header, frames):
typ = pickle.loads(header["type-serialized"])
assert all(is_cuda for is_cuda in header["is-cuda"])
obj = typ.deserialize(header, frames)
obj = cls.deserialize(header, frames)
return obj

@nvtx_annotate(
Expand All @@ -761,7 +759,6 @@ def device_deserialize(cls, header, frames):
def serialize(self, mem_type=None) -> Tuple[dict, list]:
mem_type = self.mem_type if mem_type is None else mem_type
header = {
"type-serialized": pickle.dumps(type(self)),
"constructor-kwargs": {
"dtype": self.dtype.str,
"shape": self.shape,
Expand Down
2 changes: 0 additions & 2 deletions python/cuml/cuml/tests/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,6 @@ def test_serialize(inp, to_serialize_mem_type, from_serialize_mem_type):
with using_memory_type(from_serialize_mem_type):
ary2 = CumlArray.deserialize(header, frames)

assert pickle.loads(header["type-serialized"]) is CumlArray

_assert_equal(inp, ary2)

assert ary._array_interface["shape"] == ary2._array_interface["shape"]
Expand Down
Loading