Restore aligned bucket loads - #843
Draft
sleeepyjack wants to merge 3 commits into
Draft
Conversation
Derive storage alignment from the bucket stride and expose it at native bucket-load sites. Preserve general slot access and retain demand loads where widening regresses lookups or count. Add coverage for alignment, bounds, custom storage and probing, allocator ownership, shared memory, and wraparound.
Implement aligned bucket loads and compile-time width selection on bucket_storage_ref. Let open addressing select the access policy without passing byte counts, and remove the standalone load_bucket header. Require bucket-aligned indices from all probing schemes while preserving custom storage access. Cover both load policies and aligned custom probing without changing native kernel codegen.
Remove FIRST_MATCH and the operation-specific load policies. Restore a single storage-owned alignment hint following the pre-slot-indexing implementation, and route scalar, cooperative, count, and mutation probing through the same whole-bucket accessor.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Restore one storage-owned, aligned whole-bucket load for all probing operations, enabling vectorization up to 32 bytes without changing hash-table layouts or defaults.
Changes
max(alignof(T), gcd(32, BucketSize * sizeof(T))). This preserves odd bucket sizes and natural alignment without adding per-bucket padding.bucket_storage_ref::load_bucket(index)using the existing storage implementation file. All probing schemes are assumed to produce bucket-aligned slot indices. General public slot-indexed access and custom storage access remain supported.No CG/bucket defaults, cache intrinsics, atomics, or synchronization are changed.
Performance
NVBench on RTX PRO 6000 Blackwell Max-Q (SM120), CUDA 13.1.115, GCC 14.3.0, CCCL 3.5.0, Release/C++17. Baseline:
532795b81e72e3fe4ce2b26eb0c5abc8abb1e2b4.Representative results at LF 0.5 and 50% matching independently shuffled queries. GPU times are medians of nine paired runs, with 100 samples per run.
This version is not regression-free. The map-find case reproducibly takes 45.43% more time. That remains an open performance issue; the bucket-loading API stays uniform.
The new main sweep covers 504 set/map/mixed-map cases: 32/64-bit keys, mixed payload widths, 1M/20M entries, LF 0.5/0.8/0.9, and contains/find/insert. It has 58 initial >2% slowdown flags. An additional 32 multiset count/retrieve cases (C4/B2 and C2/B4, multiplicities 1/16, LF 0.5/0.9) have no >2% slowdown flags. These sweeps use five paired runs and 30 samples/run.
Earlier results from the selective-load implementation are superseded and are not performance claims for this version.
Codegen
LDG.E.ENL2.256on SM100/120.Validation
Runtime measurements are limited to one SM120 GPU. Doxygen was unavailable. The performance matrix is not exhaustive; CI and older-GPU runtime validation remain outstanding.