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

オープン
#709 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@richyreachy がすでに取り組んでいます。

2026年10月13日 から。

評価

この issue はまだ評価されていません。

説明

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.
主要言語
C++
スター
16.3k
フォーク
1k
平均マージ
2日 10時間
マージ済み PR(30日)
32

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

alibaba/zvec のほかの issue

alibaba/zvec の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。