Make namedVector compose with multivector in ann-benchmark#102
Merged
Conversation
Passing --namedVector together with -m (multivector/Colbert) failed with "inconsistent vector lengths" because the namedVector branches in both the ingestion and query paths unconditionally overwrote the multivector payload with a single flat vector. The schema branch likewise omitted the multivector/muvera config. - writeChunk: emit MULTI_FP32 under cfg.NamedVector when both flags set - createSchema: inject multivector/muvera block into named vector config - nearVectorQueryGrpc: target the named vector with the multi payload - enableCompression: check NamedVector before MultiVectorDimensions so config updates land on the right VectorConfig key
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Running the benchmarker with both
--namedVectorand-m(multivector/Colbert) failed at import time:Root cause
The
cfg.NamedVector != ""branches in both the ingestion and query paths unconditionally overwrote any multivector payload with a single flatencodeVector(vec). For a Colbert dataset with variable token counts (19/13/15/16/20 × 128), each document encoded to a different length and Weaviate rejected every doc whose length differed from the first object in the batch.The schema-creation branch had the matching gap: when
NamedVector != "", themultivector/muverablock was never added, so Weaviate created a plain single-vector HNSW index regardless of-m.Changes
cmd/ann_benchmark.gowriteChunkMULTI_FP32undercfg.NamedVectorwhen both flags set, instead of clobberingcmd/ann_benchmark.gocreateSchemamultivector/muverablock into the named vector index config when-m > 0cmd/random_vectors.gonearVectorQueryGrpcMULTI_FP32withTargets.TargetVectors=[cfg.NamedVector]when both are setcmd/ann_benchmark.goenableCompressionNamedVectorbeforeMultiVectorDimensionsso compression updates land on the rightVectorConfigkeySingle-vector + namedVector and multivector-only paths are unchanged.
Test plan
CGO_ENABLED=1 go build ./...CGO_ENABLED=1 go test ./cmd/...go run main.go ann-benchmark -v lotte-recreation-reduced-vl-10000.hdf5 -m 128 --indexType hnsw -d cosine --namedVector vector1— ingest completes, queries return non-zero recallann-benchmarkwith only-m(no--namedVector) still worksann-benchmarkwith only--namedVector(no-m) still works