Skip to content

Rename sum_with_overflow aggregation to sum_overflow and deprecate old APIs - #23014

Merged
rapids-bot[bot] merged 6 commits into
NVIDIA:mainfrom
PointKernel:hash-groupby-sum-overflow
Jun 30, 2026
Merged

Rename sum_with_overflow aggregation to sum_overflow and deprecate old APIs#23014
rapids-bot[bot] merged 6 commits into
NVIDIA:mainfrom
PointKernel:hash-groupby-sum-overflow

Conversation

@PointKernel

Copy link
Copy Markdown
Member

Description

Followup of #22832.

This PR completes the migration of the "sum with overflow" aggregation to the _overflow naming so it is used consistently, and points the hash groupby and all remaining internal code at the canonical SUM_OVERFLOW kind. #22832 added SUM_OVERFLOW / make_sum_overflow_aggregation() for the sort path and left SUM_WITH_OVERFLOW / make_sum_with_overflow_aggregation() as deprecated aliases; this PR migrates everything else.

Checklist

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

@copy-pr-bot

copy-pr-bot Bot commented Jun 26, 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.

@github-actions github-actions Bot added libcudf Affects libcudf (C++/CUDA) code. CMake CMake build issue Java Affects Java cuDF API. labels Jun 26, 2026
@PointKernel PointKernel added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jun 26, 2026
@PointKernel

Copy link
Copy Markdown
Member Author

/ok to test b747e87

@PointKernel
PointKernel marked this pull request as ready for review June 29, 2026 16:26
@PointKernel
PointKernel requested review from a team as code owners June 29, 2026 16:26
@PointKernel PointKernel added the 3 - Ready for Review Ready for review by team label Jun 29, 2026
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: f9f78659-e6c7-4290-abf4-f5412b87da86

📥 Commits

Reviewing files that changed from the base of the PR and between 1b7db20 and 2863787.

📒 Files selected for processing (1)
  • cpp/tests/CMakeLists.txt
🚧 Files skipped from review as they are similar to previous changes (1)
  • cpp/tests/CMakeLists.txt

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added sumOverflow() aggregation API for reductions and groupby in both C++ and Java.
  • Bug Fixes
    • Standardized overflow-sum handling across reductions and groupby execution paths (hash/sort/streaming/TDigest) to use SUM_OVERFLOW, including overflow-flag/result-struct behavior and init support rules.
    • Kept sumWithOverflow() as a deprecated alias that delegates to sumOverflow().
  • Documentation
    • Updated API docs and error messages to reference sumOverflow() / SUM_OVERFLOW.
  • Tests
    • Expanded/updated overflow test coverage, including sliced inputs and multi-block scenarios.

Walkthrough

Renames the overflow-sum aggregation from SUM_WITH_OVERFLOW to SUM_OVERFLOW across C++ headers, implementations, groupby/reduction wiring, Java APIs and JNI, and the associated tests. The old names remain available as deprecated aliases.

Changes

SUM_WITH_OVERFLOW → SUM_OVERFLOW rename

Layer / File(s) Summary
Public contracts and deprecations
cpp/include/cudf/aggregation.hpp, cpp/include/cudf/reduction.hpp, java/src/main/java/ai/rapids/cudf/Aggregation.java, java/src/main/java/ai/rapids/cudf/GroupByAggregation.java, java/src/main/java/ai/rapids/cudf/ReductionAggregation.java
Adds SUM_OVERFLOW as the canonical aggregation name, marks SUM_WITH_OVERFLOW aliases deprecated, and updates reduction docs and Java factory methods.
Internal aggregation contracts
cpp/include/cudf/detail/aggregation/aggregation.cuh, cpp/include/cudf/detail/aggregation/aggregation.hpp, cpp/include/cudf/detail/aggregation/device_aggregators.cuh, cpp/include/cudf/reduction/detail/reduction_functions.hpp
Renames the internal overflow aggregation type and related specializations to SUM_OVERFLOW while preserving the same struct output and device mapping.
Factories and reduction entry points
cpp/CMakeLists.txt, cpp/src/aggregation/aggregation.cpp, cpp/src/aggregation/aggregation.cu, cpp/src/reductions/sum_overflow.cu, cpp/src/reductions/reductions.cpp
Switches factory construction and reduction execution to sum_overflow, updates init handling, and compiles the renamed CUDA source file.
Groupby execution wiring
cpp/src/groupby/common/utils.hpp, cpp/src/groupby/groupby.cu, cpp/src/groupby/hash/compute_single_pass_aggs.cu, cpp/src/groupby/hash/compute_single_pass_aggs.cuh, cpp/src/groupby/hash/output_utils.cu, cpp/src/groupby/streaming_groupby/impl.cu
Updates groupby hash, sort, streaming, and result-column paths to recognize and validate SUM_OVERFLOW.
Java bridge and tests
cpp/tests/CMakeLists.txt, cpp/tests/groupby/sum_overflow_tests.cpp, cpp/tests/reductions/reduction_tests.cpp, java/src/main/native/src/AggregationJni.cpp, java/src/test/java/ai/rapids/cudf/ReductionTest.java, java/src/test/java/ai/rapids/cudf/TableTest.java
Moves test wiring to the renamed source file, switches tests to sumOverflow(), and updates decoding/validation for the renamed overflow result.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related issues

Possibly related PRs

  • rapidsai/cudf#21924: Updates the same streaming groupby overflow-aggregation validation path.
  • rapidsai/cudf#22404: Changes the same Java/JNI aggregation kind 37 mapping and public factory surface.
  • rapidsai/cudf#22465: Touches the same reduction overflow implementation and validation paths.

