[python] Add zero-copy coalesced BLOB range views#8726
Merged
Conversation
XiaoHongbo-Hope
force-pushed
the
zero_copy
branch
from
July 19, 2026 07:32
d8c3cdd to
5ab8b33
Compare
Keep the existing bytes API unchanged while adding bounded buffer-protocol views for consumers that own the payload lifetime. Daft builds binary arrays directly from those views, and worker-local training loaders can reuse the same API before decoding tensors.
XiaoHongbo-Hope
force-pushed
the
zero_copy
branch
from
July 19, 2026 07:33
5ab8b33 to
2bc4c77
Compare
XiaoHongbo-Hope
marked this pull request as ready for review
July 19, 2026 08:06
leaves12138
previously approved these changes
Jul 19, 2026
leaves12138
left a comment
Contributor
There was a problem hiding this comment.
Looks good. The new view API preserves the existing bytes-returning API, avoids per-member Python bytes slices for dense coalesced spans, and bounds retained gap memory for sparse spans without giving up coalesced I/O. The Daft batch path also accepts the resulting Arrow array correctly. I verified the three targeted coalesced-range tests and all five Daft BLOB read tests locally with Daft 0.7.11.
leaves12138
dismissed
their stale review
July 19, 2026 08:31
Submitted by mistake; this review was intended to be shared privately.
Contributor
|
+1 |
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.
Purpose
Add bounded shared views for coalesced BLOB reads without changing the existing
bytesAPI. Daft uses the views directly, and process-local training loaders can reuse them.Tests
Added shared/sparse view and Arrow conversion coverage. Passed BLOB and Daft BLOB tests; targeted view tests also pass on Python 3.6.