Skip to content

Prepare batched-copy tuning policy for lookahead#10081

Open
bernhardmgruber wants to merge 2 commits into
NVIDIA:mainfrom
bernhardmgruber:tune_batch_memcpy
Open

Prepare batched-copy tuning policy for lookahead#10081
bernhardmgruber wants to merge 2 commits into
NVIDIA:mainfrom
bernhardmgruber:tune_batch_memcpy

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: 4e8fed93-6748-4ddd-b770-fde51cf6e545

📥 Commits

Reviewing files that changed from the base of the PR and between bae29ea and 66d7ea5.

📒 Files selected for processing (7)
  • cub/benchmarks/bench/copy/memcpy.cu
  • cub/cub/device/dispatch/dispatch_batch_memcpy.cuh
  • cub/cub/device/dispatch/tuning/tuning_batch_memcpy.cuh
  • cub/test/catch2_test_device_copy_env.cu
  • cub/test/catch2_test_device_copy_env_api.cu
  • cub/test/catch2_test_device_memcpy_env.cu
  • cub/test/catch2_test_device_memcpy_env_api.cu
🚧 Files skipped from review as they are similar to previous changes (7)
  • cub/test/catch2_test_device_copy_env_api.cu
  • cub/test/catch2_test_device_copy_env.cu
  • cub/test/catch2_test_device_memcpy_env_api.cu
  • cub/benchmarks/bench/copy/memcpy.cu
  • cub/cub/device/dispatch/dispatch_batch_memcpy.cuh
  • cub/test/catch2_test_device_memcpy_env.cu
  • cub/cub/device/dispatch/tuning/tuning_batch_memcpy.cuh

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added explicit batched-copy algorithm selection for tuning policies.
    • Introduced a structured lookback configuration that organizes small- and large-buffer settings under a unified lookback policy.
  • Refactor
    • Updated the batched-copy tuning policy representation to use { algorithm, lookback } instead of separate small/large fields.
  • Bug Fixes
    • Improved consistency in batched-copy kernel launch configuration and sizing by deriving parameters directly from the selected lookback tuning.
  • Tests
    • Updated batched-copy policy selector examples and policy expectation tests to match the new format.

Walkthrough

Changes

Batched memcpy policies now include an explicit BatchedCopyAlgorithm::lookback selector and nested tuning fields. Dispatch paths, benchmarks, and tests use the updated policy layout and formatting.

Batched memcpy policy refactor

Layer / File(s) Summary
Algorithm-tagged policy contract
cub/cub/device/dispatch/tuning/tuning_batch_memcpy.cuh
Adds BatchedCopyLookbackPolicy and BatchedCopyAlgorithm, changes BatchedCopyPolicy to {algorithm, lookback}, and updates selection, comparison, and formatting.
Lookback policy dispatch integration
cub/cub/device/dispatch/dispatch_batch_memcpy.cuh
Kernel launch bounds, compile-time policies, tile sizing, occupancy sizing, and launch dimensions now use nested lookback tuning values.
Policy construction and validation updates
cub/benchmarks/bench/copy/memcpy.cu, cub/test/catch2_test_device_copy_env.cu, cub/test/catch2_test_device_copy_env_api.cu, cub/test/catch2_test_device_memcpy_env.cu, cub/test/catch2_test_device_memcpy_env_api.cu
Benchmark and test policy builders explicitly initialize the lookback algorithm and nested tuning fields; property expectations cover the nested string representation.

Suggested reviewers: oleksandr-pavlyk, srinivasyadav18


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: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7805cf30-f152-49db-87cf-def41ea226e8

📥 Commits

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

📒 Files selected for processing (7)
  • cub/benchmarks/bench/copy/memcpy.cu
  • cub/cub/device/dispatch/dispatch_batch_memcpy.cuh
  • cub/cub/device/dispatch/tuning/tuning_batch_memcpy.cuh
  • cub/test/catch2_test_device_copy_env.cu
  • cub/test/catch2_test_device_copy_env_api.cu
  • cub/test/catch2_test_device_memcpy_env.cu
  • cub/test/catch2_test_device_memcpy_env_api.cu

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

This comment has been minimized.

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

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 2h 42m: Pass: 100%/287 | Total: 13d 09h | Max: 2h 40m | Hits: 20%/1058636

See results here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants