diff --git a/CHANGELOG.md b/CHANGELOG.md index 12fb70649f790091cd58dd6550555462cbaf80b6..978efae8f3a015dce9465e95bc4a73efc60ba633 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ Please mark all change in change log and use the issue from GitHub - \#2690 Remove body parser in show-partitions endpoints - \#2692 Milvus hangs during multi-thread concurrent search - \#2739 Fix mishards start failed +- \#2767 fix a bug of getting wrong nprobe limitation in knowhere on GPU version - \#2776 Fix too many data copies during creating IVF index ## Feature diff --git a/core/src/index/knowhere/knowhere/index/vector_index/ConfAdapter.cpp b/core/src/index/knowhere/knowhere/index/vector_index/ConfAdapter.cpp index 253087bf36d2e5d60dad1f6f94365c74aed0ea5b..79afbc7b6ffaa9da46eba8b57cc71ffa4ee46abd 100644 --- a/core/src/index/knowhere/knowhere/index/vector_index/ConfAdapter.cpp +++ b/core/src/index/knowhere/knowhere/index/vector_index/ConfAdapter.cpp @@ -10,23 +10,19 @@ // or implied. See the License for the specific language governing permissions and limitations under the License. #include "knowhere/index/vector_index/ConfAdapter.h" - #include #include #include #include - #include "knowhere/index/vector_index/helpers/IndexParameter.h" +#ifdef MILVUS_GPU_VERSION +#include "faiss/gpu/utils/DeviceUtils.h" +#endif + namespace milvus { namespace knowhere { -#if CUDA_VERSION > 9000 -#define GPU_MAX_NRPOBE 2048 -#else -#define GPU_MAX_NRPOBE 1024 -#endif - #define DEFAULT_MAX_DIM 32768 #define DEFAULT_MIN_DIM 1 #define DEFAULT_MAX_K 16384 @@ -116,7 +112,9 @@ IVFConfAdapter::CheckSearch(Config& oricfg, const IndexType type, const IndexMod static int64_t MAX_NPROBE = 999999; // todo(linxj): [1, nlist] if (mode == IndexMode::MODE_GPU) { - CheckIntByRange(knowhere::IndexParams::nprobe, MIN_NPROBE, GPU_MAX_NRPOBE); +#ifdef MILVUS_GPU_VERSION + CheckIntByRange(knowhere::IndexParams::nprobe, MIN_NPROBE, faiss::gpu::getMaxKSelection()); +#endif } else { CheckIntByRange(knowhere::IndexParams::nprobe, MIN_NPROBE, MAX_NPROBE); }