Suggested labels

5 - Ready to Merge

Suggested reviewers

  • ttnghia
  • bdice
  • mhaseeb123
  • vyasr
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main rename and deprecation work in the PR.
Description check ✅ Passed The description matches the changeset and accurately describes the migration to canonical SUM_OVERFLOW naming.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
java/src/test/java/ai/rapids/cudf/ReductionTest.java (1)

684-742: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add one compatibility smoke test for the deprecated alias.

This suite now validates only ReductionAggregation.sumOverflow(), but the PR’s compatibility promise is that sumWithOverflow() still works. A single alias-based reduction test here would keep that guarantee from regressing silently.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@java/src/test/java/ai/rapids/cudf/ReductionTest.java` around lines 684 - 742,
Add a compatibility smoke test in ReductionTest for the deprecated alias by
exercising ReductionAggregation.sumWithOverflow() with the same kind of
reduction path used in testSumOverflowNoOverflow. The new test should verify the
alias still produces a valid SumOverflowResult with the expected sum and no
overflow for a simple non-overflow input, so regressions in the alias are caught
alongside the existing sumOverflow() coverage.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cpp/tests/groupby/sum_overflow_tests.cpp`:
- Around line 25-35: Extend the groupby_sum_overflow_test suite by adding
SUM_OVERFLOW cases that use sliced input columns and inputs large enough to span
multiple blocks, since the current basic coverage only exercises empty/null and
hash-vs-sort paths. Add new tests alongside the existing
groupby_sum_overflow_test::basic coverage, using the same
sum_overflow_supported_types fixture, and verify both offset handling and
cross-block combine behavior for the renamed aggregation.

In `@java/src/main/java/ai/rapids/cudf/GroupByAggregation.java`:
- Around line 82-91: The Javadoc for GroupByAggregation.sumOverflow() still
describes outdated behavior and should be updated to match the current supported
sort-based groupby behavior exercised by TableTest. Edit the documentation on
the sumOverflow() factory in GroupByAggregation so it clearly states the actual
overflow-handling contract and no longer implies that sort-based groupby will
throw; keep the deprecated sumWithOverflow() alias pointing users to the updated
primary factory.

In `@java/src/test/java/ai/rapids/cudf/TableTest.java`:
- Around line 7929-7953: The two group-by overflow tests assume
`Table.groupBy(0).aggregate(...)` returns rows in key order, which is brittle.
Update `testGroupBySortSumOverflow` and
`testGroupBySortSumOverflowDetectsOverflow` to normalize the `results` table
with `orderBy(...)` on the group key before calling `assertSumOverflowResult`,
matching the pattern used by nearby aggregate tests. Keep the assertions
unchanged, but make sure the sorted output is what gets validated.

---

Nitpick comments:
In `@java/src/test/java/ai/rapids/cudf/ReductionTest.java`:
- Around line 684-742: Add a compatibility smoke test in ReductionTest for the
deprecated alias by exercising ReductionAggregation.sumWithOverflow() with the
same kind of reduction path used in testSumOverflowNoOverflow. The new test
should verify the alias still produces a valid SumOverflowResult with the
expected sum and no overflow for a simple non-overflow input, so regressions in
the alias are caught alongside the existing sumOverflow() coverage.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 29982a88-5616-46d1-b169-65bc043fdb2b

📥 Commits

Reviewing files that changed from the base of the PR and between c979f58 and b747e87.

📒 Files selected for processing (26)
  • cpp/CMakeLists.txt
  • cpp/include/cudf/aggregation.hpp
  • cpp/include/cudf/detail/aggregation/aggregation.cuh
  • cpp/include/cudf/detail/aggregation/aggregation.hpp
  • cpp/include/cudf/detail/aggregation/device_aggregators.cuh
  • cpp/include/cudf/reduction.hpp
  • cpp/include/cudf/reduction/detail/reduction_functions.hpp
  • cpp/src/aggregation/aggregation.cpp
  • cpp/src/aggregation/aggregation.cu
  • cpp/src/groupby/common/utils.hpp
  • cpp/src/groupby/groupby.cu
  • cpp/src/groupby/hash/compute_single_pass_aggs.cu
  • cpp/src/groupby/hash/compute_single_pass_aggs.cuh
  • cpp/src/groupby/hash/output_utils.cu
  • cpp/src/groupby/streaming_groupby/impl.cu
  • cpp/src/reductions/reductions.cpp
  • cpp/src/reductions/sum_overflow.cu
  • cpp/tests/CMakeLists.txt
  • cpp/tests/groupby/sum_overflow_tests.cpp
  • cpp/tests/reductions/reduction_tests.cpp
  • java/src/main/java/ai/rapids/cudf/Aggregation.java
  • java/src/main/java/ai/rapids/cudf/GroupByAggregation.java
  • java/src/main/java/ai/rapids/cudf/ReductionAggregation.java
  • java/src/main/native/src/AggregationJni.cpp
  • java/src/test/java/ai/rapids/cudf/ReductionTest.java
  • java/src/test/java/ai/rapids/cudf/TableTest.java

Comment thread cpp/tests/groupby/sum_overflow_tests.cpp Outdated
Comment thread java/src/main/java/ai/rapids/cudf/GroupByAggregation.java
Comment thread java/src/test/java/ai/rapids/cudf/TableTest.java Outdated
@vyasr

vyasr commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

/merge

@rapids-bot
rapids-bot Bot merged commit bd0dacf into NVIDIA:main Jun 30, 2026
136 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 - Ready for Review Ready for review by team CMake CMake build issue improvement Improvement / enhancement to an existing function Java Affects Java cuDF API. libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants