Repository navigation
Add GPU BitBIRCH clustering - #372
Conversation
bitBirchGpu clusters packed fingerprints of up to 4096 bits with one BitBIRCH tree. Each insertion batch routes against a stable snapshot of the tree; one ordered owner per leaf then merges or appends that leaf's rows, summaries are refreshed bottom-up from per-batch deltas, and overflowing leaves split at a barrier in leaf order, cascading into parents. Rows past the first 16384 that would each merge into the same entry are first tried as one group. Cluster IDs follow each cluster's earliest row. Each step has one implementation for any branching factor: nodes keep contiguous entry lists, split pair searches tile node entries, and leaf owners compare a batch of rows against the whole leaf in one pass. Similarities are correctly rounded FP32 quotients, which order exactly up to 4096 bits; iSIM merge tests use exact integer terms. Tests cover the iSIM primitives and small cases checked against the Python reference model, including cascading splits and leaves split across two pair-search tiles.
[Medium impact] The PR appears safe to merge, with no new actionable issue found.
|
…ariant test - Replace hand-written block sum/min/argmax and the iSIM reduction with cub::BlockReduce. - Drop the exact-integer iSIM branch: every FP64 term is an integer, so FP64 sums are already exact below 2^53, and the reduction order is fixed. - insertRows: thread 0 reads the tree status and broadcasts it, so a failure in another block cannot split one block across a barrier. - Copy centroids one word per thread during finalization (coalesced). - Remove the int stashed in the reduction scratch and a shadowed local. - Link cub_helpers/host_vector instead of the unused device library; link device to test_bitbirch, which uses ScopedStream. - Add a seeded 20k-row test past the ordered warm-up that checks cluster invariants (threshold, majority centroids, dense first-row order, determinism) without stored fixtures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
PR 1/2 for #321 |
evasnow1992
left a comment
There was a problem hiding this comment.
Changes look good to me.
python bindings + more extensive integration tests to come in the followup