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
@@ -523,40 +524,22 @@ void wrap(py::module& m) {
523524 size_t window_size,
524525 size_t max_candidate_pool_size,
525526 size_t prune_to,
526- size_t num_threads) {
527- if (num_threads != std::numeric_limits<size_t >::max ()) {
528- PyErr_WarnEx (
529- PyExc_DeprecationWarning,
530- " Constructing VamanaBuildParameters with the \" num_threads\" "
531- " keyword "
532- " argument is deprecated, no longer has any effect, and will be "
533- " removed "
534- " from future versions of the library. Use the \" num_threads\" "
535- " keyword "
536- " argument of \" svs.Vamana.build\" instead!" ,
537- 1
538- );
539- }
540-
541- // Default the `prune_to` argument appropriately.
542- if (prune_to == std::numeric_limits<size_t >::max ()) {
543- prune_to = graph_max_degree;
544- }
545-
527+ bool use_full_search_history) {
546528 return svs::index::vamana::VamanaBuildParameters{
547529 alpha,
548530 graph_max_degree,
549531 window_size,
550532 max_candidate_pool_size,
551533 prune_to,
552- true };
534+ use_full_search_history };
553535 }),
554- py::arg (" alpha" ) = 1.2 ,
555- py::arg (" graph_max_degree" ) = 32 ,
556- py::arg (" window_size" ) = 64 ,
557- py::arg (" max_candidate_pool_size" ) = 80 ,
558- py::arg (" prune_to" ) = std::numeric_limits<size_t >::max (),
559- py::arg (" num_threads" ) = std::numeric_limits<size_t >::max (),
536+ py::arg (" alpha" ) = svs::FLOAT_PLACEHOLDER,
537+ py::arg (" graph_max_degree" ) = svs::VAMANA_GRAPH_MAX_DEGREE_DEFAULT,
538+ py::arg (" window_size" ) = svs::VAMANA_WINDOW_SIZE_DEFAULT,
539+ py::arg (" max_candidate_pool_size" ) = svs::UNSIGNED_INTEGER_PLACEHOLDER,
540+ py::arg (" prune_to" ) = svs::UNSIGNED_INTEGER_PLACEHOLDER,
541+ py::arg (" use_full_search_history" ) =
542+ svs::VAMANA_USE_FULL_SEARCH_HISTORY_DEFAULT,
560543 R"(
561544 Construct a new instance from keyword arguments.
562545
@@ -565,6 +548,7 @@ void wrap(py::module& m) {
565548 For distance types favoring minimization, set this to a number
566549 greater than 1.0 (typically, 1.2 is sufficient). For distance types
567550 preferring maximization, set to a value less than 1.0 (such as 0.95).
551+ The default value is 1.2 for L2 distance type and 0.95 for MIP/Cosine.
568552 graph_max_degree: The maximum out-degree in the final graph. Graphs with
569553 a higher degree tend to yield better accuracy and performance at the cost
570554 of a larger memory footprint.
@@ -573,10 +557,15 @@ void wrap(py::module& m) {
573557 longer construction time. Should be larger than `graph_max_degree`.
574558 max_candidate_pool_size: Limit on the number of candidates to consider
575559 for neighbor updates. Should be larger than `window_size`.
560+ The default value is ``graph_max_degree`` * 2.
576561 prune_to: Amount candidate lists will be pruned to when exceeding the
577562 target max degree. In general, setting this to slightly less than
578- `graph_max_degree` will yield faster index building times. Default:
579- `graph_max_degree`.
563+ ``graph_max_degree`` will yield faster index building times. Default:
564+ ` `graph_max_degree`` - 4 if
565+ ``graph_max_degree`` is at least 16, otherwise ``graph_max_degree``.
566+ use_full_search_history: When true, uses the full search history during
567+ graph construction, which can improve graph quality at the expense of
568+ additional memory and potentially longer build times.
580569 )"
581570 )
582571 .def_readwrite (" alpha" , &svs::index::vamana::VamanaBuildParameters::alpha)
@@ -660,4 +649,4 @@ overwritten when saving the index to this directory.
660649 )"
661650 );
662651}
663- } // namespace svs::python::vamana
652+ } // namespace svs::python::vamana
0 commit comments