You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document environments for the two-phase CUB device APIs - #12687
With #11234, all two-phase CUB device APIs take an execution environment instead of a cudaStream_t (#9875). This updates the user docs, the developer guide and the env testing guidelines accordingly, and drops the now obsolete "that accept an environment" qualifier from the tuning sections of the device headers.
All two-phase CUB device APIs now take an execution environment instead of a
cudaStream_t. Update the user and developer documentation accordingly and drop
the obsolete "that accept an environment" qualifier from the tuning docs.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
Documentation
Expanded guidance on custom tuning policies across device-wide algorithms, including documented exceptions.
Updated API guidance for two-phase and single-phase calls, including how execution environments interact with caller-provided temporary storage and memory resources.
Revised testing guidance for API overloads, environment interactions, and custom streams.
Clarified the steps involved in classic two-phase calls and standardized terminology for API phases.
The change removes an environment dispatch utility and updates CUB documentation. The documentation covers environments on two-phase APIs, policy-selector tuning, and testing guidance for environment-aware overloads.
Changes: Environment API cleanup
Layer / File(s)
Summary
Two-phase environment contract and utility cub/cub/detail/env_dispatch.cuh, docs/cub/developer/device_scope.rst, docs/cub/device_wide.rst, docs/cub/environment.rst
Removes dispatch_with_env_validation_and_tuning. Documents environment parameters on two-phase APIs and states that they ignore the environment’s memory resource when callers provide temporary storage.
Broadens the documented scope of custom policy-selector tuning beyond algorithms that accept an environment. The documentation retains stated algorithm exceptions.
Environment-aware API test guidance docs/cub/developer/test_overview.rst
Updates the documented environment parameter convention, test coverage recommendations, and custom-stream test example.
Assessment against linked issues
Objective
Addressed
Explanation
Clean up environment overload utilities and documentation [#12680]
✅
Document that two-phase APIs ignore the environment memory resource [#9875]
✅
Complete the device-scope public API migration to environment parameters [#9875]
❌
This diff changes no public API declarations or overload implementations.
Possibly related issues
NVIDIA/cccl#11613: The PR updates environment-aware API testing guidance but does not modify or audit the test files discussed in the issue.
Suggested reviewers:griwes, gonidelis
Change: Other
Merge Risk: Low · up to 3ad4f
This change updates the CUB documentation and testing guidance for environment-aware two-phase APIs. A few statements remain inaccurate, covering the allocator warning, the deprecated ArgMin/ArgMax overloads, the allocation test checklist, and the custom-stream test guidance. These carry little merge risk, but correcting them would stop readers from being misled.
Architecture risk: Low · up to 3ad4f
The change affects 2 systems.
Changed systems:cub, docs
Architecture concerns
No architecture-level concerns identified.
Review details
Systems and components
observed — cub (service) was modified; 11 changed files map to changed impact.
observed — docs (service) was modified; 4 changed files map to changed impact.
Before / after behavior
observed — Modified behavior in cub/cub/detail/env_dispatch.cuh: Removed dispatch_with_env_validation_and_tuning, which validated the environment before delegating to automatic-storage dispatch with a tuning-policy selector.
observed — Modified behavior in cub/cub/device/device_adjacent_difference.cuh: The tuning documentation broadens the stated scope of custom policy-selector tuning from algorithms accepting an environment to all DeviceAdjacentDifference algorithms.
observed — Modified behavior in cub/cub/device/device_copy.cuh: The tuning documentation removes the restriction to Batched algorithms that accept an environment; it now describes tuning Batched algorithms generally.
observed — Modified behavior in cub/cub/device/device_find.cuh: The tuning documentation removes the restriction to FindIf algorithms that accept an environment; it now refers to the FindIf algorithms generally.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between ad8ea04 and 3ad4fb1.
Files selected for processing: 1
docs/cub/developer/test_overview.rst
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (1)
Minor · important: Limit the allocator warning to single-phase APIs. · environment.rst:255-258
docs/cub/environment.rst:255-258 Minor · Functional Correctness · Quick win
important: Limit the allocator warning to single-phase APIs.
Two-phase APIs now also accept environments, but they use caller-provided storage and ignore the environment's memory resource. The warning says the environment-based API requires cudaMallocAsync and advises passing a resource when it is unavailable. That advice does not apply to two-phase calls. State that the warning applies to automatic temporary-storage allocation.
As per path instructions, documentation changes must focus on “technical accuracy” and “API/version consistency.”
Reviewing files that changed from the base of the PR and between 9f91409 and ad8ea04.
Files selected for processing: 15
cub/cub/detail/env_dispatch.cuh
cub/cub/device/device_adjacent_difference.cuh
cub/cub/device/device_copy.cuh
cub/cub/device/device_find.cuh
cub/cub/device/device_for.cuh
cub/cub/device/device_partition.cuh
cub/cub/device/device_radix_sort.cuh
cub/cub/device/device_reduce.cuh
cub/cub/device/device_segmented_sort.cuh
cub/cub/device/device_select.cuh
cub/cub/device/device_transform.cuh
docs/cub/developer/device_scope.rst
docs/cub/developer/test_overview.rst
docs/cub/device_wide.rst
docs/cub/environment.rst
Files with no reviewable changes: 1
cub/cub/detail/env_dispatch.cuh
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With #11234, all two-phase CUB device APIs take an execution environment instead of a
cudaStream_t(#9875). This updates the user docs, the developer guide and the env testing guidelines accordingly, and drops the now obsolete "that accept an environment" qualifier from the tuning sections of the device headers.Fixes: #12680
Fixes: #9875
🤖 Generated with Claude Code