Suit the range of HNSW parameters (#2638)

Signed-off-by: shengjun.li <shengjun.li@zilliz.com>
pull/2650/head^2
shengjun.li 2020-06-22 16:42:15 +08:00 committed by GitHub
parent 0500d26ce2
commit cd04f3fc9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View File

@ -11,6 +11,7 @@ Please mark all change in change log and use the issue from GitHub
- \#2557 fix random crash of INSERT_DUPLICATE_ID case
- \#2598 fix Milvus docker image report illegal instruction
- \#2617 Fix HNSW and RNSG index files size
- \#2637 Suit the range of HNSW parameters
## Feature

View File

@ -230,10 +230,10 @@ NSGConfAdapter::CheckSearch(Config& oricfg, const IndexType type, const IndexMod
bool
HNSWConfAdapter::CheckTrain(Config& oricfg, const IndexMode mode) {
static int64_t MIN_EFCONSTRUCTION = 100;
static int64_t MAX_EFCONSTRUCTION = 800;
static int64_t MIN_M = 5;
static int64_t MAX_M = 48;
static int64_t MIN_EFCONSTRUCTION = 8;
static int64_t MAX_EFCONSTRUCTION = 512;
static int64_t MIN_M = 4;
static int64_t MAX_M = 64;
CheckIntByRange(knowhere::meta::ROWS, DEFAULT_MIN_ROWS, DEFAULT_MAX_ROWS);
CheckIntByRange(knowhere::IndexParams::efConstruction, MIN_EFCONSTRUCTION, MAX_EFCONSTRUCTION);

View File

@ -261,11 +261,11 @@ ValidationUtil::ValidateIndexParams(const milvus::json& index_params,
break;
}
case (int32_t)engine::EngineType::HNSW: {
auto status = CheckParameterRange(index_params, knowhere::IndexParams::M, 5, 48);
auto status = CheckParameterRange(index_params, knowhere::IndexParams::M, 4, 64);
if (!status.ok()) {
return status;
}
status = CheckParameterRange(index_params, knowhere::IndexParams::efConstruction, 100, 500);
status = CheckParameterRange(index_params, knowhere::IndexParams::efConstruction, 8, 512);
if (!status.ok()) {
return status;
}