Repository navigation
[cudax][cuco] Broadcast one slot index in cooperative insert_and_find - #12385
Conversation
Scan the bucket without break, take the expected slot from the bucket, and broadcast a single combined slot index instead of separate bucket and intra-bucket indices. Forming the slot pointer from the storage base after the shuffle keeps it in global address space.
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Assume slot addresses are not in local memory before the CAS so the atomic_ref local-memory fallback folds early and the expected value no longer spills on sm_90. The assumption is skipped for nvcc and NVRTC before 13.1, which miscompile __isLocal.
|
/ok to test |
🥳 CI Workflow Results🟩 Finished in 1h 14m: Pass: 100%/75 | Total: 15h 41m | Max: 1h 10m | Hits: 74%/65573See results here. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Scan and pointer selection cudax/include/cuda/experimental/__cuco/detail/open_addressing/open_addressing_ref_impl.cuh |
The scan initializes its candidate from bucket slot zero and uses intra-bucket index zero as the default. It records the first qualifying slot, then shuffles the combined index to form pointers for matching slots and insertion. |
Possibly related PRs
- NVIDIA/cccl#12355: It applies the combined-slot-index and post-shuffle pointer pattern to cooperative
findin the shared implementation. - NVIDIA/cccl#11869: It added cooperative insertion to the shared open-addressing implementation changed here.
Suggested reviewers: srinivasyadav18, sleeepyjack, gevtushenko
Change: Refactor
Merge Risk: 
Minimal · up to 4cc1c
-
No actionable issue is established for the changed insert-and-find behavior; the PR is mergeable after normal checks.
Description
Related to #12382.
This PR improves the cooperative
insert_and_findcodegen shared byfixed_capacity_mapandfixed_capacity_set. The bucket scan no longer breaks out of the loop, and the winning lane's slot index is broadcast with one shuffle instead of two, with the slot pointer formed from the storage base so it stays in global address space.The cooperative device
insert_and_findis now on par with cuCollections, e.g. 357 → 308 SASS instructions on sm_120 and 362 → 332 on sm_90 forint32keys with CG size 4.Checklist