3030#include " svs/lib/dispatcher.h"
3131#include " svs/lib/float16.h"
3232#include " svs/lib/meta.h"
33+ #include " svs/lib/preprocessor.h"
3334#include " svs/orchestrators/vamana.h"
3435
3536// pybind
@@ -420,40 +421,22 @@ void wrap(py::module& m) {
420421 size_t window_size,
421422 size_t max_candidate_pool_size,
422423 size_t prune_to,
423- size_t num_threads) {
424- if (num_threads != std::numeric_limits<size_t >::max ()) {
425- PyErr_WarnEx (
426- PyExc_DeprecationWarning,
427- " Constructing VamanaBuildParameters with the \" num_threads\" "
428- " keyword "
429- " argument is deprecated, no longer has any effect, and will be "
430- " removed "
431- " from future versions of the library. Use the \" num_threads\" "
432- " keyword "
433- " argument of \" svs.Vamana.build\" instead!" ,
434- 1
435- );
436- }
437-
438- // Default the `prune_to` argument appropriately.
439- if (prune_to == std::numeric_limits<size_t >::max ()) {
440- prune_to = graph_max_degree;
441- }
442-
424+ bool use_full_search_history) {
443425 return svs::index::vamana::VamanaBuildParameters{
444426 alpha,
445427 graph_max_degree,
446428 window_size,
447429 max_candidate_pool_size,
448430 prune_to,
449- true };
431+ use_full_search_history };
450432 }),
451- py::arg (" alpha" ) = 1.2 ,
452- py::arg (" graph_max_degree" ) = 32 ,
453- py::arg (" window_size" ) = 64 ,
454- py::arg (" max_candidate_pool_size" ) = 80 ,
455- py::arg (" prune_to" ) = std::numeric_limits<size_t >::max (),
456- py::arg (" num_threads" ) = std::numeric_limits<size_t >::max (),
433+ py::arg (" alpha" ) = svs::FLOAT_PLACEHOLDER,
434+ py::arg (" graph_max_degree" ) = svs::VAMANA_GRAPH_MAX_DEGREE_DEFAULT,
435+ py::arg (" window_size" ) = svs::VAMANA_WINDOW_SIZE_DEFAULT,
436+ py::arg (" max_candidate_pool_size" ) = svs::UNSIGNED_INTEGER_PLACEHOLDER,
437+ py::arg (" prune_to" ) = svs::UNSIGNED_INTEGER_PLACEHOLDER,
438+ py::arg (" use_full_search_history" ) =
439+ svs::VAMANA_USE_FULL_SEARCH_HISTORY_DEFAULT,
457440 R"(
458441 Construct a new instance from keyword arguments.
459442
@@ -462,6 +445,7 @@ void wrap(py::module& m) {
462445 For distance types favoring minimization, set this to a number
463446 greater than 1.0 (typically, 1.2 is sufficient). For distance types
464447 preferring maximization, set to a value less than 1.0 (such as 0.95).
448+ The default value is 1.2 for L2 distance type and 0.95 for MIP/Cosine.
465449 graph_max_degree: The maximum out-degree in the final graph. Graphs with
466450 a higher degree tend to yield better accuracy and performance at the cost
467451 of a larger memory footprint.
@@ -470,10 +454,15 @@ void wrap(py::module& m) {
470454 longer construction time. Should be larger than `graph_max_degree`.
471455 max_candidate_pool_size: Limit on the number of candidates to consider
472456 for neighbor updates. Should be larger than `window_size`.
457+ The default value is ``graph_max_degree`` * 2.
473458 prune_to: Amount candidate lists will be pruned to when exceeding the
474459 target max degree. In general, setting this to slightly less than
475- `graph_max_degree` will yield faster index building times. Default:
476- `graph_max_degree`.
460+ ``graph_max_degree`` will yield faster index building times. Default:
461+ ` `graph_max_degree`` - 4 if
462+ ``graph_max_degree`` is at least 16, otherwise ``graph_max_degree``.
463+ use_full_search_history: When true, uses the full search history during
464+ graph construction, which can improve graph quality at the expense of
465+ additional memory and potentially longer build times.
477466 )"
478467 )
479468 .def_readwrite (" alpha" , &svs::index::vamana::VamanaBuildParameters::alpha)
@@ -557,4 +546,4 @@ overwritten when saving the index to this directory.
557546 )"
558547 );
559548}
560- } // namespace svs::python::vamana
549+ } // namespace svs::python::vamana
0 commit comments