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
156 stars 123 forks source link

Bump Faiss commit from 4eecd916 to 1f42e815 #2224

Closed naveentatikonda closed 1 month ago

naveentatikonda commented 1 month ago

Description

Bump Faiss commit from 4eecd916 to 1f42e815 to fix the below error while building faiss with avx512. https://build.ci.opensearch.org/blue/rest/organizations/jenkins/pipelines/distribution-build-opensearch/runs/10431/nodes/82/steps/436/log/?start=0

/tmp/tmpe4ej14tb/k-NN/jni/external/faiss/faiss/impl/ScalarQuantizer.cpp:405:41: error: could not convert ‘true’ from ‘bool’ to ‘faiss::{anonymous}::QuantizerTemplateScaling’
  405 | struct QuantizerTemplate<Codec, true, 16> : QuantizerTemplate<Codec, true, 1> {
      |                                         ^
/tmp/tmpe4ej14tb/k-NN/jni/external/faiss/faiss/impl/ScalarQuantizer.cpp:405:77: error: could not convert ‘true’ from ‘bool’ to ‘faiss::{anonymous}::QuantizerTemplateScaling’
  405 | struct QuantizerTemplate<Codec, true, 16> : QuantizerTemplate<Codec, true, 1> {
      |                                                                             ^
/tmp/tmpe4ej14tb/k-NN/jni/external/faiss/faiss/impl/ScalarQuantizer.cpp:505:42: error: could not convert ‘false’ from ‘bool’ to ‘faiss::{anonymous}::QuantizerTemplateScaling’
  505 | struct QuantizerTemplate<Codec, false, 16>
      |                                          ^
/tmp/tmpe4ej14tb/k-NN/jni/external/faiss/faiss/impl/ScalarQuantizer.cpp:506:44: error: could not convert ‘false’ from ‘bool’ to ‘faiss::{anonymous}::QuantizerTemplateScaling’
  506 |         : QuantizerTemplate<Codec, false, 1> {
      |                                            ^
/tmp/tmpe4ej14tb/k-NN/jni/external/faiss/faiss/impl/ScalarQuantizer.cpp: In instantiation of ‘faiss::ScalarQuantizer::SQuantizer* faiss::{anonymous}::select_quantizer_1(faiss::{anonymous}::QuantizerType, size_t, const std::vector<float>&) [with int SIMDWIDTH = 16; faiss::{anonymous}::QuantizerType = faiss::ScalarQuantizer::QuantizerType; size_t = long unsigned int]’:
/tmp/tmpe4ej14tb/k-NN/jni/external/faiss/faiss/impl/ScalarQuantizer.cpp:2036:56:   required from here
/tmp/tmpe4ej14tb/k-NN/jni/external/faiss/faiss/impl/ScalarQuantizer.cpp:914:20: error: new initializer expression list treated as compound expression [-fpermissive]
  914 |             return new QuantizerTemplate<
      |                    ^~~~~~~~~~~~~~~~~~~~~~
  915 |                     Codec8bit,
      |                     ~~~~~~~~~~
  916 |                     QuantizerTemplateScaling::NON_UNIFORM,
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  917 |                     SIMDWIDTH>(d, trained);
      |                     ~~~~~~~~~~~~~~~~~~~~~~

Check List

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.

naveentatikonda commented 1 month ago

Validated it by building faiss library with AVX512 on a machine with AVX512