Skip to content
Merged
Show file tree
Hide file tree
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 Jul 24, 2026
22172a1
Fix rescale-search shared-memory races by restructuring
Stardust-SJF Jul 25, 2026
f3a31aa
Add a standalone RaBitQ quantizer under preprocessing/quantize
Stardust-SJF Jul 26, 2026
1a5e2a3
Make the RaBitQ quantizer detail layer stream- and resource-aware
Stardust-SJF Jul 26, 2026
2c64068
Rename the RaBitQ factories init_* -> make_*
Stardust-SJF Jul 27, 2026
36028d1
Add the C API for the RaBitQ preprocessing quantizer
Stardust-SJF Jul 28, 2026
a2c5747
Merge branch 'main' into cuvs_ivf_rabitq_syn_fix_fused
tfeher Aug 3, 2026
2a1c334
Replace the RaBitQ glue kernels with raft primitives
Stardust-SJF Oct 29, 2026
93ea433
Generate the RaBitQ matmul rotation with the shared IVF-PQ helper
Stardust-SJF Oct 29, 2026
3af40d4
Add cuvsRabitqRotatorMakeFromState to restore a saved rotator
Stardust-SJF Oct 29, 2026
33020da
Batch RaBitQ transform() internally, sized to the L2 cache
Stardust-SJF Oct 29, 2026
69d8b96
Fix 32-bit factor index overflow in the RaBitQ full-factor kernel
Stardust-SJF Oct 29, 2026
e8cd13c
Accept host input in RaBitQ transform()
Stardust-SJF Oct 29, 2026
1618145
Rename pipeline to quantizer and the old quantizer to encoder in RaBitQ
Stardust-SJF Oct 30, 2026
140fab3
Merge branch 'pull-request/2362' into cuvs_ivf_rabitq_standalone_quan…
achirkin Nov 2, 2026
128268a
Merge branch 'main' into cuvs_ivf_rabitq_syn_fix_fused
achirkin Nov 2, 2026
e837738
Merge remote-tracking branch 'sjf/cuvs_ivf_rabitq_syn_fix_fused' into…
achirkin Nov 2, 2026
b5ccd94
Merge remote-tracking branch 'rapidsai/main' into pull-request/2362
achirkin Nov 2, 2026
42fcdfb
Merge branch 'pull-request/2362' into cuvs_ivf_rabitq_standalone_quan…
achirkin Nov 2, 2026
a6ad49e
Merge branch 'main' into cuvs_ivf_rabitq_standalone_quantizer
achirkin Nov 3, 2026
89d518e
Spec-based dataset api
achirkin Nov 3, 2026
8f1b9ce
Fix style
achirkin Nov 3, 2026
4a9e8f3
Fix style
achirkin Nov 3, 2026
f02247a
Merge branch 'cuvs_ivf_rabitq_standalone_quantizer' into fea-rabitq-spec
achirkin Nov 3, 2026
7db6e2f
Fix build errors
achirkin Nov 3, 2026
28ccd92
Merge branch 'cuvs_ivf_rabitq_standalone_quantizer' into fea-rabitq-spec
achirkin Nov 3, 2026
afb5f91
Merge pull request #1 from achirkin/fea-rabitq-spec
Stardust-SJF Nov 4, 2026
82b1325
Merge branch 'main' into cuvs_ivf_rabitq_standalone_quantizer
achirkin Nov 4, 2026
8e68cde
Merge remote-tracking branch 'rapidsai/main' into cuvs_ivf_rabitq_sta…
achirkin Nov 4, 2026
c6632a7
Fix the symbol visibility
achirkin Nov 4, 2026
d42a40a
Merge remote-tracking branch 'public/main' into cuvs_ivf_rabitq_stand…
Stardust-SJF Nov 5, 2026
a7f80d5
Throw instead of exiting on unsupported RaBitQ FHT dimensions
Stardust-SJF Nov 5, 2026
12ed643
Opt in to more shared memory for the RaBitQ scaling-factor kernel
Stardust-SJF Nov 5, 2026
2e5d05a
Request shared memory in the RaBitQ quantize kernels only when needed
Stardust-SJF Nov 5, 2026
b3db6d9
Forward the rescale sample counts to the RaBitQ full-factor path
Stardust-SJF Nov 5, 2026
2cc3b97
Document that RaBitQ delta is computed from signed code levels
Stardust-SJF Nov 5, 2026
6d27955
Document the 16-bit code requirement for RaBitQ ex_bits = 8
Stardust-SJF Nov 5, 2026
0a1302e
Show the RaBitQ delta formulas in the API page tables
Stardust-SJF Nov 5, 2026
3a5fa14
Update cpp/include/cuvs/preprocessing/quantize/rabitq.hpp
Stardust-SJF Nov 11, 2026
d3c0cab
Update cpp/tests/preprocessing/rabitq_quantization.cu
Stardust-SJF Nov 11, 2026
d916649
Apply the review cleanups to the RaBitQ quantizer
Stardust-SJF Nov 11, 2026
b741b07
Use cub::BlockReduce for the RaBitQ quantizer block reductions
Stardust-SJF Nov 11, 2026
c11432f
Take mdspan views in the RaBitQ quantizer detail layer
Stardust-SJF Nov 12, 2026
94ed09e
Use raft::warpReduce for the RaBitQ quantizer warp sums
Stardust-SJF Nov 22, 2026
1540b4c
Add missing cub includes
tfeher Nov 23, 2026
049f6d6
Merge branch 'release/26.12' into cuvs_ivf_rabitq_standalone_quantizer
tfeher Nov 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Forward the rescale sample counts to the RaBitQ full-factor path
launch_quantize_full hardcoded 64 coarse and 64 fine samples, so with use_fast
off every full-factor entry point ignored params::coarse_samples and
params::fine_samples, and the two output modes could emit different codes. Both
values now reach the kernel through quantize_full_on_residuals and
quantize_data_full. The new parameters have no defaults, so a missed forward
does not compile. The test no longer skips the cross-mode code check on the
slow path.

Default params are unaffected, since the old constants equal the defaults.

Tested on an RTX PRO 6000:
- PREPROCESSING_TEST 372/372, RABITQ_C_TEST 2/2, NEIGHBORS_ANN_IVF_RABITQ_TEST
  269/269.
- 4/4 samples now change the full-factor codes in 1675 of 5000 rows, as they do
  for (delta, vl). The two modes match with 4/32 and 32/4 samples, for uint8 and
  uint16 codes, through transform() and transform_residuals().
- With this and the two previous commits, output at default samples is
  byte-identical for 240 configurations. Speed is unchanged, except that fht_kac
  at dim 960 with use_fast is about 2.4% faster (7.28 to 7.11 ms per call, 1M
  rows, fresh processes x5).
  • Loading branch information
Stardust-SJF committed Nov 5, 2026
commit b3db6d9d5a6ce58b8057a9fb856ffc0bf3ba9c32
24 changes: 18 additions & 6 deletions cpp/src/preprocessing/quantize/detail/rabitq/pipeline.cu
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ void quantize_data_full_impl(raft::resources const& res,
bool use_fast,
CodeT* d_total_code,
float* d_factors,
float* d_residuals)
float* d_residuals,
int coarse_samples,
int fine_samples)
{
prepare_residuals(res,
d_data,
Expand All @@ -177,7 +179,9 @@ void quantize_data_full_impl(raft::resources const& res,
const_scaling_factor,
use_fast,
d_total_code,
d_factors);
d_factors,
coarse_samples,
fine_samples);
}

} // namespace
Expand Down Expand Up @@ -268,7 +272,9 @@ void quantize_data_full(raft::resources const& res,
bool use_fast,
uint16_t* d_total_code,
float* d_factors,
float* d_residuals)
float* d_residuals,
int coarse_samples,
int fine_samples)
{
quantize_data_full_impl(res,
d_data,
Expand All @@ -282,7 +288,9 @@ void quantize_data_full(raft::resources const& res,
use_fast,
d_total_code,
d_factors,
d_residuals);
d_residuals,
coarse_samples,
fine_samples);
}

void quantize_data_full(raft::resources const& res,
Expand All @@ -297,7 +305,9 @@ void quantize_data_full(raft::resources const& res,
bool use_fast,
uint8_t* d_total_code,
float* d_factors,
float* d_residuals)
float* d_residuals,
int coarse_samples,
int fine_samples)
{
quantize_data_full_impl(res,
d_data,
Expand All @@ -311,7 +321,9 @@ void quantize_data_full(raft::resources const& res,
use_fast,
d_total_code,
d_factors,
d_residuals);
d_residuals,
coarse_samples,
fine_samples);
}

} // namespace cuvs::preprocessing::quantize::rabitq::detail
8 changes: 6 additions & 2 deletions cpp/src/preprocessing/quantize/detail/rabitq/pipeline.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ void quantize_data_full(raft::resources const& res,
bool use_fast,
uint16_t* d_total_code,
float* d_factors,
float* d_residuals);
float* d_residuals,
int coarse_samples,
int fine_samples);

void quantize_data_full(raft::resources const& res,
const float* d_data,
Expand All @@ -119,7 +121,9 @@ void quantize_data_full(raft::resources const& res,
bool use_fast,
uint8_t* d_total_code,
float* d_factors,
float* d_residuals);
float* d_residuals,
int coarse_samples,
int fine_samples);

} // namespace cuvs::preprocessing::quantize::rabitq::detail

Expand Down
21 changes: 16 additions & 5 deletions cpp/src/preprocessing/quantize/detail/rabitq/quantize.cu
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
*
* Imported from the standalone RaBitQ GPU quantizer. Behaviour unchanged
* except that the launchers request only the shared memory they use and opt in
* to more than the default limit.
* to more than the default limit, and the full-factor launcher forwards the
* rescale sample counts.
*/

//
Expand Down Expand Up @@ -411,6 +412,8 @@ static void launch_quantize_full(cudaStream_t stream,
size_t ex_bits,
float const_scaling_factor,
bool use_fast,
int coarse_samples,
int fine_samples,
CodeT* d_total_code,
float* d_factors)
{
Expand All @@ -435,8 +438,8 @@ static void launch_quantize_full(cudaStream_t stream,
iB,
const_scaling_factor,
use_fast,
64,
64,
coarse_samples,
fine_samples,
nullptr,
nullptr,
0,
Expand All @@ -456,7 +459,9 @@ void quantize_full_on_residuals(cudaStream_t stream,
float const_scaling_factor,
bool use_fast,
uint16_t* d_total_code,
float* d_factors)
float* d_factors,
int coarse_samples,
int fine_samples)
{
launch_quantize_full(stream,
d_residuals,
Expand All @@ -466,6 +471,8 @@ void quantize_full_on_residuals(cudaStream_t stream,
ex_bits,
const_scaling_factor,
use_fast,
coarse_samples,
fine_samples,
d_total_code,
d_factors);
}
Expand All @@ -479,7 +486,9 @@ void quantize_full_on_residuals(cudaStream_t stream,
float const_scaling_factor,
bool use_fast,
uint8_t* d_total_code,
float* d_factors)
float* d_factors,
int coarse_samples,
int fine_samples)
{
launch_quantize_full(stream,
d_residuals,
Expand All @@ -489,6 +498,8 @@ void quantize_full_on_residuals(cudaStream_t stream,
ex_bits,
const_scaling_factor,
use_fast,
coarse_samples,
fine_samples,
d_total_code,
d_factors);
}
Expand Down
8 changes: 6 additions & 2 deletions cpp/src/preprocessing/quantize/detail/rabitq/quantize.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ void quantize_full_on_residuals(cudaStream_t stream,
float const_scaling_factor,
bool use_fast,
uint16_t* d_total_code,
float* d_factors);
float* d_factors,
int coarse_samples,
int fine_samples);

void quantize_full_on_residuals(cudaStream_t stream,
const float* d_residuals,
Expand All @@ -93,7 +95,9 @@ void quantize_full_on_residuals(cudaStream_t stream,
float const_scaling_factor,
bool use_fast,
uint8_t* d_total_code,
float* d_factors);
float* d_factors,
int coarse_samples,
int fine_samples);

} // namespace cuvs::preprocessing::quantize::rabitq::detail

Expand Down
8 changes: 6 additions & 2 deletions cpp/src/preprocessing/quantize/rabitq.cu
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,9 @@ void transform_full_impl(raft::resources const& res,
q.params_quantizer.use_fast,
codes.data_handle() + r0 * q.padded_dim,
factors.data_handle() + r0 * kNumFactors,
residuals.data());
residuals.data(),
static_cast<int>(q.params_quantizer.coarse_samples),
static_cast<int>(q.params_quantizer.fine_samples));
});
}

Expand Down Expand Up @@ -418,7 +420,9 @@ void transform_residuals_full_impl(
q.const_scaling_factor,
q.params_quantizer.use_fast,
codes.data_handle(),
factors.data_handle());
factors.data_handle(),
static_cast<int>(q.params_quantizer.coarse_samples),
static_cast<int>(q.params_quantizer.fine_samples));
}

} // namespace
Expand Down
10 changes: 2 additions & 8 deletions cpp/tests/preprocessing/rabitq_quantization.cu
Original file line number Diff line number Diff line change
Expand Up @@ -532,14 +532,8 @@ class RabitqQuantizationTest : public ::testing::TestWithParam<RabitqQuantizatio
handle_, pipe.encoder, residuals_view, std::nullopt, ff_codes.view(), factors.view());
raft::resource::sync_stream(handle_, stream_);
auto h_ff_codes = verify_codes(ff_codes.data_handle(), len);
if (ps_.use_fast) {
// Both modes then quantize with the same shared scaling factor, so the
// codes must match. (On the slow path they need not: the full-factor
// launcher hardcodes 64/64 rescale samples instead of forwarding
// params::coarse_samples / params::fine_samples.)
expect_same_codes(
h_codes_ref, h_ff_codes, "the (delta, vl) and (factors) output modes emit different codes");
}
expect_same_codes(
h_codes_ref, h_ff_codes, "the (delta, vl) and (factors) output modes emit different codes");
verify_finite(factors.data_handle(), static_cast<size_t>(n) * 3, "residual factor");

// Wrong extents must be rejected rather than silently reinterpreted.
Expand Down