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: cmli <chengming.li@zilliz.com>

* update changelog and fix build error

Signed-off-by: cmli <chengming.li@zilliz.com>

Co-authored-by: cmli <chengming.li@zilliz.com>
pull/2789/head
op-hunter 2020-07-09 23:15:07 +08:00 committed by GitHub
parent 4038b0653e
commit 4922c9532f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 9 deletions

View File

@ -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

View File

@ -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);
}