Skip to content

Commit 89b3867

Browse files
authored
Update build parameter defaults (#176)
Internal testing shows better performance with new defaults.
1 parent 521f3a2 commit 89b3867

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

bindings/python/src/vamana.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ void wrap(py::module& m) {
454454
longer construction time. Should be larger than `graph_max_degree`.
455455
max_candidate_pool_size: Limit on the number of candidates to consider
456456
for neighbor updates. Should be larger than `window_size`.
457-
The default value is ``graph_max_degree`` * 2.
457+
The default value is ``window_size`` * 3.
458458
prune_to: Amount candidate lists will be pruned to when exceeding the
459459
target max degree. In general, setting this to slightly less than
460460
``graph_max_degree`` will yield faster index building times. Default:

include/svs/index/vamana/index.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ void verify_and_set_default_index_parameters(
10131013
) {
10141014
// Set default values
10151015
if (parameters.max_candidate_pool_size == svs::UNSIGNED_INTEGER_PLACEHOLDER) {
1016-
parameters.max_candidate_pool_size = 2 * parameters.graph_max_degree;
1016+
parameters.max_candidate_pool_size = 3 * parameters.window_size;
10171017
}
10181018

10191019
if (parameters.prune_to == svs::UNSIGNED_INTEGER_PLACEHOLDER) {

include/svs/lib/preprocessor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ namespace svs {
178178
inline constexpr size_t UNSIGNED_INTEGER_PLACEHOLDER = std::numeric_limits<size_t>::max();
179179
inline constexpr float FLOAT_PLACEHOLDER = std::numeric_limits<float>::max();
180180
inline constexpr float VAMANA_GRAPH_MAX_DEGREE_DEFAULT = 32;
181-
inline constexpr float VAMANA_WINDOW_SIZE_DEFAULT = 64;
181+
inline constexpr float VAMANA_WINDOW_SIZE_DEFAULT = 200;
182182
inline constexpr bool VAMANA_USE_FULL_SEARCH_HISTORY_DEFAULT = true;
183183
inline constexpr float VAMANA_ALPHA_MINIMIZE_DEFAULT = 1.2;
184184
inline constexpr float VAMANA_ALPHA_MAXIMIZE_DEFAULT = 0.95;

tests/svs/index/vamana/dynamic_index_2.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,10 +670,10 @@ CATCH_TEST_CASE("Dynamic Vamana Index Default Parameters", "[parameter][vamana]"
670670
index.get_construction_window_size() == svs::VAMANA_WINDOW_SIZE_DEFAULT
671671
);
672672
CATCH_REQUIRE(
673-
index.get_max_candidates() == 2 * svs::VAMANA_GRAPH_MAX_DEGREE_DEFAULT
673+
index.get_max_candidates() == 3 * svs::VAMANA_WINDOW_SIZE_DEFAULT
674674
);
675675
CATCH_REQUIRE(
676676
index.get_full_search_history() == svs::VAMANA_USE_FULL_SEARCH_HISTORY_DEFAULT
677677
);
678678
}
679-
}
679+
}

tests/svs/index/vamana/index.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,10 @@ CATCH_TEST_CASE("Vamana Index Default Parameters", "[parameter][vamana]") {
255255
index.get_construction_window_size() == svs::VAMANA_WINDOW_SIZE_DEFAULT
256256
);
257257
CATCH_REQUIRE(
258-
index.get_max_candidates() == 2 * svs::VAMANA_GRAPH_MAX_DEGREE_DEFAULT
258+
index.get_max_candidates() == 3 * svs::VAMANA_WINDOW_SIZE_DEFAULT
259259
);
260260
CATCH_REQUIRE(
261261
index.get_full_search_history() == svs::VAMANA_USE_FULL_SEARCH_HISTORY_DEFAULT
262262
);
263263
}
264-
}
264+
}

0 commit comments

Comments
 (0)