Conversation
Fixes NVIDIA#24056. Signed-off-by: Allen Xu <allxu@nvidia.com>
Address review feedback by writing non-empty digest rows directly into compact list child ranges. This avoids a full identity gather while preserving the no-empty fast path. Signed-off-by: Allen Xu <allxu@nvidia.com>
Build the empty-digest mask and compact offsets asynchronously after the single required empty-count reduction. Signed-off-by: Allen Xu <allxu@nvidia.com>
Signed-off-by: Allen Xu <allxu@nvidia.com>
Signed-off-by: Allen Xu <allxu@nvidia.com>
Signed-off-by: Allen Xu <allxu@nvidia.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The empty-percentile path incorrectly marks all rows null, and documentation needs to describe the empty-digest behavior.
Pull request overview
Fixes percentile_approx output for mixed empty and non-empty TDigests by compacting list children and preserving validity boundaries.
Changes:
- Adds compact offsets and output handling for empty digests.
- Uses bounded grid-stride percentile processing.
- Adds mixed-input and validity-mask boundary regression tests.
File summaries
| File | Summary |
|---|---|
cpp/tests/quantiles/percentile_approx_test.cpp |
Adds regression and boundary tests. |
cpp/src/quantiles/tdigest/tdigest.cu |
Implements compact output and validity-mask handling. |
Review details
Suppressed comments (2)
cpp/src/quantiles/tdigest/tdigest.cu:184
- This new compact path makes empty digests produce null list rows with zero-length ranges, but the public
percentile_approxdocumentation still promises that every list haspercentiles.size()elements (cpp/include/cudf/quantiles.hpp:108-110). Please update the public and detail documentation to describe the empty-digest/null-row behavior; otherwise the API contract still describes the invalid pre-fix shape.
* @param num_output_values Number of elements to allocate in the output column.
* @param output_offsets Optional compact output offsets for inputs containing empty digests.
cpp/src/quantiles/tdigest/tdigest.cu:395
- This branch changes the existing empty-percentile behavior for non-empty digests:
EmptyPercentilesexpects valid zero-length lists (seepercentile_approx_test.cpp:483-499), butmake_all_null_result()marks every row null. For a mixed input it also loses the distinction between empty and non-empty digests. Keep the zero-length offsets/child path forpercentiles.size() == 0, applying the empty-digest validity mask/count instead of forcing all rows null.
if (percentiles.size() == 0) { return make_all_null_result(); }
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughChangesThe t-digest percentile path now supports compact list output for mixed empty and non-empty digests. Empty digest rows receive zero-length ranges, while non-empty rows write to compact child storage. Regression tests cover nullable percentiles and row-count boundaries. Compact t-digest percentile output
Estimated code review effort: 4 (Complex) | ~45 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The change corrects mixed empty and non-empty TDigest percentile output while preserving dense behavior, with focused boundary and nullability tests passing. No actionable merge-blocking risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Comment |
|
Related implementation: #24095 was already open when this PR was published. The exact-head comparison and validation delta are documented there so the work can be consolidated without losing the additional coverage. Also, the automated empty-percentiles concern does not represent a regression: the existing EmptyPercentiles test intentionally constructs an all-null expected list column, and that test is included in the passing 388/388 QUANTILES_TEST run. |
Description
Closes #24056.
percentile_approxcurrently marks rows from empty TDigests null while retainingpercentiles.size()child elements for those rows. Mixed empty and non-empty inputtherefore produces non-empty null list rows, which downstream consumers reject.
This change:
a compact child column;
whose dense row/percentile pair count exceeds a valid CUDA grid.
Regression coverage includes nullable percentile values and mixed-input validity-mask
boundaries at 31, 32, 33, 65, and 257 rows.
Validation on
2cf22a1fb5b864bd53128034d34217943bea0047:The native build used CUDA 12.9.1 and
CMAKE_CUDA_ARCHITECTURES=80-real;89-real.Checklist