Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/core/algorithm/hnsw/hnsw_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ int HnswBuilder::init(const IndexMeta &meta, const ailego::Params &params) {
params.get(PARAM_HNSW_BUILDER_THREAD_COUNT, &thread_cnt_);
params.get(PARAM_HNSW_BUILDER_MIN_NEIGHBOR_COUNT, &min_neighbor_cnt_);
params.get(PARAM_HNSW_BUILDER_EFCONSTRUCTION, &ef_construction_);
params.get(PARAM_HNSW_BUILDER_SCALING_FACTOR, &scaling_factor_);
params.get(PARAM_HNSW_BUILDER_CHECK_INTERVAL_SECS, &check_interval_secs_);

params.get(PARAM_HNSW_BUILDER_MAX_NEIGHBOR_COUNT, &upper_max_neighbor_cnt_);
float multiplier = HnswEntity::kDefaultL0MaxNeighborCntMultiplier;
params.get(PARAM_HNSW_BUILDER_L0_MAX_NEIGHBOR_COUNT_MULTIPLIER, &multiplier);
l0_max_neighbor_cnt_ = multiplier * upper_max_neighbor_cnt_;
scaling_factor_ = upper_max_neighbor_cnt_;
params.get(PARAM_HNSW_BUILDER_SCALING_FACTOR, &scaling_factor_);

multiplier = HnswEntity::kDefaultNeighborPruneMultiplier;
params.get(PARAM_HNSW_BUILDER_NEIGHBOR_PRUNE_MULTIPLIER, &multiplier);
Expand Down
3 changes: 2 additions & 1 deletion src/core/algorithm/hnsw/hnsw_streamer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,15 @@ int HnswStreamer::init(const IndexMeta &imeta, const ailego::Params &params) {
multiplier = HnswEntity::kDefaultNeighborPruneMultiplier;
params.get(PARAM_HNSW_STREAMER_NEIGHBOR_PRUNE_MULTIPLIER, &multiplier);
size_t prune_cnt = multiplier * upper_max_neighbor_cnt_;
scaling_factor_ = upper_max_neighbor_cnt_;
params.get(PARAM_HNSW_STREAMER_SCALING_FACTOR, &scaling_factor_);

params.get(PARAM_HNSW_STREAMER_DOCS_HARD_LIMIT, &docs_hard_limit_);
params.get(PARAM_HNSW_STREAMER_EF, &ef_);
params.get(PARAM_HNSW_STREAMER_EFCONSTRUCTION, &ef_construction_);
params.get(PARAM_HNSW_STREAMER_VISIT_BLOOMFILTER_ENABLE, &bf_enabled_);
params.get(PARAM_HNSW_STREAMER_VISIT_BLOOMFILTER_NEGATIVE_PROB,
&bf_negative_prob_);
params.get(PARAM_HNSW_STREAMER_SCALING_FACTOR, &scaling_factor_);
params.get(PARAM_HNSW_STREAMER_BRUTE_FORCE_THRESHOLD, &bruteforce_threshold_);
params.get(PARAM_HNSW_STREAMER_MAX_SCAN_RATIO, &max_scan_ratio_);
params.get(PARAM_HNSW_STREAMER_MAX_SCAN_LIMIT, &max_scan_limit_);
Expand Down
3 changes: 2 additions & 1 deletion src/core/algorithm/hnsw_sparse/hnsw_sparse_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ int HnswSparseBuilder::init(const IndexMeta &meta,
params.get(PARAM_HNSW_SPARSE_BUILDER_MEMORY_QUOTA, &memory_quota);
params.get(PARAM_HNSW_SPARSE_BUILDER_THREAD_COUNT, &thread_cnt_);
params.get(PARAM_HNSW_SPARSE_BUILDER_EFCONSTRUCTION, &ef_construction_);
params.get(PARAM_HNSW_SPARSE_BUILDER_SCALING_FACTOR, &scaling_factor_);
params.get(PARAM_HNSW_SPARSE_BUILDER_CHECK_INTERVAL_SECS,
&check_interval_secs_);

Expand All @@ -49,6 +48,8 @@ int HnswSparseBuilder::init(const IndexMeta &meta,
params.get(PARAM_HNSW_SPARSE_BUILDER_L0_MAX_NEIGHBOR_COUNT_MULTIPLIER,
&multiplier);
l0_max_neighbor_cnt_ = multiplier * upper_max_neighbor_cnt_;
scaling_factor_ = upper_max_neighbor_cnt_;
params.get(PARAM_HNSW_SPARSE_BUILDER_SCALING_FACTOR, &scaling_factor_);

multiplier = HnswSparseEntity::kDefaultNeighborPruneMultiplier;
params.get(PARAM_HNSW_SPARSE_BUILDER_NEIGHBOR_PRUNE_MULTIPLIER, &multiplier);
Expand Down
3 changes: 2 additions & 1 deletion src/core/algorithm/hnsw_sparse/hnsw_sparse_streamer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@ int HnswSparseStreamer::init(const IndexMeta &imeta,
multiplier = HnswSparseEntity::kDefaultNeighborPruneMultiplier;
params.get(PARAM_HNSW_SPARSE_STREAMER_NEIGHBOR_PRUNE_MULTIPLIER, &multiplier);
size_t prune_cnt = multiplier * upper_max_neighbor_cnt_;
scaling_factor_ = upper_max_neighbor_cnt_;
params.get(PARAM_HNSW_SPARSE_STREAMER_SCALING_FACTOR, &scaling_factor_);

params.get(PARAM_HNSW_SPARSE_STREAMER_DOCS_HARD_LIMIT, &docs_hard_limit_);
params.get(PARAM_HNSW_SPARSE_STREAMER_EF, &ef_);
params.get(PARAM_HNSW_SPARSE_STREAMER_EFCONSTRUCTION, &ef_construction_);
params.get(PARAM_HNSW_SPARSE_STREAMER_VISIT_BLOOMFILTER_ENABLE, &bf_enabled_);
params.get(PARAM_HNSW_SPARSE_STREAMER_VISIT_BLOOMFILTER_NEGATIVE_PROB,
&bf_negative_prob_);
params.get(PARAM_HNSW_SPARSE_STREAMER_SCALING_FACTOR, &scaling_factor_);
params.get(PARAM_HNSW_SPARSE_STREAMER_BRUTE_FORCE_THRESHOLD,
&bruteforce_threshold_);
params.get(PARAM_HNSW_SPARSE_STREAMER_MAX_SCAN_RATIO, &max_scan_ratio_);
Expand Down