Repository navigation
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
OverviewThis PR refactors Changes by File
|
| Layer / File(s) | Summary |
|---|---|
Out-of-place Flagged migration cub/cub/device/device_select.cuh |
Out-of-place overloads now accept env as const EnvT& (defaulted to ::cuda::std::execution::env<>), remove explicit cudaStream_t parameter, and dispatch via dispatch_with_env_and_tuning before calling underlying select dispatch. Doxygen documentation updated to document the EnvT template parameter. |
In-place Flagged migration cub/cub/device/device_select.cuh |
In-place overloads now accept env as const EnvT& (defaulted to ::cuda::std::execution::env<>), remove explicit cudaStream_t parameter, and dispatch via dispatch_with_env_and_tuning before calling underlying select dispatch. Doxygen documentation updated to document the EnvT template parameter. |
Flagged tests across environment types cub/test/catch2_test_device_select_flagged.cu |
Test includes CUDA device and execution headers. New test probes required temporary storage size with null pointer, allocates device memory, and executes Flagged across multiple environment variants (cudaStream_t, cuda::stream, cuda::stream_ref, cuda::std::execution::env, cuda::execution::gpu); validates CUDA status, returned storage size, and output correctness for each variant. |
PSTL shift_left backend migration libcudacxx/include/cuda/std/__pstl/cuda/shift_left.h |
Both cub::DeviceSelect::Flagged calls updated to pass __policy (execution policy) instead of __stream.get() to align with new environment-based dispatch API. Storage pointer access changed from __get_ptr<0>() to __get_raw_ptr<0>(). |
Possibly related PRs
- NVIDIA/cccl#9316: Both PRs adjust the
cub::DeviceSelectenv/tuning integration—this PR changesDeviceSelect::Flaggedoverloads to route viadispatch_with_env_and_tuningand updates downstream PSTL callsites, aligning with broader work to productize the publicDeviceSelecttuning API.
Suggested reviewers
- gonidelis
- davebayer
Comment @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
🧹 Nitpick comments (4)
cub/cub/device/device_select.cuh (1)
456-456: 💤 Low valuesuggestion:
Ifoverloads (lines 456, 544) andFlaggedIfoverloads (lines 1240, 1340) still takeEnvT envby value whileFlaggedwas updated toconst EnvT& env. Consider updating these in a follow-up PR for consistency.Also applies to: 544-544
cub/test/catch2_test_device_find_env.cu (1)
198-198: ⚡ Quick winsuggestion: Use
thrust::raw_pointer_castfor consistency with lines 83 and 119 in the same file.cub/test/catch2_test_device_select_flagged.cu (2)
307-307: ⚡ Quick winsuggestion: Use
thrust::raw_pointer_castfor consistency with line 230 in the same file.
434-434: ⚡ Quick winsuggestion: Use
thrust::raw_pointer_castfor consistency with line 230 in the same file.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 1307a2f6-fee1-4c1d-87dd-3a8c080f6457
📒 Files selected for processing (7)
cub/cub/detail/env_dispatch.cuhcub/cub/device/device_find.cuhcub/cub/device/device_select.cuhcub/test/catch2_test_device_find_env.cucub/test/catch2_test_device_select_flagged.culibcudacxx/include/cuda/std/__pstl/cuda/find_if.hlibcudacxx/include/cuda/std/__pstl/cuda/shift_left.h
This comment has been minimized.
This comment has been minimized.
934e84b to
d4b1ac4
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cub/cub/device/device_select.cuh (1)
169-185: ⚡ Quick winsuggestion: Add one user-memory
Flaggedtest that passes a tuning-bearing environment, not just stream/env wrappers. These overloads now exist to preserve env-selected policy throughdispatch_with_env_and_tuning(...), but the supplied coverage only exercisescudaStream_t,cuda::stream,cuda::stream_ref, plainenv, andcuda::execution::gpu. A custom tuning case would pin the specific behavior this refactor is introducing.Also applies to: 668-689
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 2f222faf-3a1e-40a5-b270-8039877996ef
📒 Files selected for processing (7)
cub/cub/detail/env_dispatch.cuhcub/cub/device/device_find.cuhcub/cub/device/device_select.cuhcub/test/catch2_test_device_find_env.cucub/test/catch2_test_device_select_flagged.culibcudacxx/include/cuda/std/__pstl/cuda/find_if.hlibcudacxx/include/cuda/std/__pstl/cuda/shift_left.h
🚧 Files skipped from review as they are similar to previous changes (6)
- libcudacxx/include/cuda/std/__pstl/cuda/shift_left.h
- libcudacxx/include/cuda/std/__pstl/cuda/find_if.h
- cub/cub/detail/env_dispatch.cuh
- cub/test/catch2_test_device_select_flagged.cu
- cub/cub/device/device_find.cuh
- cub/test/catch2_test_device_find_env.cu
d4b1ac4 to
21856ae
Compare
This comment has been minimized.
This comment has been minimized.
| NullType{}, | ||
| NullType{}, |
There was a problem hiding this comment.
Suggestion: consider adding a comment that those values are the select and equality op. Applies to other places as well.
| c2h::device_vector<type> in(num_items); | ||
| c2h::device_vector<type> out(num_items); |
There was a problem hiding this comment.
| c2h::device_vector<type> in(num_items); | |
| c2h::device_vector<type> out(num_items); | |
| c2h::device_vector<type> in(num_items, thrust::no_init); | |
| c2h::device_vector<type> out(num_items, thrust::no_init); |
| c2h::device_vector<type> out(num_items); | ||
| c2h::gen(C2H_SEED(2), in); | ||
|
|
||
| c2h::device_vector<int> flags(num_items); |
There was a problem hiding this comment.
| c2h::device_vector<int> flags(num_items); | |
| c2h::device_vector<int> flags(num_items, thrust::no_init); |
| int* d_num_selected_out = thrust::raw_pointer_cast(num_selected_out.data()); | ||
|
|
||
| size_t expected_allocation_size = 0; | ||
| auto error = cub::DeviceSelect::Flagged( |
There was a problem hiding this comment.
Important: The current unit test file is compiled three times as requested by the // %PARAM% TEST_LAUNCH lid 0:1:2 comment. The intention is to use the launch wrapper select_flagged instead of the public API, so the unit test will cover host-side launch, device-side launch, and graph capture launch. If the test here can support the three launch types, which I think it does, please use the launch wrapper.
If a test cannot work with launch wrappers, you can use the public API, but then please guard the test if #if TEST_LAUNCH == 0 so the test is only compiled once for launch wrapper zero.
We want to be able to pass tunings to the APIs that take user provided memory.
21856ae to
fa5d66c
Compare
Pull request was closed
🥳 CI Workflow Results🟩 Finished in 2h 39m: Pass: 100%/343 | Total: 12d 22h | Max: 2h 25m | Hits: 37%/1296808See results here. |
We want to be able to pass tunings to the APIs that take user provided memory.
Also use the new overload for PSTL shift_left
DeviceFindIf#9318