Skip to content

Commit

Permalink
Fix faiss simdlib bug (#155)
Browse files Browse the repository at this point in the history
Signed-off-by: chasingegg <[email protected]>
  • Loading branch information
chasingegg authored Oct 18, 2023
1 parent 97549c3 commit 1dc6e21
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions cmake/libs/libfaiss.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ knowhere_file_glob(GLOB FAISS_AVX512_SRCS

knowhere_file_glob(GLOB FAISS_AVX2_SRCS
thirdparty/faiss/faiss/impl/*avx.cpp
thirdparty/faiss/faiss/impl/pq4_fast_scan_search_1.cpp
thirdparty/faiss/faiss/impl/pq4_fast_scan_search_qbs.cpp
thirdparty/faiss/faiss/IndexPQFastScan.cpp
thirdparty/faiss/faiss/IndexIVFPQFastScan.cpp)

list(REMOVE_ITEM FAISS_SRCS ${FAISS_AVX512_SRCS})
Expand Down
1 change: 0 additions & 1 deletion thirdparty/faiss/faiss/impl/ResidualQuantizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <faiss/utils/Heap.h>
#include <faiss/utils/distances.h>
#include <faiss/utils/hamming.h>
#include <faiss/utils/simdlib.h>
#include <faiss/utils/utils.h>

extern "C" {
Expand Down
3 changes: 1 addition & 2 deletions thirdparty/faiss/faiss/impl/pq4_fast_scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@

#include <faiss/impl/FaissAssert.h>
#include <faiss/impl/pq4_fast_scan.h>
#include <faiss/impl/simd_result_handlers.h>
#include <cstring>

#include <array>

namespace faiss {

using namespace simd_result_handlers;

/***************************************************************
* Packing functions for codes
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/faiss/faiss/utils/hamming-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include <faiss/utils/binary_distances.h>
#include <faiss/utils/simdlib.h>

namespace faiss {

extern const uint8_t hamdis_tab_ham_bytes[256];
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/faiss/faiss/utils/jaccard-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#define FAISS_JACCARD_INL_H

#include <faiss/utils/binary_distances.h>
#include <faiss/utils/simdlib.h>

namespace faiss {

struct JaccardComputer8 {
Expand Down
6 changes: 5 additions & 1 deletion thirdparty/faiss/faiss/utils/partitioning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
#include <faiss/impl/FaissAssert.h>
#include <faiss/utils/AlignedTable.h>
#include <faiss/utils/ordered_key_value.h>
#ifdef __AVX2__
#include <faiss/utils/simdlib.h>

#endif
#include <faiss/impl/platform_macros.h>

namespace faiss {
Expand Down Expand Up @@ -222,6 +223,7 @@ typename C::T partition_fuzzy_median3(
* SIMD routines when vals is an aligned array of uint16_t
******************************************************************/

#ifdef __AVX2__
namespace simd_partitioning {

void find_minimax(
Expand Down Expand Up @@ -738,6 +740,8 @@ uint16_t simd_partition_with_bounds(

} // namespace simd_partitioning

#endif

/******************************************************************
* Driver routine
******************************************************************/
Expand Down

0 comments on commit 1dc6e21

Please sign in to comment.