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

[Doc] Lucene inbuilt scalar quantization #7797

Merged
merged 10 commits into from
Jul 26, 2024

Conversation

naveentatikonda
Copy link
Member

@naveentatikonda naveentatikonda commented Jul 23, 2024

Description

Add documentation for Lucene inbuilt scalar quantization in k-NN plugin.

Issues Resolved

Closes #6496

Version

2.16

Checklist

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

Copy link

Thank you for submitting your PR. The PR states are In progress (or Draft) -> Tech review -> Doc review -> Editorial review -> Merged.

Before you submit your PR for doc review, make sure the content is technically accurate. If you need help finding a tech reviewer, tag a maintainer.

When you're ready for doc review, tag the assignee of this PR. The doc reviewer may push edits to the PR directly or leave comments and editorial suggestions for you to address (let us know in a comment if you have a preference). The doc reviewer will arrange for an editorial review.

@hdhalter hdhalter added 2 - In progress Issue/PR: The issue or PR is in progress. release-notes PR: Include this PR in the automated release notes v2.16.0 labels Jul 23, 2024
@hdhalter hdhalter assigned kolchfa-aws and unassigned hdhalter Jul 23, 2024
@naveentatikonda naveentatikonda force-pushed the lucene_inbuilt_sq branch 4 times, most recently from 332da9b to 75415ce Compare July 24, 2024 04:33
@naveentatikonda naveentatikonda marked this pull request as ready for review July 24, 2024 04:33
@naveentatikonda
Copy link
Member Author

@kolchfa-aws Can you pls review this PR. Thanks!

@kolchfa-aws
Copy link
Collaborator

@naveentatikonda Sure, will do!

@hdhalter hdhalter added 4 - Doc review PR: Doc review in progress and removed 2 - In progress Issue/PR: The issue or PR is in progress. labels Jul 24, 2024

Optionally, you can specify the parameters in `method.parameters.encoder` shown below:
* `confidence_interval` - used to compute the `minQuantile` and `maxQuantile` parameters which are used to quantize the vectors. The accepted values are:
- It can be any value between and including `0.9` to `1.0`. For example, if we set it to `0.9` then it will consider the middle 90% of the vector values for computing the min and max Quantiles excluding the minimum and maximum 5% of the values.
Copy link
Collaborator

Choose a reason for hiding this comment

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

So, to make sure, valid values are 0.9--1.0, inclusive (for static computation), or 0 (for dynamic computation)?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, that's correct. Also, users can skip this parameter which will be computed as shown under the default case


#### HNSW memory estimation

The memory required for Hierarchical Navigable Small Worlds (HNSW) is estimated to be `1.1 * (dimension + 8 * M)` bytes/vector.
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is M?

Copy link
Member Author

Choose a reason for hiding this comment

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

M is max number of connections. This isn't a new parameter.

Signed-off-by: Fanit Kolchina <[email protected]>
Signed-off-by: Fanit Kolchina <[email protected]>
Signed-off-by: Fanit Kolchina <[email protected]>
Signed-off-by: Fanit Kolchina <[email protected]>
Copy link
Collaborator

@natebower natebower left a comment

Choose a reason for hiding this comment

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

@kolchfa-aws @naveentatikonda Please see my comments and changes and let me know if you have any questions. Thanks!

_search-plugins/knn/knn-vector-quantization.md Outdated Show resolved Hide resolved
_search-plugins/knn/knn-vector-quantization.md Outdated Show resolved Hide resolved
_search-plugins/knn/knn-vector-quantization.md Outdated Show resolved Hide resolved

Optionally, you can specify the `confidence_interval` parameter in the `method.parameters.encoder` object.
The `confidence_interval` is used to compute the minimum and maximum quantiles in order to quantize the vectors:
- If you set the `confidence_interval` to a value in `0.9` to `1.0` range, inclusive, then the quantiles are calculated statically. For example, setting the `confidence_interval` to `0.9` specifies to compute the minimum and maximum quantiles based on the middle 90% of the vector values, excluding the minimum 5% and maximum 5% of the values.
Copy link
Collaborator

Choose a reason for hiding this comment

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

"middle" => "median"?, "minimum" => "lowest"?, "maximum" => "highest"?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Definitely "middle". I would keep as is. @naveentatikonda WDYT?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is definitely not my area of expertise, so that's fine with me :-)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we should use middle

_search-plugins/knn/knn-vector-quantization.md Outdated Show resolved Hide resolved
_search-plugins/knn/knn-vector-quantization.md Outdated Show resolved Hide resolved
Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: kolchfa-aws <[email protected]>
Copy link
Collaborator

@kolchfa-aws kolchfa-aws left a comment

Choose a reason for hiding this comment

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

Thank you, @naveentatikonda!

@kolchfa-aws kolchfa-aws merged commit 79a422b into opensearch-project:main Jul 26, 2024
9 checks passed
@hdhalter hdhalter added 3 - Done Issue is done/complete and removed 4 - Doc review PR: Doc review in progress labels Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Done Issue is done/complete release-notes PR: Include this PR in the automated release notes v2.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DOC] Lucene Inbuilt Byte Quantization
5 participants