Skip to content

Commit

Permalink
increase the upper limit of the index parameter max_degree (#63)
Browse files Browse the repository at this point in the history
Signed-off-by: wxy407827 <wxy407827@antgroup.com>
  • Loading branch information
wxyucs authored and jinjiabao.jjb committed Dec 16, 2024
1 parent 11bd7b2 commit d9b242b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/index/diskann_zparameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,18 @@ CreateDiskannParameters::FromJson(const std::string& json_string) {
params[INDEX_DISKANN].contains(DISKANN_PARAMETER_R),
fmt::format("parameters[{}] must contains {}", INDEX_DISKANN, DISKANN_PARAMETER_R));
obj.max_degree = params[INDEX_DISKANN][DISKANN_PARAMETER_R];
CHECK_ARGUMENT((5 <= obj.max_degree) and (obj.max_degree <= 128),
fmt::format("max_degree({}) must in range[5, 128]", obj.max_degree));

// set obj.ef_construction
CHECK_ARGUMENT(
params[INDEX_DISKANN].contains(DISKANN_PARAMETER_L),
fmt::format("parameters[{}] must contains {}", INDEX_DISKANN, DISKANN_PARAMETER_L));
obj.ef_construction = params[INDEX_DISKANN][DISKANN_PARAMETER_L];
CHECK_ARGUMENT((obj.max_degree <= obj.ef_construction) and (obj.ef_construction <= 1000),
fmt::format("ef_construction({}) must in range[$max_degree({}), 64]",
obj.ef_construction,
obj.max_degree));

// set obj.pq_dims
CHECK_ARGUMENT(
Expand Down
4 changes: 2 additions & 2 deletions src/index/hnsw_zparameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ CreateHnswParameters::FromJson(const std::string& json_string) {
CHECK_ARGUMENT(params[INDEX_HNSW].contains(HNSW_PARAMETER_M),
fmt::format("parameters[{}] must contains {}", INDEX_HNSW, HNSW_PARAMETER_M));
obj.max_degree = params[INDEX_HNSW][HNSW_PARAMETER_M];
CHECK_ARGUMENT((5 <= obj.max_degree) and (obj.max_degree <= 64),
fmt::format("max_degree({}) must in range[5, 64]", obj.max_degree));
CHECK_ARGUMENT((5 <= obj.max_degree) and (obj.max_degree <= 128),
fmt::format("max_degree({}) must in range[5, 128]", obj.max_degree));

// set obj.ef_construction
CHECK_ARGUMENT(
Expand Down

0 comments on commit d9b242b

Please sign in to comment.