Skip to content
Merged
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
7 changes: 4 additions & 3 deletions src/svsbench/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ def _read_args(argv: list[str] | None = None) -> argparse.Namespace:
)
parser.add_argument(
"--max_threads_init",
help="Maximum number of threads for the first operation",
default=max(len(os.sched_getaffinity(0)) - 1, 1),
help="Maximum number of threads for building the initial graph",
type=int,
)
parser.add_argument(
Expand Down Expand Up @@ -157,7 +156,7 @@ def build_dynamic(
max_candidate_pool_size: int = 750,
alpha: float | None = None,
max_threads: int = 1,
max_threads_init: int = 1,
max_threads_init: int | None = None,
batch_size: int = 10000,
num_vectors_delete: int = 0,
num_vectors_init: int | None = None,
Expand Down Expand Up @@ -202,6 +201,8 @@ def build_dynamic(
num_vectors_init = batch_size
else:
num_vectors_init = int(num_vectors * proportion_vectors_init)
if max_threads_init is None:
max_threads_init = max_threads
if not max_threads_ignore_batch:
max_threads = min(max_threads, batch_size)
max_threads_init = min(max_threads_init, num_vectors_init)
Expand Down
Loading