未验证 提交 4922c953 编写于 作者: O op-hunter 提交者: GitHub

fix a bug of getting wrong nprobe limitation in knowhere on GPU version (#2788)

* fix a bug of getting wrong nprobe limitation in knowhere on GPU version
Signed-off-by: Ncmli <chengming.li@zilliz.com>

* update changelog and fix build error
Signed-off-by: Ncmli <chengming.li@zilliz.com>
Co-authored-by: Ncmli <chengming.li@zilliz.com>
上级 4038b065
......@@ -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
......
......@@ -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 <cmath>
#include <memory>
#include <string>
#include <vector>
#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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册