Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Support to Enable/Disble Share level Rescoring and Update Oversampling Factor #2172

Merged

Conversation

Vikasht34
Copy link
Contributor

Description

Issue:- During rescoring at the shard level in a multi-segment case, the recall of the search results drops to zero.
Fix :- To address the issue of reduced recall during shard-level rescoring in multi-segment cases, we are introducing an index-level setting that allows users to enable or disable shard-level rescoring. This setting gives finer control over whether rescoring should be performed at the shard level or if the system should rely on a more global rescoring process across all segments. By disabling shard-level rescoring, the recall issue is mitigated, as the rescoring process will take into account the complete set of results from all segments, rather than focusing on top k results.

Oversampling Update :- With this change we are updating default oversampling factor as well. For dimensions less than 768, an oversample factor of 3.0x is applied to ensure higher recall for smaller vector spaces. For dimensions between 768 and 1000, the oversampling factor is set to 2.0x to balance recall and performance. For dimensions above 1000, no oversampling (1.0x) is applied.

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

jmazanec15
jmazanec15 previously approved these changes Sep 30, 2024
@@ -88,6 +88,7 @@ public class KNNSettings {
public static final String QUANTIZATION_STATE_CACHE_SIZE_LIMIT = "knn.quantization.cache.size.limit";
public static final String QUANTIZATION_STATE_CACHE_EXPIRY_TIME_MINUTES = "knn.quantization.cache.expiry.minutes";
public static final String KNN_FAISS_AVX512_DISABLED = "knn.faiss.avx512.disabled";
public static final String KNN_DISK_VECTOR_SHARD_LEVEL_RESCORING_DISABLED = "index.knn.disk.vector.shard_level_rescoring_disabled";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: A disabled suffix might cause confusion here if we ever expose this to customers. consider index.knn.shard_level_rescoring and the default can be false

@naveentatikonda naveentatikonda merged commit 07f4df2 into opensearch-project:main Oct 1, 2024
32 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 1, 2024
…sampling Factor (#2172)

Signed-off-by: VIKASH TIWARI <[email protected]>
(cherry picked from commit 07f4df2)
jmazanec15 pushed a commit that referenced this pull request Oct 1, 2024
…sampling Factor (#2172)

Signed-off-by: VIKASH TIWARI <[email protected]>
Signed-off-by: John Mazanec <[email protected]>
navneet1v pushed a commit that referenced this pull request Oct 1, 2024
…sampling Factor (#2172) (#2173)

Signed-off-by: VIKASH TIWARI <[email protected]>
Signed-off-by: John Mazanec <[email protected]>
Co-authored-by: Vikasht34 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants