Skip to content

Prepare reduce-by-key tuning policy for lookahead#10078

Merged
bernhardmgruber merged 2 commits into
NVIDIA:mainfrom
bernhardmgruber:tune_reduce_by_key
Jul 23, 2026
Merged

Prepare reduce-by-key tuning policy for lookahead#10078
bernhardmgruber merged 2 commits into
NVIDIA:mainfrom
bernhardmgruber:tune_reduce_by_key

Conversation

@bernhardmgruber

Copy link
Copy Markdown
Contributor

Fixes part of: #10075

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

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: 761c1dd2-0e93-4bb4-a7d7-6d279e9b0129

📥 Commits

Reviewing files that changed from the base of the PR and between 762ecde and 3008a6d.

📒 Files selected for processing (7)
  • cub/benchmarks/bench/reduce/by_key.cu
  • cub/cub/device/device_run_length_encode.cuh
  • cub/cub/device/dispatch/dispatch_reduce_by_key.cuh
  • cub/cub/device/dispatch/dispatch_streaming_reduce_by_key.cuh
  • cub/cub/device/dispatch/tuning/tuning_reduce_by_key.cuh
  • cub/test/catch2_test_device_reduce_by_key_env_api.cu
  • cub/test/catch2_test_device_reduce_env.cu
🚧 Files skipped from review as they are similar to previous changes (7)
  • cub/cub/device/dispatch/dispatch_streaming_reduce_by_key.cuh
  • cub/test/catch2_test_device_reduce_by_key_env_api.cu
  • cub/cub/device/dispatch/dispatch_reduce_by_key.cuh
  • cub/cub/device/device_run_length_encode.cuh
  • cub/benchmarks/bench/reduce/by_key.cu
  • cub/cub/device/dispatch/tuning/tuning_reduce_by_key.cuh
  • cub/test/catch2_test_device_reduce_env.cu

📝 Walkthrough

Summary by CodeRabbit

  • Improvements

    • Updated reduce-by-key policy handling to use an explicit algorithm tag with nested lookback configuration, ensuring the execution and streaming paths derive tuning consistently from the lookback settings.
    • Preserved existing selected tuning values and behavior; changes focus on standardized policy representation and launch configuration.
  • Tests

    • Updated reduce-by-key policy construction, string expectations, and validation to match the new nested policy format.

Walkthrough

Changes

The reduce-by-key tuning policy now uses an algorithm tag with nested lookback parameters. Dispatch paths, adapters, benchmarks, and tests construct and consume the updated policy structure.

Reduce-by-key policy migration

Layer / File(s) Summary
Policy contract and tuning selection
cub/cub/device/dispatch/tuning/tuning_reduce_by_key.cuh
Adds ReduceByKeyLookbackPolicy and ReduceByKeyAlgorithm, nests lookback settings inside ReduceByKeyPolicy, and updates tuning selection, comparisons, and formatting.
Nested policy propagation
cub/cub/device/device_run_length_encode.cuh, cub/cub/device/dispatch/dispatch_reduce_by_key.cuh, cub/cub/device/dispatch/dispatch_streaming_reduce_by_key.cuh, cub/benchmarks/bench/reduce/by_key.cu
Updates adapters, kernel configuration, sizing helpers, streaming dispatch, and benchmark construction to use nested lookback fields.
Policy construction and representation tests
cub/test/catch2_test_device_reduce_by_key_env_api.cu, cub/test/catch2_test_device_reduce_env.cu
Updates policy initializers and expected string representations for the tagged nested policy structure.

Suggested reviewers: miscco, oleksandr-pavlyk


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

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 242aac14-2ba0-482c-aef3-77ed66ef6f08

📥 Commits

Reviewing files that changed from the base of the PR and between 56ff1a4 and 762ecde.

📒 Files selected for processing (7)
  • cub/benchmarks/bench/reduce/by_key.cu
  • cub/cub/device/device_run_length_encode.cuh
  • cub/cub/device/dispatch/dispatch_reduce_by_key.cuh
  • cub/cub/device/dispatch/dispatch_streaming_reduce_by_key.cuh
  • cub/cub/device/dispatch/tuning/tuning_reduce_by_key.cuh
  • cub/test/catch2_test_device_reduce_by_key_env_api.cu
  • cub/test/catch2_test_device_reduce_env.cu

Comment thread cub/cub/device/dispatch/tuning/tuning_reduce_by_key.cuh Outdated
@github-actions

This comment has been minimized.

@NaderAlAwar NaderAlAwar left a comment

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.

LGTM, coderabbit nodiscard comment worth addressing

bernhardmgruber and others added 2 commits July 22, 2026 17:14
Fixes part of: NVIDIA#10075

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bernhardmgruber
bernhardmgruber enabled auto-merge (squash) July 22, 2026 16:08
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 18h 44m: Pass: 100%/287 | Total: 13d 17h | Max: 2h 47m | Hits: 17%/1234808

See results here.

@bernhardmgruber
bernhardmgruber merged commit b21662a into NVIDIA:main Jul 23, 2026
604 of 609 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in CCCL Jul 23, 2026
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

Development

Successfully merging this pull request may close these issues.

3 participants