Repository navigation
Refactor quantized scorers for (future) io_uring support - #8791
Merged
Merged
Conversation
ffuugoo
force-pushed
the
universal-quantized-scorer
branch
4 times, most recently
from
April 28, 2026 15:50
cedcc6a to
9510d2d
Compare
ffuugoo
marked this pull request as ready for review
April 28, 2026 16:14
This comment was marked as resolved.
This comment was marked as resolved.
ffuugoo
force-pushed
the
universal-quantized-scorer
branch
from
April 29, 2026 09:47
9510d2d to
4cf89c1
Compare
xzfc
reviewed
Apr 29, 2026
generall
approved these changes
Apr 29, 2026
ffuugoo
force-pushed
the
universal-quantized-scorer
branch
from
May 5, 2026 21:07
264b5d7 to
6e42ba1
Compare
ffuugoo
force-pushed
the
universal-quantized-scorer
branch
from
May 6, 2026 11:49
6e42ba1 to
bc20660
Compare
ffuugoo
force-pushed
the
universal-quantized-scorer
branch
from
May 6, 2026 12:09
4b3e939 to
9b71ab7
Compare
…zedCustomQueryScorer`
ffuugoo
force-pushed
the
universal-quantized-scorer
branch
from
May 7, 2026 14:26
9b71ab7 to
9ff29cc
Compare
...for quantized multi-vector storage types
ffuugoo
commented
May 7, 2026
Comment on lines
+384
to
+396
| fn build_multi<'a, TEncodedVectors: quantization::EncodedVectors + MultivectorOffsets>( | ||
| point_id: PointOffsetType, | ||
| quantized_data: &'a TEncodedVectors, | ||
| hardware_counter: HardwareCounterCell, | ||
| ) -> Result<Box<dyn RawScorer + 'a>, InternalScorerUnsupported> { | ||
| let query_scorer = QuantizedMultiQueryScorer::new_internal( | ||
| point_id, | ||
| quantized_data, | ||
| hardware_counter, | ||
| )?; | ||
|
|
||
| Ok(Box::new(RawScorerImpl { query_scorer })) | ||
| } |
Contributor
Author
There was a problem hiding this comment.
Ok, this is prob the most iffy change in this PR, but it should be fine?
Before, when building raw_internal_scorer, we used QuantizedQueryScorer for both single-vector and multi-vector storage types.
This PR refactored QuantizedQueryScorer to rely on for_each_in_batch, which is not supported by multi-vector storage.
But there is also QuantizedMultiQueryScorer designed specifically for multi-vector storage, that does not rely on for_each_in_batch and otherwise should work the same as "regular" scorer.
Someone, pls help me unpack this. 🥲
generall
approved these changes
May 7, 2026
timvisee
pushed a commit
that referenced
this pull request
May 8, 2026
* Add `EncodedStorage::for_each_in_batch` method * Implement `for_each_in_batch` method for `QuantizedChunkedMmapStorage` * Add `EncodedVectors::for_each_in_batch` method * Add `EncodedVectors::score` method * Implement `score_stored_batch` for `QuantizedQueryScorer` and `Quanti… * Remove `TElement` and `TMetric` type parameters from `QuantizedMultiQ… * Use `QuantizedMultiQueryScorer` when building `raw_internal_scorer`...
7 of 9 tasks
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.
Refactors
QuantizedQueryScorerandQuantizedCustomQueryScorer, so that they are ready for futureUniversalReadintegration.What this PR does:
EncodedVectors::for_each_in_batchEncodedStorage::for_each_in_batchEncodedStorage::scorescore_stored_batchas a trivial composition offor_each_in_batchandscoreThis PR only implements these for non multi-vector quantized storages, because multi-vector is too special, we'll make it work later... 😅
All Submissions:
devbranch. Did you create your branch fromdev?New Feature Submissions:
cargo +nightly fmt --allcommand prior to submission?cargo clippy --workspace --all-featurescommand?Changes to Core Features: