Skip to content

v3.3.0 — Product Quantization (PQ) with Asymmetric Distance Computation (ADC)

Choose a tag to compare

@Sam-CodesAI Sam-CodesAI released this 24 Nov 05:05
· 6 commits to main since this release

सूत्र DB (SutraDB) v3.3.0 Release Notes

🚀 Industrial Milestone: Product Quantization (PQ) with ADC

SutraDB v3.3 introduces Product Quantization (PQ) with Asymmetric Distance Computation (ADC), bringing industrial-grade memory compression and sub-millisecond similarity queries directly into SutraDB's native Rust SIMD core and Python SDK.


📦 Key Highlights & Capabilities

  1. Sub-Space Vector Decomposition ($M$ Subspaces):

    • Decomposes high-dimensional vector spaces into $M$ orthogonal sub-spaces (e.g. 1536 dims into 96 sub-spaces of 16 dims).
    • Trains k-means centroids ($K=256$) for each sub-space with automatic $M$ divisor selection via suggest_m.
    • Compresses 32-bit floating point vectors into 1-byte code indices per subspace, delivering up to 64x RAM reduction (e.g. 100K 128-dim vectors in ~3.2 MB RAM).
  2. Asymmetric Distance Computation (ADC):

    • Unquantized query sub-vectors are projected against codebook centroids once to precompute an $M \times 256$ float Look-Up Table (LUT), fitting entirely inside CPU L1 cache.
    • Vector distance calculation is reduced to table lookup indexing and SIMD addition, bypassing all floating-point multiplications.
    • Two-stage search: fast ADC candidate ranking + full-precision exact reranking of top candidate pool for >95% recall.
  3. Native Rust Core & PyO3 Integration:

    • PQConfig, PQCodebook, and PQVector implemented in src/distance/pq.rs.
    • Native collection bindings train_pq and enable_pq exposed via src/py_api.rs and src/collection.rs.
  4. Python SDK & Embedded Web UI Integration:

    • Pure Python / NumPy fallback implementation in sutradb.quantization.PQCodebook.
    • col.train_pq() and col.enable_pq() integrated with automatic ADC two-stage reranking in sutradb.core.Collection.
    • REST microservice endpoint POST /collections/{name}/pq and embedded 2026 dark-mode web console button for 1-click PQ training.
  5. Exhaustive Testing:

    • 82 total passing automated tests across Rust (19 tests) and Python (63 tests).

📥 Installation

pip install --upgrade sutradb-core