diff --git a/.github/actions/build_conda/action.yml b/.github/actions/build_conda/action.yml index d2e56d23c3..14c227035f 100644 --- a/.github/actions/build_conda/action.yml +++ b/.github/actions/build_conda/action.yml @@ -44,7 +44,7 @@ runs: # Ensure starting packages are from conda-forge. conda list --show-channel-urls conda install -y -q "conda!=24.11.0" - conda install -y -q "conda-build!=24.11.0" + conda install -y -q "conda-build!=24.11.0" "liblief=0.14.1" conda list --show-channel-urls - name: Enable anaconda uploads if: inputs.label != '' diff --git a/conda/faiss-gpu-cuvs/meta.yaml b/conda/faiss-gpu-cuvs/meta.yaml index 45a757b59b..67488632f6 100644 --- a/conda/faiss-gpu-cuvs/meta.yaml +++ b/conda/faiss-gpu-cuvs/meta.yaml @@ -104,11 +104,13 @@ outputs: - mkl =2023 # [x86_64] - cuda-toolkit {{ cudatoolkit }} host: + - mkl =2023 # [x86_64] - _openmp_mutex =4.5=2_kmp_llvm # [x86_64] - python {{ python }} - numpy >=1.19,<2 - {{ pin_subpackage('libfaiss', exact=True) }} run: + - mkl =2023 # [x86_64] - _openmp_mutex =4.5=2_kmp_llvm # [x86_64] - python {{ python }} - numpy >=1.19,<2 diff --git a/conda/faiss-gpu/meta.yaml b/conda/faiss-gpu/meta.yaml index f15c9556d9..8c8c017ff1 100644 --- a/conda/faiss-gpu/meta.yaml +++ b/conda/faiss-gpu/meta.yaml @@ -89,12 +89,15 @@ outputs: - make =4.4 # [osx and arm64] - _openmp_mutex =4.5=2_kmp_llvm # [x86_64 and not win] - cuda-toolkit {{ cudatoolkit }} + - mkl-devel =2023.0 # [x86_64] host: + - mkl =2023.0 # [x86_64] - python {{ python }} - numpy >=1.19,<2 - _openmp_mutex =4.5=2_kmp_llvm # [x86_64 and not win] - {{ pin_subpackage('libfaiss', exact=True) }} run: + - mkl =2023.0 # [x86_64] - python {{ python }} - numpy >=1.19,<2 - packaging diff --git a/faiss/gpu/impl/CuvsCagra.cu b/faiss/gpu/impl/CuvsCagra.cu index 82e3007d59..f60e1e3ab5 100644 --- a/faiss/gpu/impl/CuvsCagra.cu +++ b/faiss/gpu/impl/CuvsCagra.cu @@ -69,6 +69,7 @@ CuvsCagra::CuvsCagra( index_params_.intermediate_graph_degree = intermediate_graph_degree; index_params_.graph_degree = graph_degree; + index_params_.attach_dataset_on_build = store_dataset; if (!ivf_pq_search_params_) { ivf_pq_search_params_ = @@ -243,6 +244,7 @@ void CuvsCagra::search( storage_, n_, dim_); cuvs_index->update_dataset(raft_handle, dataset); } + store_dataset_ = true; } auto queries_view = raft::make_device_matrix_view( diff --git a/faiss/impl/HNSW.cpp b/faiss/impl/HNSW.cpp index ece0281221..61afa00231 100644 --- a/faiss/impl/HNSW.cpp +++ b/faiss/impl/HNSW.cpp @@ -32,6 +32,7 @@ namespace faiss { **************************************************************/ int HNSW::nb_neighbors(int layer_no) const { + FAISS_THROW_IF_NOT(layer_no + 1 < cum_nneighbor_per_level.size()); return cum_nneighbor_per_level[layer_no + 1] - cum_nneighbor_per_level[layer_no]; } diff --git a/faiss/impl/code_distance/code_distance-sve.h b/faiss/impl/code_distance/code_distance-sve.h index 713b7d8099..d85e47d279 100644 --- a/faiss/impl/code_distance/code_distance-sve.h +++ b/faiss/impl/code_distance/code_distance-sve.h @@ -217,8 +217,6 @@ static void distance_four_codes_sve_for_small_m( const auto offsets_0 = svindex_u32(0, static_cast(ksub)); - const auto quad_lanes = svcntw(); - // loop const auto pg = svwhilelt_b32_u64(0, M); diff --git a/tests/test_hnsw.cpp b/tests/test_hnsw.cpp index b3c93a861e..9424bd3499 100644 --- a/tests/test_hnsw.cpp +++ b/tests/test_hnsw.cpp @@ -582,6 +582,16 @@ TEST_F(HNSWTest, TEST_search_neighbors_to_add) { } } +TEST_F(HNSWTest, TEST_nb_neighbors_bound) { + omp_set_num_threads(1); + EXPECT_EQ(index->hnsw.nb_neighbors(0), 8); + EXPECT_EQ(index->hnsw.nb_neighbors(1), 4); + EXPECT_EQ(index->hnsw.nb_neighbors(2), 4); + EXPECT_EQ(index->hnsw.nb_neighbors(3), 4); + // picking a large number to trigger an exception based on checking bounds + EXPECT_THROW(index->hnsw.nb_neighbors(100), faiss::FaissException); +} + TEST_F(HNSWTest, TEST_search_level_0) { omp_set_num_threads(1); std::vector I(k * nq);