opensearch-project / k-NN

🆕 Find the k-nearest neighbors (k-NN) for your vector data
https://opensearch.org/docs/latest/search-plugins/knn/index/
Apache License 2.0
152 stars 113 forks source link

[FEATURE] Add support for FAISS AVX512 #2056

Closed akashsha1 closed 1 week ago

akashsha1 commented 3 weeks ago

Is your feature request related to a problem? Improve performance of vector search and indexing when using the FAISS library, by using AVX512 accelerators which are supported in faiss.

What solution would you like? Add support to use AVX512, initially as an optional feature and eventually enable by default on machines where AVX512 is supported on subsequent OpenSearch releases. This will be a 2 part change: 1) Adds necessary code in k-NN to check for AVX512 support on the machine. 2) A separate change made in FAISS to add missing functions support for AVX512.

naveentatikonda commented 3 weeks ago

Add support to use AVX512, initially as an optional feature and eventually enable by default on machines where AVX512 is supported on subsequent OpenSearch releases.

@akashsha1 If the performance metrics looks good, we want to enable and support AVX512 by default if the underlying hardware supports it just like how we did for AVX2. But, we will provide a static setting(reboot the node or cluster after setting it in opensearch.yml) to disable AVX512 just in case users don't want to use it, like we did for avx2 (knn.faiss.avx2.disabled)

Expectation is we will build and ship all 3 versions of faiss library(generic, with avx2, with avx512). If the underlying system supports avx512 we will load avx512 faiss lib, if not look for avx2 else generic faiss library.