Skip to content

Use the new tuning API internally for detail::reduce[_nd]::dispatch[_nd] - #8826

Merged
bernhardmgruber merged 13 commits into
NVIDIA:mainfrom
bernhardmgruber:tune_reduce
May 12, 2026
Merged

bernhardmgruber merged 13 commits into
NVIDIA:mainfrom
bernhardmgruber:tune_reduce

Conversation

@bernhardmgruber

@bernhardmgruber bernhardmgruber commented May 5, 2026 •

Copy link
Copy Markdown
Contributor

Fixes: #7948
Fixes: #7951
Fixes: #7960
Fixes: #7957

@copy-pr-bot

copy-pr-bot Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

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-project-automation github-project-automation Bot moved this to Todo in CCCL May 5, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Progress in CCCL May 5, 2026
@bernhardmgruber

Copy link
Copy Markdown
Contributor Author

/ok to test 4781524

@github-actions

This comment has been minimized.

@bernhardmgruber
bernhardmgruber marked this pull request as ready for review May 7, 2026 07:26
@bernhardmgruber
bernhardmgruber requested review from a team as code owners May 7, 2026 07:26
@cccl-authenticator-app cccl-authenticator-app Bot moved this from In Progress to In Review in CCCL May 7, 2026
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Comment on lines +152 to +155
# if _CCCL_CUDA_COMPILER(NVCC, >=, 12, 1)
// some rare combinations, like nvcc 12.0 + clang-14 in C++20, or nvcc 12.0 + GCC12 fail with:
// pod_tuple.h(130): error: Internal Compiler Error (codegen): "internal error during structure layout!"
// if we pass more than two policy selectors

@bernhardmgruber bernhardmgruber May 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The per-PR CI only found this for nvcc 12.0 and not for nvcc 12.9. It could happen for some versions in-between, but I want to not disable too many runs and will let the nightly CI catch this.

Comment thread cub/benchmarks/bench/reduce/base.cuh Outdated
,
policy_selector<T>{}
#endif
cuda::execution::tune(policy_selector<T>{})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important: now that this benchmark calls the public DeviceReduce::Reduce API, the accumulator type may differ from T because cuda::std::plus might promote to a larger type, but the tuning selector still passes T as the template argument for AccumT, so the selected policy may be scaled for the input type and not the actual deduced accumulator type

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right. I see I missed the SASS checks for this PR that would have revealed that issue.

On a different note: I discussed this with @gevtushenko and we agreed to change the meaning of the benchmark to align it better with the behavior of the public API. See also #6576. Maybe I should file this as a different PR first, so we can measure the impact and have a dedicated commit to point QA to where we expect a change in performance and they have to readjust the baseline for performance regression monitoring.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

#6576 is resolved now and I rebased the PR. We did change the meaning of the benchmark in #8884, so this PR no longer breaks it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

And I fixed the accumulator type passed here! Sorry, I missed that initially. Well spotted!

Comment thread cub/benchmarks/bench/reduce/base.cuh Resolved
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Comment thread cub/benchmarks/bench/reduce/base.cuh Resolved
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 2h 33m: Pass: 100%/283 | Total: 11d 13h | Max: 2h 32m | Hits: 19%/948761

See results here.

@bernhardmgruber
bernhardmgruber merged commit dedd36c into NVIDIA:main May 12, 2026
301 checks passed
@bernhardmgruber
bernhardmgruber deleted the tune_reduce branch May 12, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

2 participants