[STORY] Support page-level I/O in hybrid scan
- Dominant language
- C++
- Stars
- 9.8k
- Forks
- 1.1k
- Avg merge
- 3d 6m
- Merged PRs (30d)
- 278
Description
**Is your feature request related to a problem? Please describe.**
Duplicate of #20855
cuDF's Hybrid Scan reader is capable of selectively decompressing and decoding Parquet pages based on a filter expression (filter column) or a row retention mask (payload columns). However, the Hybrid Scan reader still produces byte ranges (to fetch) at column chunk level such that the caller must fetch otherwise pruned (not decompressed or decode) pages as a part of column chunk into the GPU memory, particularly to reduce the latency (less number of requests). Also in many cases, the fraction of pruned pages isn't significant/selective enough to amortize the cost of added latency.
However, use cases involving reading FILE logical type (#23494) and payload columns containing embedded images/file data as large byte arrays can benefit by several fold if using page-level IO (as shown by #23362 and #20855).
**Describe the solution you'd like**
Add a new set of hybrid scan APIs that:
- Compute page-level byte ranges to fetch - empty ranges against pruned pages if needed.
- Take in corresponding device spans and materialize the output payload table (one-shot and chunked)
**Describe alternatives you've considered**
Rewrite tables with huge embedded byte array data to have finer row groups and pages (finer pruning based on the input row retention mask)
**Additional context**
The input columns containing read FILE/embedded byte array rows must NOT be dictionary encoded to benefit from page-level I/O as dictionary pages in such cases would be required and could effectively diminish all I/O load saving compared to column chunk level I/O.
Related issue #23494 (support Parquet FILE LogicalType in libcudf)
**APIs needed**
| API | PR | Status | Notes |
| --- | --- | --- | --- |
| Full prototype | #23362 | 🚧 | A complete prototype of the feature containing an example demonstrating 10x e2e speedup for a real-world application from Curator |
| Relax parquet page index requirements in hybrid scan | #23386 | ✅ | Relax page index requirements in hybrid scan to only require offset index for columns being read to support page-level I/O |
| Rework page pruning in decoders to support page-level I/O | #23374 | ✅ | Rework pruning support (special handling of logically pruned pages) in page header and data decoders when working with page-level data spans (containing potentially `nullptr`s)
| Add page-level I/O and materialization APIs | #23375 | ✅ | Hybrid Scan APIs to compute page-level (payload) byte ranges based on row mask and a corresponding chunked materializer |
| Python bindings for page-level I/O and materialization APIs | #23930 | ✅ | Python bindings for Hybrid Scan APIs to materialize payload columns from page-level device spans |
| Improve pass construction | #23446
#24207
| ✅
🚧
| Part 1: Parquet reader estimates pass memory based on column chunks being read
Part 2: Part 1 in hybrid scan
Part 3: Hybrid scan estimates pass memory based on pages being read |
| Add extended tests, benchmarks and examples | | | | |
Contributor guide
Assessment
This issue has not been assessed yet.