Support out-of-band buffers in Python pickling#375
Merged
kkraus14 merged 7 commits intorapidsai:branch-0.15from May 21, 2020
Merged
Support out-of-band buffers in Python pickling#375kkraus14 merged 7 commits intorapidsai:branch-0.15from
kkraus14 merged 7 commits intorapidsai:branch-0.15from
Conversation
Member
Author
kkraus14
approved these changes
May 21, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When Python pickle's protocol 5 or greater is used, this change will support more efficient serialization of out-of-band buffers. This is analogous to Dask's custom serialization except for pickling. As such this is helpful in any Python serialization case where pickling is used. If an older pickling protocol is used, we simply proceed as before.
Also as we have switched from
__getstate__/__setstate__to__reduce_ex__, we no longer need to build aDeviceBufferand then steal itsunique_ptrfor our ownDeviceBuffer(which pickle also constructs). Instead we can just build aDeviceBufferonce and return it. So this is a bit more efficient.Note this is analogous to the change made to
Buffer( rapidsai/cudf#5132 ) except forDeviceBuffer.