Skip to content

Reduce FastL2Add overhead in bloom filter add and contains - #865

Draft
sleeepyjack wants to merge 6 commits into
NVIDIA:devfrom
sleeepyjack:bloom-fastl2add-lean
Draft

sleeepyjack wants to merge 6 commits into
NVIDIA:devfrom
sleeepyjack:bloom-fastl2add-lean

Conversation

@sleeepyjack

Copy link
Copy Markdown
Collaborator

Follow-up to #863.

  • Take the skipped word from the top hash bits instead of a salted product.
  • In 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, int64 keys, 256-bit blocks, k = 8, filter ≤ 64 MB, FastL2Add before → after:

add contains
1 key/thread 127 → 134 G keys/s (+5%) 185 → 194 (+5%)
4 keys/thread 144 → 150 (+4%) 238 → 243 (+2%)

Neutral on RTX PRO 6000 and for DRAM-resident filters.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant