Skip to content

fix(cudf): Restore Project expansion for agg eligibility - #108

Open
sperlingxx wants to merge 3 commits into
HighPerfDataAccelerator:devfrom
sperlingxx:fix/cudf-aggregation-selection-eligibility
Open

fix(cudf): Restore Project expansion for agg eligibility#108
sperlingxx wants to merge 3 commits into
HighPerfDataAccelerator:devfrom
sperlingxx:fix/cudf-aggregation-selection-eligibility

Conversation

@sperlingxx

@sperlingxx sperlingxx commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Restore Project-expression expansion in expandFieldReference so GPU aggregation eligibility sees to_big_endian_64(c0), not just the projected field name endian_c0.
  • Keep normalizeProjectInputReferences on the runtime channel path from 13b1de5e0 (Resolve projected aggregate inputs for cuDF).
  • Move min/max(boolean) onto the accept list. Those signatures were registered in 635816cba; the reject test still expected max(boolean) to be ineligible. Leave avg(varchar) and sum(varchar) as rejects.

What we keep vs reject from 13b1de5e0

Keep — runtime projected aggregate inputs. Spark-style Project then Agg still remaps unresolved identity aliases onto Project output names. A FieldAccess that already exists on the Project output is a column channel. A real expression is a precomputed column. Runtime does not substitute the originating Project expression (that would re-run plus / to_big_endian_64 inside CudfGroupby).

Project(plus(c1, c2) AS y) → sum(y)

Selection still sees plus (GPU-ok). Runtime binds y as a column.

Reject — unifying eligibility with that remapper. 13b1de5e0 pointed expandFieldReference at the alias remapper even though runtime had already stopped calling it. Selection in CudfGroupby / CudfReduce still calls it. Grouping by endian_c0 then looked like a normal column, so CudfGroupby was selected for a GPU-unsupported origin expression.

Project(to_big_endian_64(c0) AS k) → GROUP BY k

Must stay on CPU HashAggregation. That is the Meta contract from facebookincubator#15529, not an undo of projected-input execution.

Test plan

  • Reproduce on HPDA dev 28798f623 (CUDA SM 86): both aggregation-selection cases fail as in [umbrella] velox_cudf_test: 12 failed CTest suites #100.
  • After this change, complexGroupbyClauseExpressions passes and invalidTypeCombinationsRejected no longer asserts against registered boolean min/max.
  • Full velox_cudf_aggregation_selection_test.
  • Full velox_cudf_tocudf_selection_test (includes complexGroupingKeyExpressionsFallsBack).

Fixes #107
Part of #100

Prepared with assistance from Cursor.

Grouping by a column produced by to_big_endian_64 was accepted for
CudfGroupby because eligibility remapped the Project output name
instead of inspecting the originating expression.

Keep runtime alias remapping for projected aggregate inputs. Restore
FieldAccess expansion through Project only for GPU selection.

Fixes rapidsai#107
Part of rapidsai#100
Drop the header comment and selection-test edits. Only
expandFieldReference is restored to Project-expression expansion.
@sperlingxx sperlingxx changed the title fix(cudf): Restore Project expansion for agg eligibility draft: fix(cudf): Restore Project expansion for agg eligibility Sep 1, 2026
@sperlingxx sperlingxx changed the title draft: fix(cudf): Restore Project expansion for agg eligibility fix(cudf): Restore Project expansion for agg eligibility Sep 1, 2026
@sperlingxx sperlingxx changed the title fix(cudf): Restore Project expansion for agg eligibility [DO NOT MERGE] fix(cudf): Restore Project expansion for agg eligibility Sep 1, 2026
@sperlingxx sperlingxx changed the title [DO NOT MERGE] fix(cudf): Restore Project expansion for agg eligibility fix(cudf): Restore Project expansion for agg eligibility Sep 2, 2026
@sperlingxx

Copy link
Copy Markdown
Collaborator Author

build

Boolean min/max are registered GPU signatures. The reject test still
expected max(boolean) to be ineligible. Cover min/max boolean in
comprehensiveTypeSupportValidation and leave avg/sum varchar as rejects.
@sperlingxx sperlingxx self-assigned this Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] cuDF aggregation selection accepts unsupported grouping keys and stale max(boolean)

2 participants