alibaba / alibaba/zvec

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

Open
#707 1 comment 0 reactions 1 assignee Claimed by @feihongxu0824 View on GitHub
enhancement
Dominant language
C++
Stars
15.9k
Forks
998
Avg merge
4d 7h
Merged PRs (30d)
34

Description

### Affected Component

DiskANN builder, searcher, streamer, and Turbo quantizer framework.

### Current Behavior

DiskANN maintains a dedicated PQ implementation, resulting in duplicated training, serialization, and distance-calculation logic. It also lacks a standard mechanism for injecting external quantizers.

### Desired Improvement

Refactor DiskANN to use the Turbo quantizer framework:

- Replace the legacy DiskANN PQ trainer/table with `PqInt8Quantizer`.
- Persist self-describing quantizer metadata with the index.
- Restore quantizers through the common initialization/deserialization contract.
- Support external quantizer injection in builders, searchers, and streamers.
- Support FP16 and FP32 input with L2, cosine, and inner-product policies.
- Use SIMD-optimized full-precision distance calculations during graph construction and reranking.
- Add tests covering general search, filtering, grouping, node cache, vector fetching, RNN search, and FP16 entry points.

### Impact

This consolidates quantization under one framework, reduces duplicated code, and makes future quantizer integration easier.

Benchmark results show:

- Search QPS is 0.5–2.9% higher than the main branch.
- FP32 recall remains within ±0.1 percentage points of main.
- FP16 Turbo PQ introduces an expected 1.6–2.1 percentage-point R@1 trade-off.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.