Support reusing a training result across multiple vector index writers

未关闭
#86 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@wangzhigang1999 已经在做这个了。

开始于 2026年9月2日。

  • #87 来自 @wangzhigang1999 —— 未关闭

评估

难度
5/5
预计耗时
一周以上
新手友好度
45/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃

调研方向

首先,跟踪 VectorIndexTrainer::train、提议的 training.create_writer() 入口点,以及 IVF-PQ 在所有受支持索引类型中的现有 from_trained 路径。然后检查统一 API 及其 C、C++、Java/JNI 和 Python 绑定。完成的标志是:独立的 writer 可以复用一个已完成的训练结果,同时保留空 payload、现有的消费 API 和当前的磁盘格式。

由索引模型根据 Issue 内容生成。

描述

Motivation

Callers that build one vector index file per segment currently need a separate training pass for every writer. The trained centroids, quantizers, and rotations can often be shared when those segments come from the same table or data distribution, but the unified API consumes VectorIndexTraining when it creates a writer.

For N segments, this makes the lifecycle effectively:

train -> writer 1
train -> writer 2
...
train -> writer N

IVF-PQ already has an internal from_trained path, but this capability is not available through the unified API or consistently across the supported index types and language bindings.

Proposed API

Allow a completed training result to create multiple independent writers:

let training = VectorIndexTrainer::train(config, training_vectors, training_count)?;
let first = training.create_writer();
let second = training.create_writer();

Each writer should start with the same trained model and an empty vector/ID payload. The existing consuming APIs should remain unchanged for one-shot callers.

Equivalent opt-in entry points should be exposed through C, C++, Java/JNI, and Python.

Expected benefit

In a release-mode synthetic build with 128-dimensional vectors, 8,192 training rows, and eight segments of 2,048 vectors each, training once reduced writer preparation time by 84-87% across IVF-Flat, IVF-SQ, IVF-PQ, IVF-RQ, and DiskANN. Including vector insertion and serialization, elapsed time fell by 73-84%.

The benefit comes from reducing N training passes to one; it does not change the index algorithms themselves.

Compatibility and scope

  • No default behavior change: callers opt in to reusable training explicitly.
  • Existing consuming APIs remain available.
  • No on-disk format change.
  • No cross-process training-model serialization or index merging in this issue.
主要语言
Rust
星标
25
派生
24
平均合并
1 小时 45 分钟
30 天内合并 PR
2

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/paimon-vector-index 的其他 Issue

查看 apache/paimon-vector-index 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。