Skip to content

Expose the remaining HybridScanMultiFile two-pass APIs in pylibcudf - #24853

Draft
Matt711 wants to merge 6 commits into
NVIDIA:mainfrom
Matt711:imp/pylibcudf/hybrid-scan-multifile-apis
Draft

Matt711 wants to merge 6 commits into
NVIDIA:mainfrom
Matt711:imp/pylibcudf/hybrid-scan-multifile-apis

Conversation

@Matt711

@Matt711 Matt711 commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Description

Expose the remaining two-pass APIs on pylibcudf.io.experimental.HybridScanMultiFile: filter and payload column chunk ranges, materialization, and row-group filtering with dictionary pages and bloom filters. This lets callers read filter columns first, build a row mask, and then read the surviving payload rows across multiple files. Part of #24852; used by #24854.

fetch_byte_ranges_to_device accepts source_indices to fetch ranges from several sources in one call. Add fetch_bloom_filters_to_device to strip the headers and return aligned bitsets for bloom filtering. Returned views keep their buffers, memory resource, and stream alive.

The span inputs accept lists and tuples, matching their Sequence[Span] annotations. Tests cover the two-pass workflow, dictionary and bloom pruning, buffer ownership, and default and custom streams. Host buffers used by asynchronous test copies stay alive until the copies complete.

Verification

Built libcudf and pylibcudf from this branch with CUDA 12.9.86 and GCC 14.4.0. Tested on a Tesla V100 with driver 535.161.08, Python 3.14, and PyArrow 25.

After merging upstream/main, ran tests/io/test_experimental_hybrid_scan.py, tests/io/test_experimental_hybrid_scan_multifile.py, and tests/io/test_parquet_io_utils.py from python/pylibcudf.

Check Result
Hybrid scan and byte-range tests 90 passed
Same modules with stream checking, excluding custom-stream cases 73 passed
Original byte-range tests with stream checking Reproduced both CI failures in the test helper's default-stream copy
Ruff, formatting, Cython lint, and diff whitespace checks Passed

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Tools: Codex

Part of #22752.

Add filter_column_chunks_byte_ranges, materialize_filter_columns,
payload_column_chunks_byte_ranges, materialize_payload_columns,
filter_row_groups_with_bloom_filters and
filter_row_groups_with_dictionary_pages so the multi-file reader matches the
single-file HybridScanReader.
fetch_byte_ranges_to_device now accepts source_indices to fetch the byte
ranges returned by the HybridScanMultiFile methods from a multi-source
SourceInfo in a single call, instead of requiring one source.
Bloom filter byte ranges cover the complete filter, header included, and the
hybrid scan readers require header-stripped, 32-byte aligned bitsets. Expose
fetch_bloom_filters_to_device, which produces them, and use real fetches for
the multi-file two-pass test.
@Matt711 Matt711 added Python Affects Python cuDF API. improvement Improvement / enhancement to an existing function non-breaking Non-breaking change pylibcudf Issues specific to the pylibcudf package labels Oct 27, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 27, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@Matt711

Matt711 commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

/ok to test b5e49db

Matt711 and others added 2 commits November 4, 2026 19:41
Keep the bloom fetch's Python resource and stream alive with its returned
views. Accept the Sequence inputs advertised by the multifile scan APIs,
and cover tuples alongside lists.

Pass the selected stream through test copies and keep host inputs alive
until their asynchronous transfers complete.

Co-Authored-By: Codex (GPT-6) <noreply@openai.com>
Keep upstream's host-byte retention fixes in the multifile tests alongside
the sequence and bloom-buffer lifetime coverage. Preserve the payload-page
setup API rename from main.

Co-Authored-By: Codex (GPT-6) <noreply@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement / enhancement to an existing function non-breaking Non-breaking change pylibcudf Issues specific to the pylibcudf package Python Affects Python cuDF API.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant