You signed in with another tab
8000
or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Vector sets: store vectors quantized (Q8, BIN) instead of always f32 #697
VADD accepts NOQUANT, Q8 and BIN but ignores them: every vector is kept as f32 (src/commands/vset.rs, the option loop around line 257), and VINFO reports quant-type f32. Redis 8 stores what is asked for, and Q8 is its default, so a vector set of the same data takes about 4x the memory here.
Store Q8 (int8 with a per-vector scale, as Redis does), and BIN where asked, and compare the same three numbers.
Open questions to settle with numbers, not up front:
The default when no option is given: f32 as now, or Q8 like Redis. It changes recall and VEMB output for existing users, so it's a maintainer call once the recall cost is measured.
Distance kernels on int8: they should be no slower than the f32 ones (scalar vs SIMD).
VEMB (dequantized values) and VEMB RAW shapes, VINFO quant-type, and refusing a quantization the set wasn't made with, matching Redis.
Persistence and replication: sets saved by 1.2.x (f32) must load unchanged, and DUMP/RESTORE, snapshots, AOF and replica full sync must round-trip each quantization. A downgrade to 1.2.x has to be refused cleanly or keep working, not mis-read the data.
Memory accounting: MEMORY USAGE and used_memory should reflect the smaller vectors.
One thing to keep in mind for the benchmarks is that KiviDB's VSIM currently uses exact brute-force search, while Redis vector sets use HNSW.
I think we should test quantization separately from the search algorithms. For KiviDB, we can compare FP32, Q8, and BIN using the same datasets, with FP32 results as the ground truth for recall@10.
For correctness, we should also test zero vectors, negative values, extreme ranges, and vector updates.
For the distance calculations, I'd benchmark both scalar and SIMD implementations before choosing an approach. The main goal is to reduce memory usage, but we also need to check how much overhead decoding adds. I will start by collecting baseline measurements before changing the storage layout.
agreed on all of it: f32 as ground truth for recall@10, quantization measured on its own, and the edge cases (zero vectors, negatives, extreme ranges, updates via VADD on an existing element) as tests. scalar vs SIMD measured before picking one is right too.
the brute-force VSIM is a separate and probably bigger gap: query time grows with the set, where Redis's HNSW stays roughly flat, so on large sets VSIM throughput will be far behind no matter how vectors are stored. I've opened #710 for it so the two don't get mixed up in the numbers. for this issue, please record VSIM latency at each set size in the baseline anyway, so we know how much of the gap is the search and how much is the vector format.
@Parikalp-Bhardwaj the vector-set harness is in master now: benchmarks/vector-sets (#720). It does VADD load plus VSIM at 1/16/100 clients, with ops/s, p50/p99, bytes per vector and recall@10 against exact ground truth, against any host:port. The README has KiviDB vs Redis 8.10.2 at 10k/100k with Q8 and NOQUANT. use it for your baseline and the Q8 comparison so the numbers line up
@Parikalp-Bhardwaj heads-up on ordering, decided today: vector sets are moving onto one shared HNSW index with FT (#710, plan there). Vectors will be stored once, inside that index, so Q8/BIN storage should go into the shared index's vector storage rather than into VSetEntry. That makes it step 6 of #710, after the index is generalized (step 1). in the meantime your baseline measurements with benchmarks/vector-sets are still very useful, and the int8/binary distance kernels (scalar vs SIMD, with their accuracy) can be built and measured on their own now, since they'll plug straight into the index. sorry for the reshuffle
Done in #730 (thanks @Parikalp-Bhardwaj): VADD stores Q8 and BIN vectors as Redis 8.10 does, with AOF markers and a capability-gated replication path so mixed 1.2/1.3 deployments stay consistent. Follow-ups from the review (RESTORE/MIGRATE of quantized sets in mixed versions, O(1) quantized-set check on PSYNC, SIMD kernels for the int8/bit distances) can get their own issues.
Activity
Parikalp-Bhardwaj commentedon Nov 13, 2026
One thing to keep in mind for the benchmarks is that KiviDB's VSIM currently uses exact brute-force search, while Redis vector sets use HNSW.
I think we should test quantization separately from the search algorithms. For KiviDB, we can compare FP32, Q8, and BIN using the same datasets, with FP32 results as the ground truth for recall@10.
For correctness, we should also test zero vectors, negative values, extreme ranges, and vector updates.
For the distance calculations, I'd benchmark both scalar and SIMD implementations before choosing an approach. The main goal is to reduce memory usage, but we also need to check how much overhead decoding adds. I will start by collecting baseline measurements before changing the storage layout.
murtazayusuf commentedon Nov 13, 2026
agreed on all of it: f32 as ground truth for recall@10, quantization measured on its own, and the edge cases (zero vectors, negatives, extreme ranges, updates via VADD on an existing element) as tests. scalar vs SIMD measured before picking one is right too.
the brute-force VSIM is a separate and probably bigger gap: query time grows with the set, where Redis's HNSW stays roughly flat, so on large sets VSIM throughput will be far behind no matter how vectors are stored. I've opened #710 for it so the two don't get mixed up in the numbers. for this issue, please record VSIM latency at each set size in the baseline anyway, so we know how much of the gap is the search and how much is the vector format.
murtazayusuf commentedon Nov 13, 2026
@Parikalp-Bhardwaj the vector-set harness is in master now: benchmarks/vector-sets (#720). It does VADD load plus VSIM at 1/16/100 clients, with ops/s, p50/p99, bytes per vector and recall@10 against exact ground truth, against any host:port. The README has KiviDB vs Redis 8.10.2 at 10k/100k with Q8 and NOQUANT. use it for your baseline and the Q8 comparison so the numbers line up
murtazayusuf commentedon Nov 13, 2026
@Parikalp-Bhardwaj heads-up on ordering, decided today: vector sets are moving onto one shared HNSW index with FT (#710, plan there). Vectors will be stored once, inside that index, so Q8/BIN storage should go into the shared index's vector storage rather than into VSetEntry. That makes it step 6 of #710, after the index is generalized (step 1). in the meantime your baseline measurements with benchmarks/vector-sets are still very useful, and the int8/binary distance kernels (scalar vs SIMD, with their accuracy) can be built and measured on their own now, since they'll plug straight into the index. sorry for the reshuffle
murtazayusuf commentedon Nov 14, 2026
Done in #730 (thanks @Parikalp-Bhardwaj): VADD stores Q8 and BIN vectors as Redis 8.10 does, with AOF markers and a capability-gated replication path so mixed 1.2/1.3 deployments stay consistent. Follow-ups from the review (RESTORE/MIGRATE of quantized sets in mixed versions, O(1) quantized-set check on PSYNC, SIMD kernels for the int8/bit distances) can get their own issues.
Suite 09 (vector sets): baseline recorded on master, with the HNSW gr…