Introduce extensible KNNEngine API and BuiltinKNNEngine enumeration#3288
Introduce extensible KNNEngine API and BuiltinKNNEngine enumeration#3288reta wants to merge 1 commit into
Conversation
|
@vamshin @navneet1v would really appreciate your thoughts folks, the pull request look large but 99% of changes is just name change |
cdbe10a to
efcc3fc
Compare
Thanks @reta. We have a similar idea here to create a Sandbox module/package. #3283. Should we incorporate the code changes in this direction? Also regarding the changes, wondering if we could reserve kNNEngine name for built in Engine(we can be clear about it in the javadoc) and choose another name for interface and other implementations can prefix their name to kNNEngine? |
|
Thanks @vamshin
Yes. totally possible as well, the end goal would be to have SPI module, which also aligns well with the sandbox idea. I didn't want to pull out new module for a sake of more contained change but that would come next.
This is possible, however that would explode the amount of changes. |
Signed-off-by: Andriy Redko <drreta@gmail.com>
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit cb6b1c0. 'Diff too large, requires skip by maintainers after manual review' Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
Description
This is a first change towards supporting extensibility (with respect to KNN/Vector libraries and engines) in the k-NN plugin. The change is small and contained, and does two things:
KNNEngineinterface (by pivoting off the enumeration)BuiltinKNNEngineenumeration (basically, mirror of theKNNEnginethat exists at the moment) to contain the changeset and usageWhy?
In scope of opensearch-project/OpenSearch#20050, we have discussed the possible ways how new KNN/Vector engines could be introduced, and most importantly, co-exist with the ones provided by K-NN plugin. The
KNNEngineis one of the key component here, unfortunately is it designed as enumeration and is not extensible (from the outside) but fixed.To break that barrier, this first change converts the
KNNEngineinto interface but keeps the previous revision of the enumeration asBuiltinKNNEngine. It dramatically reduces the changes required (99% of them is just renameKNNEngine->BuiltinKNNEngine), but at the same time keeps the API / usage mostly unaffected.What is next?
This changes unblock the possibility to extract KNN Engine/Library SPIs.
Related Issues
Towards opensearch-project/OpenSearch#20050
Check List
--signoff.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.