Repository navigation
Support Standalone RaBitQ in cuVS #2377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rapids-bot
merged 46 commits into
NVIDIA:release/26.12
from
Stardust-SJF:cuvs_ivf_rabitq_standalone_quantizer
Nov 24, 2026
Merged
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
742dba9
Fuse RaBitQ block reductions into one templated blockReduceSumN<N>
Stardust-SJF 22172a1
Fix rescale-search shared-memory races by restructuring
Stardust-SJF f3a31aa
Add a standalone RaBitQ quantizer under preprocessing/quantize
Stardust-SJF 1a5e2a3
Make the RaBitQ quantizer detail layer stream- and resource-aware
Stardust-SJF 2c64068
Rename the RaBitQ factories init_* -> make_*
Stardust-SJF 36028d1
Add the C API for the RaBitQ preprocessing quantizer
Stardust-SJF a2c5747
Merge branch 'main' into cuvs_ivf_rabitq_syn_fix_fused
tfeher 2a1c334
Replace the RaBitQ glue kernels with raft primitives
Stardust-SJF 93ea433
Generate the RaBitQ matmul rotation with the shared IVF-PQ helper
Stardust-SJF 3af40d4
Add cuvsRabitqRotatorMakeFromState to restore a saved rotator
Stardust-SJF 33020da
Batch RaBitQ transform() internally, sized to the L2 cache
Stardust-SJF 69d8b96
Fix 32-bit factor index overflow in the RaBitQ full-factor kernel
Stardust-SJF e8cd13c
Accept host input in RaBitQ transform()
Stardust-SJF 1618145
Rename pipeline to quantizer and the old quantizer to encoder in RaBitQ
Stardust-SJF 140fab3
Merge branch 'pull-request/2362' into cuvs_ivf_rabitq_standalone_quan…
achirkin 128268a
Merge branch 'main' into cuvs_ivf_rabitq_syn_fix_fused
achirkin e837738
Merge remote-tracking branch 'sjf/cuvs_ivf_rabitq_syn_fix_fused' into…
achirkin b5ccd94
Merge remote-tracking branch 'rapidsai/main' into pull-request/2362
achirkin 42fcdfb
Merge branch 'pull-request/2362' into cuvs_ivf_rabitq_standalone_quan…
achirkin a6ad49e
Merge branch 'main' into cuvs_ivf_rabitq_standalone_quantizer
achirkin 89d518e
Spec-based dataset api
achirkin 8f1b9ce
Fix style
achirkin 4a9e8f3
Fix style
achirkin f02247a
Merge branch 'cuvs_ivf_rabitq_standalone_quantizer' into fea-rabitq-spec
achirkin 7db6e2f
Fix build errors
achirkin 28ccd92
Merge branch 'cuvs_ivf_rabitq_standalone_quantizer' into fea-rabitq-spec
achirkin afb5f91
Merge pull request #1 from achirkin/fea-rabitq-spec
Stardust-SJF 82b1325
Merge branch 'main' into cuvs_ivf_rabitq_standalone_quantizer
achirkin 8e68cde
Merge remote-tracking branch 'rapidsai/main' into cuvs_ivf_rabitq_sta…
achirkin c6632a7
Fix the symbol visibility
achirkin d42a40a
Merge remote-tracking branch 'public/main' into cuvs_ivf_rabitq_stand…
Stardust-SJF a7f80d5
Throw instead of exiting on unsupported RaBitQ FHT dimensions
Stardust-SJF 12ed643
Opt in to more shared memory for the RaBitQ scaling-factor kernel
Stardust-SJF 2e5d05a
Request shared memory in the RaBitQ quantize kernels only when needed
Stardust-SJF b3db6d9
Forward the rescale sample counts to the RaBitQ full-factor path
Stardust-SJF 2cc3b97
Document that RaBitQ delta is computed from signed code levels
Stardust-SJF 6d27955
Document the 16-bit code requirement for RaBitQ ex_bits = 8
Stardust-SJF 0a1302e
Show the RaBitQ delta formulas in the API page tables
Stardust-SJF 3a5fa14
Update cpp/include/cuvs/preprocessing/quantize/rabitq.hpp
Stardust-SJF d3c0cab
Update cpp/tests/preprocessing/rabitq_quantization.cu
Stardust-SJF d916649
Apply the review cleanups to the RaBitQ quantizer
Stardust-SJF b741b07
Use cub::BlockReduce for the RaBitQ quantizer block reductions
Stardust-SJF c11432f
Take mdspan views in the RaBitQ quantizer detail layer
Stardust-SJF 94ed09e
Use raft::warpReduce for the RaBitQ quantizer warp sums
Stardust-SJF 1540b4c
Add missing cub includes
tfeher 049f6d6
Merge branch 'release/26.12' into cuvs_ivf_rabitq_standalone_quantizer
tfeher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Batch RaBitQ transform() internally, sized to the L2 cache
Following review feedback, transform() no longer quantizes the whole dataset in one pass with an n_rows x padded_dim residual scratch: both overloads now loop over row batches, handing detail::quantize_data / quantize_data_full offset pointers into the caller's input and outputs. The detail pipeline is untouched, and rows are quantized independently, so batching only bounds the scratch. The batch size (transform_batch_rows) is chosen for speed, not only memory. Every stage after the input read (pad, rotate, centroid subtraction, quantize) sweeps the batch's residual scratch, so keeping it L2-resident is faster than one unbatched pass: - fht_kac, and matmul with padded_dim <= 256: the scratch is sized to ~3/8 of the L2 cache, clamped to [2048, 65536] rows ([2048, 32768] for matmul) and rounded down to a power of two (64K rows up to dim 128, 32K at 384, 8K around 1000, 4K at 3072 on a 128 MB L2). - wider matmul is GEMM-bound and runs best on large batches: 131072 rows. - as in IVF-PQ's extend, the batch is then halved (down to 128 rows) until its scratch fits half of the free workspace; the other half covers the rotated centroid, the matmul padding temporary and fragmentation. The constants come from a sweep with one process per measurement; comparing batch sizes inside a single process made the unbatched call look 10-15% slower than it is. transform() no longer needs the n_rows <= INT_MAX check, since every kernel launch now sees at most one batch. The docs drop the advice to batch by hand. Tested on an RTX PRO 6000 (sm_120a, 128 MB L2): - PREPROCESSING_TEST 369/369 (a new test checks that batched fht_kac output is bit-identical to rotate() + transform_residuals() over all rows, across several batches plus a short tail that runs the other FHT kernel, both output modes, with and without a centroid), RABITQ_C_TEST 2/2. - Output byte-identical to the previous commit for 40 configurations at 200000 rows (fht_kac and matmul, dims 100/128/960/1000/3000). - One transform() over a ~2 GiB dataset, 56 configurations, fresh processes x3: fht_kac 1.33x faster (geomean; 1.08-1.68x), matmul 1.05x (0.97-1.29x; dim 384 without a centroid is the one 3% regression). - With a 256 MiB workspace and a ~2 GiB dataset the previous commit runs out of memory; this one completes, for both rotators with and without centroid.
- Loading branch information
commit 33020da93a3033b91a048d2cbceee4c623a916dc
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.