Repository navigation
Reduce FastL2Add overhead in bloom filter add and contains - #865
Draft
sleeepyjack wants to merge 6 commits into
Draft
sleeepyjack wants to merge 6 commits into
sleeepyjack wants to merge 6 commits into
Conversation
Take the skipped-word index from the top bits of the hash instead of a salted product, and with one word per thread compare the word index against it directly. The add loop needs two instructions per key for the skip instead of four. Which word a key skips changes; the false-positive rate does not (8-24 bits/key, int64 keys, 256-bit blocks). On GB200, where FastL2Add's add is issue-bound, add is 5% faster with one key per thread (127.2 -> 133.7 G keys/s at 16 MB) and 4% faster with four (144.0 -> 149.9); contains is within 0.4%.
Contains cleared the skipped word's expected pattern, so the compiler could no longer test each word's single fingerprint bit directly. Exclude the skipped word by comparing its index instead; contains then compiles to the default policy's bit tests plus one predicate per word. On GB200 FastL2Add contains is 5% faster with one key per thread (184.8 -> 193.9 G keys/s at 16 MB) and 2% with four. Results and the bit pattern are unchanged.
Cooperative contains (horizontal layout > 1) now also excludes the skipped word by index, and a thread that owns the whole first sector issues one atomic less, shifting past the skipped word, instead of a conditional atomic per word. Adds 64-byte-block and 64-bit-word cases for the per-thread add path to the tests.
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.
Follow-up to #863.
contains, exclude the skipped word by index instead of clearing its expected bits, so each word keeps the single-bit test.Default policy unchanged (identical SASS). FPR unchanged; the skipped word per key changes.
GB200,
int64keys, 256-bit blocks, k = 8, filter ≤ 64 MB,FastL2Addbefore → after:addcontainsNeutral on RTX PRO 6000 and for DRAM-resident filters.