Repository navigation
Add FastL2Add bloom filter policy option - #863
Merged
Merged
Conversation
sleeepyjack
force-pushed
the
bloom-fast-l2-add
branch
from
October 22, 2026 23:39
39e98fe to
a731c38
Compare
Collaborator
Author
FastL2Add (last bloom_filter_policy template parameter, default false) speeds up add for filters that fit in L2. Each key leaves one hash-selected word of its block's first 32-byte sector untouched; add issues no atomic for that word, so a key's atomic updates cover its first sector only partially, which recent GPUs process more efficiently. The bit pattern changes (slightly higher false-positive rate; filters built with and without the option are not interchangeable); contains needs no change. - policy: fast_l2_add flag; the skipped word is chosen branch-free from the lower hash with its own salt; no effect for blocks smaller than one sector - add_coop: under fast_l2_add, shuffle all keys of the tile first, then issue the conditional atomics (avoids per-shuffle convergence checks) - tests: one untouched word per key (32/64/128-byte blocks), layout invariance, no false negatives, cooperative bulk add on 3M keys, no effect below one sector
sleeepyjack
force-pushed
the
bloom-fast-l2-add
branch
from
October 22, 2026 23:44
a731c38 to
7de3f8f
Compare
Match the other detail bloom_filter_policy parameters, which have no defaults; the deprecated parametric_filter_policy alias passes false.
PointKernel
approved these changes
Oct 23, 2026
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.

Description
Adds an opt-in
FastL2Addflag (last template parameter ofcuco::bloom_filter_policy, defaultfalse) that speeds upaddfor filters that fit in L2.add_coopshuffles all keys of the tile before issuing the now-conditional atomics, avoiding a convergence check per shuffle.Trade-offs: the bit pattern changes (filters with and without the flag are not interchangeable) and the false-positive rate rises slightly (0.1315% → 0.1374% at 16 bits/key, k = 8). With the flag off, the bloom kernels compile to SASS identical to
dev.Performance
RTX PRO 6000 Blackwell Max-Q (sm_120, 128 MB L2), CUDA 13.4, default
add/containsbenchmarks (int64keys, 256-bit blocks, k = 8, 1e9 keys), with the policy'sFastL2Addset locally for the comparison:addcontainsDiffs below count changes within ±1% as SAME.
nvbench_compare: dev vs this PR with FastL2Add=0
bloom_filter_add_unique_size
bloom_filter_contains_unique_size
nvbench_compare: FastL2Add=0 vs FastL2Add=1
bloom_filter_add_unique_size
bloom_filter_contains_unique_size