Add GPU Lance IO with bulk sparse reads - #5
Draft
VibhuJawa wants to merge 54 commits into
Draft
Conversation
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.
Summary
large_binaryimage data represented asLIST<UINT8>.read_lance_bulkfor one sparse request spanning many Lance files while preserving source order and requested row order.compression=NONE, avoiding redundant compression around JPEG/PNG payloads.Bulk Image Path
The multi-file reader now:
The API reports requested output bytes, compressed bytes touched, decompressed bytes, physical bytes read, ranges before/after coalescing, touched pages, files, and columns.
MINT1T Image Benchmark
Input: 32 canonical MINT1T Lance files, 227,344 rows, 28.8 GB on disk. Each case performs random sparse lookups of the actual
imagebytes. Results are median-of-three warm-process timings.The lookup-oriented files written by this PR are faster again in absolute time because they omit the redundant outer ZSTD layer:
Current Scope
NONEandZSTD.large_binary; reading supportsNONEandZSTD, while writing currently requiresNONE.Validation
cudftarget successfully after the retained scheduler change.LANCE_TESTsource, including a two-source uncompressed image regression test with reordered and empty values.large_binaryin Python Lance and match canonical image bytes exactly.git diff --check.The complete
LANCE_TESTexecutable was not linked in this environment because enabling the test suite invalidated and triggered a near-full libcudf rebuild; the focused test object compiled successfully.Global Lookup Order
The bulk C++ API also accepts
row_locations(std::vector<lance_row_location>), a flat list of(source_index, row_index)positions in the required caller order. It buckets these internally for sparse multi-file scheduling, then writes each image directly to its global output row. This removes the caller-side read-in-source-order plus GPU gather/reorder step used by a URL left join.On the same 32-file MINT1T image input, direct global-order output took 22.4–94.2 ms for 512–4,096 images. The equivalent source-order read followed by
cudf::gathertook 27.5–158.7 ms: direct placement is 1.23x–1.68x faster for this portion of the pipeline. The largest case was 94.2 ms versus 158.7 ms (1.68x).The image writer profile is conventional Lance FullZip
large_binarywith outercompression=NONE; it keeps already-compressed JPEG/PNG image bytes as direct-copy values. It does not change the image bytes, add an index, or define a second file format.Python API And Environment
The public cuDF API now exposes the native global-order reader as
cudf.read_lance_bulk(paths, row_locations=[(source_index, row_index), ...], columns=["image"]). It requires exactly one ofrows_per_sourceorrow_locations; the latter is the direct handoff from a URL join.The binding declares and invokes the C++
lance_row_locationbuilder API without a Python data-path shim. It also returns list child metadata forLIST<UINT8>image output, andto_lancenow admits homogeneous non-nulllist<uint8>image columns. The benchmark environment has been installed with the local libcudf headers/library and rebuilt pylibcudf Lance module.Validation: full
python/cudf/cudf/tests/input_output/test_lance.pypasses (20 tests); the focused C++ Lance test object compiles; real MINT1T two-file image order smoke passes.