Skip to content

feat(retrieval): add Milvus ANN benchmarking - #546

Open
lewellin727 wants to merge 12 commits into
MigoXLab:dev-lzlfrom
lewellin727:dev-dev
Open

lewellin727 wants to merge 12 commits into
MigoXLab:dev-lzlfrom
lewellin727:dev-dev

Conversation

@lewellin727

Copy link
Copy Markdown

一、改动概述

新增 Milvus 向量检索评测流程:读取 HDF5 → 批量导入 → Top-K 查询 → 离线评测

二、主要修改

  • 复用 Dingo 的 InputArgs,支持从本地或 S3 读取已有 HDF5 文件
  • 支持指定 Milvus 地址、数据库、collection 和向量字段,导入时保留原始行号作为 ID
  • 查询结果、延迟和请求状态保存为 JSONL,支持按需计算 Recall@K、延迟、请求成功率和返回质量
  • 四步运行命令见 examples/milvus_benchmark/README.md,现有文本检索和 MTEB 流程保持原样

三、验证

  • 合并上游 dev 后,764 项相关测试通过,覆盖向量评测及上游本次更新的规则
  • 成功读取本地 SIFT1M,确认基础向量形状为 1,000,000 × 128
  • 使用非 SIFT 数据和模拟 Milvus 跑通导入、查询和评测,精确检索得到 Recall@20 = 1.0

四、已知限制

  • 当前版本尚未完成真实 Milvus 的端到端验收
  • 查询和评测须使用同一数据版本,当前仅核对数据集标签
  • CLI 会拒绝混用 K 的查询日志;直接调用 Python 评测函数时,调用方须保证同批记录的 K 一致

Register ANN datasource, dataset and converter components with lazy HDF5 access and configurable caching.

Add a cache-dir loading example, configuration documentation and offline validation for SIFT1M. Preserve the existing MTEB retrieval flow.
Add backend-neutral import records and receipts, ANN batch previews, and injectable vector query execution with per-attempt JSONL output.

Generalize SearchClient for typed vector queries while preserving text search behavior. Keep live Milvus import and search as explicit TODO placeholders.

Rename benchmark examples to Milvus_benchmark and cover batching, timing, errors, and output protection with offline tests.
Add pure ANN quality and aggregation helpers with nearest-rank latency summaries.

Evaluate saved vector-query JSONL against cached ANN-Benchmarks top-ten ground truth and write per-query and aggregate reports.

Cover invalid result slots, failed-attempt denominators, offline cache reuse, and report collisions including dangling symlinks. Leave QPS and evaluation modularization as TODOs.
Implement injected-client import and search adapters with receipt validation, protobuf ID support, and timeout normalization.

Wire runtime connection parameters into the examples and add a complete import and readback check with batch and summary reports.

Validate with 269 regression tests and a live 100-vector SIFT1M import with exact float32 readback. Keep local configuration and experiment artifacts outside tracked source.
Replace ANN download and cache configuration with the Local/S3 HDF5 pipeline. Keep ANN field mapping and ground-truth validation in the benchmark examples.

Group the HDF5 input helper under the numbered data-loading stage and update example, test, and documentation paths.
Reuse InputArgs for HDF5 sources and make array keys, dataset labels, and evaluation metrics configurable. Infer K from the query log and allow latency and request metrics without reopening HDF5.
Read local HDF5 inputs through the existing file loop while validating single-file inputs before traversal. Restore the S3 loader docstring structure and document its return values.
Map existing Milvus connection, top-K, and output options to Dingo InputArgs while preserving CLI flags, query logs, and report formats.
Document generic HDF5 reading alongside other dataset formats, place the Milvus benchmark instructions next to the examples, and complete the directory tree.
Add the repository root to the two ANN test modules before resolving examples, and skip HDF5-dependent tests before importing the benchmark helper.
@lewellin727
lewellin727 changed the base branch from dev to dev-lzl November 18, 2026 10:54
Reuse source file enumeration to read matching HDF5 files in order and release each file before moving to the next. Support multi-file previews and keep Milvus import, query, and evaluation inputs single-file.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant