[Enhance]: Support the Flat index compute distances through turbo Quantizer

Aperta
#709 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@richyreachy ci sta già lavorando.

Dal 13/10/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

enhancement
Affected Component

Flat Searcher, Flat Builder, Flat Streamer

Current Behavior

The turbo module already provides registered quantizers (Fp32Quantizer, Fp16Quantizer,
Int8Quantizer, Int4Quantizer, PqInt8Quantizer) with own SIMD distance kernels and APIs.

Every distance in the Flat path goes through FlatDistanceMatrix / IndexMetric
(distance_matrix().distance<1>(...), row_distance_, column_distance_). Quantized data can
therefore only be searched by going through a Converter/Reformer pair and a matching IndexMetric,
which duplicates logic that the turbo quantizers already implement (and better).

Desired Improvement

Plumb an optional std::shared_ptr<zvec::turbo::Quantizer> through the framework and make the Flat
index delegate distance computation to it when present.

Impact
  • Turbo quantizers become usable from the real Flat build/search flow instead of tests only, so
    int8/int4/fp16 indexes get the turbo SIMD kernels (AVX2 / AVX‑512 / AVX‑512‑VNNI with scalar
    fallback) rather than a Converter + generic IndexMetric chain.
  • The quantizer choice is persisted in the index meta, so a quantized index is self-describing and
    the query side is reconstructed automatically at load time.
  • Zero behavior change for existing indexes: without quantizer_name in the meta, every code path
    falls back to the current metric/distance-matrix logic.
Lingua principale
C++
Stelle
16.3k
Fork
1k
Merge medio
2g 10h
PR unite (30g)
32

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di alibaba/zvec

Tutte le issue di alibaba/zvec

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.