Repository navigation
Conversation
eb5fd3e to
07211fb
Compare
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Configure vectorized loads cub/cub/agent/agent_reduce.cuh |
VectorT now uses cuda::__as_bytes_vectorized_t instead of CubVector. The eligibility check uses block_load_can_vectorize_v<InputIteratorT, InputT>. |
Possibly related issues
- NVIDIA/cccl#12170 — The issue identifies
agent_reduceload behavior that this change updates.
Possibly related PRs
- NVIDIA/cccl#12049 — Extends AgentReduce vectorization to contiguous iterator storage and updates eligibility checks.
- NVIDIA/cccl#12043 — Adds striped vectorized-load machinery used by AgentReduce.
- NVIDIA/cccl#12216 — Applies the corresponding vectorized-load migration to AgentFind.
Suggested reviewers: bernhardmgruber
Change: Refactor
Merge Risk: 
Minimal · previous review 80cb6
-
The reviewed change has no supported actionable merge-blocking risk in the available evidence.
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Source mode: Auto
- Repository: NVIDIA/cccl
- Branch: vectorized&
#95;block_load_to_shared - File: .coderabbit.yaml
- Commit: e967f86
- Layers: Repository YAML
- Review profile: CHILL
- Plan: Enterprise
- Run ID:
e5796ff0-085c-4484-9e4c-ee7a99f5d064
📒 Files selected for processing: 1
cub/cub/agent/agent_reduce.cuh
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 5 remain after this review.
| /// Vector type of InputT for data movement. Cache modified loads are at most 16 bytes wide, so they gain nothing from | ||
| /// a stricter alignment | ||
| using VectorT = ::cuda::__as_bytes_vectorized_t<InputT, AgentReducePolicy::VECTOR_LOAD_LENGTH>; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
-
🏁 Script executed:
set -eu printf '%s\n' '--- PR diff ---' git diff --unified=30 e967f8634748954803f7651a22d1acb2990b21df 07211fb006a72bcb8a4e628d78214d1fed311934 -- cub/cub/agent/agent_reduce.cuh printf '%s\n' '--- current AgentReduce relevant symbols ---' rg -n -F -e 'using VectorT' -e 'ConsumeRange' -e 'ConsumeFullTile' -e 'ThreadLoad' -e 'LoadVector' -e 'VECTOR_LOAD_LENGTH' cub/cub/agent/agent_reduce.cuh cub/cub/thread/thread_load.cuh printf '%s\n' '--- base CubVector definitions/usages ---' rg -n -F -e 'CubVector' cub/cub | head -80 git grep -n -F 'CubVector' e967f8634748954803f7651a22d1acb2990b21df -- cub | head -80 printf '%s\n' '--- current cache-modified reconstruction block ---' sed -n '160,230p' cub/cub/thread/thread_load.cuh sed -n '330,395p' cub/cub/thread/thread_load.cuh printf '%s\n' '--- current AgentReduce complete relevant blocks ---' sed -n '190,350p' cub/cub/agent/agent_reduce.cuh sed -n '400,455p' cub/cub/agent/agent_reduce.cuh
Repository: NVIDIA/cccl
Length of output: 41451
🏁 Script executed:
set -eu printf '%s\n' '--- CubVector definition ---' nl -ba cub/cub/detail/cub_vector.cuh | sed -n '20,95p' printf '%s\n' '--- current as_bytes_vectorized definition ---' nl -ba libcudacxx/include/cuda/__memory/as_bytes_vectorized.h | sed -n '35,155p' printf '%s\n' '--- UnitWord definition ---' nl -ba cub/cub/detail/unit_word.cuh | sed -n '45,85p' printf '%s\n' '--- current ThreadLoad reconstruction ---' nl -ba cub/cub/thread/thread_load.cuh | sed -n '338,385p' printf '%s\n' '--- current AgentReduce vector path ---' nl -ba cub/cub/agent/agent_reduce.cuh | sed -n '200,335p' printf '%s\n' '--- relevant policy modifiers and vector lengths ---' rg -n -F -e 'AgentReducePolicy' -e 'LOAD_LDG' -e 'VECTOR_LOAD_LENGTH' cub/cub/device/dispatch/tuning/tuning_reduce.cuh cub/test/catch2_test_device_reduce_dispatcher.cu cub/test/catch2_test_device_segmented_reduce_custom_policy_hub.cu | head -140
Repository: NVIDIA/cccl
Length of output: 21355
important: Use the 16-byte-aligned vector type for cache-modified loads.
For CTK 13+ with InputT = double and VECTOR_LOAD_LENGTH = 4, VectorT is 32-byte aligned. The LOAD_LDG path reconstructs it from ulonglong2 words[2], which has only 16-byte alignment. The reinterpret_cast<T*>(words) dereference can therefore be misaligned and produce incorrect reduction data.
Retain __as_bytes_vectorized_t for default loads, but use the existing CubVector type for cache-modified loads:
- using VectorT = ::cuda::__as_bytes_vectorized_t<InputT, AgentReducePolicy::VECTOR_LOAD_LENGTH>;
+ using VectorT = ::cuda::std::_If<
+ AgentReducePolicy::LOAD_MODIFIER == LOAD_DEFAULT,
+ ::cuda::__as_bytes_vectorized_t<InputT, AgentReducePolicy::VECTOR_LOAD_LENGTH>,
+ typename CubVector<InputT, AgentReducePolicy::VECTOR_LOAD_LENGTH>::Type>;📝 Committable suggestion
-
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.Suggested change/// Vector type of InputT for data movement. Cache modified loads are at most 16 bytes wide, so they gain nothing from /// a stricter alignment using VectorT = ::cuda::__as_bytes_vectorized_t<InputT, AgentReducePolicy::VECTOR_LOAD_LENGTH>; /// Vector type of InputT for data movement. Cache modified loads are at most 16 bytes wide, so they gain nothing from /// a stricter alignment using VectorT = ::cuda::std::_If< AgentReducePolicy::LOAD_MODIFIER == LOAD_DEFAULT, ::cuda::__as_bytes_vectorized_t<InputT, AgentReducePolicy::VECTOR_LOAD_LENGTH>, typename CubVector<InputT, AgentReducePolicy::VECTOR_LOAD_LENGTH>::Type>;
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
07211fb to
fc4e1fa
Compare
fc4e1fa to
71539c7
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
71539c7 to
a73c1c9
Compare
a73c1c9 to
b01a64d
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
b2b5839 to
9418b86
Compare
9418b86 to
8556585
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
8556585 to
d45b2df
Compare
d45b2df to
625b801
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
625b801 to
ab0ce10
Compare
This comment has been minimized.
This comment has been minimized.
ab0ce10 to
c4f0be0
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Load vectors of `cuda::__as_vectorized_storage_t` instead of `CubVector` and only attempt to vectorize types that are not more aligned than the widest vector access.
c4f0be0 to
4ec980d
Compare
🔬 Benchmark SASS comparisonHow to request a benchmark run
Targets with a SASS change
|
🥳 CI Workflow Results🟩 Finished in 3h 19m: Pass: 100%/214 | Total: 10d 08h | Max: 3h 17m | Hits: 35%/933065See results here. AI failure analysis1. CUB AgentReduce SASS delta lacks required approval · 1 jobExplanation: The AgentReduce vectorization change produced a SASS difference, but no matching approval artifact exists for the current head SHA. The separate `CI` failure only aggregates this failure and is therefore omitted. Evidence: Copy this prompt into a coding agentJobs: |
|
Change looks good, but we will need to run a LOT of benchmarks to validate this :S |
|
Closing this stack. It is outdated and we will not merge it anytime soon. |
This used the new machinery only on reduce
Stack created with GitHub Stacks CLI • Give Feedback 💬