Skip to content

Commit 6a5555e

Browse files
antyjjJLY2015
andauthored
modify build_thread_count equal to 0 to make vsag Add paralell (#3)
Co-authored-by: 夏进 <yangjiali.yjl@antgroup.com>
1 parent 6c3e4cf commit 6a5555e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

ob_vsag_lib.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ int create_index(VectorIndexPtr& index_handler, IndexType index_type,
398398
// NOTE(liyao): max_degree compatible with behavior of HNSW, which is doubling the m value
399399
{"max_degree", max_degree},
400400
{"ef_construction", ef_construction},
401-
{"build_thread_count", 1}};
401+
{"build_thread_count", 0}};
402402
index_parameters = {{"dtype", dtype}, {"metric_type", metric}, {"dim", dim}, {"extra_info_size", extra_info_size}, {"index_param", hnswsq_parameters}};
403403
} else if (index_type == HGRAPH_TYPE) {
404404
// create hnsw fp index
@@ -408,7 +408,7 @@ int create_index(VectorIndexPtr& index_handler, IndexType index_type,
408408
// NOTE(liyao): max_degree compatible with behavior of HNSW, which is doubling the m value
409409
{"max_degree", max_degree},
410410
{"ef_construction", ef_construction},
411-
{"build_thread_count", 1}};
411+
{"build_thread_count", 0}};
412412
index_parameters = {{"dtype", dtype}, {"metric_type", metric}, {"dim", dim}, {"extra_info_size", extra_info_size}, {"index_param", hnswsq_parameters}};
413413
} else if (index_type == HNSW_BQ_TYPE) {
414414
// create hnsw bq index
@@ -418,7 +418,7 @@ int create_index(VectorIndexPtr& index_handler, IndexType index_type,
418418
// NOTE(liyao): max_degree compatible with behavior of HNSW, which is doubling the m value
419419
{"max_degree", max_degree},
420420
{"ef_construction", ef_construction},
421-
{"build_thread_count", 1},
421+
{"build_thread_count", 0},
422422
{"use_reorder", true},
423423
{"ignore_reorder", true},
424424
{"precise_quantization_type", "fp32"},
@@ -727,13 +727,13 @@ int fdeserialize(VectorIndexPtr& index_handler, std::istream& in_stream) {
727727
nlohmann::json hnswsq_parameters{{"base_quantization_type", base_quantization_type},
728728
{"max_degree", max_degree},
729729
{"ef_construction", ef_construction},
730-
{"build_thread_count", 1}};
730+
{"build_thread_count", 0}};
731731
index_parameters = {{"dtype", dtype}, {"metric_type", metric}, {"dim", dim}, {"extra_info_size", extra_info_size}, {"index_param", hnswsq_parameters}};
732732
} else if (HNSW_BQ_TYPE == index_type) {
733733
nlohmann::json hnswbq_parameters{{"base_quantization_type", "rabitq"},
734734
{"max_degree", max_degree},
735735
{"ef_construction", ef_construction},
736-
{"build_thread_count", 1},
736+
{"build_thread_count", 0},
737737
{"use_reorder", true},
738738
{"ignore_reorder", true},
739739
{"precise_quantization_type", "fp32"},
@@ -743,7 +743,7 @@ int fdeserialize(VectorIndexPtr& index_handler, std::istream& in_stream) {
743743
nlohmann::json hnswsq_parameters{{"base_quantization_type", base_quantization_type},
744744
{"max_degree", max_degree},
745745
{"ef_construction", ef_construction},
746-
{"build_thread_count", 1}};
746+
{"build_thread_count", 0}};
747747
index_parameters = {{"dtype", dtype}, {"metric_type", metric}, {"dim", dim}, {"extra_info_size", extra_info_size}, {"index_param", hnswsq_parameters}};
748748
}
749749

@@ -829,7 +829,7 @@ int deserialize_bin(VectorIndexPtr& index_handler,const std::string dir) {
829829
nlohmann::json hnswbq_parameters{{"base_quantization_type", base_quantization_type},
830830
{"max_degree", max_degree},
831831
{"ef_construction", ef_construction},
832-
{"build_thread_count", 1},
832+
{"build_thread_count", 0},
833833
{"extra_info_size", extra_info_size},
834834
{"use_reorder", true},
835835
{"ignore_reorder", true},
@@ -840,7 +840,7 @@ int deserialize_bin(VectorIndexPtr& index_handler,const std::string dir) {
840840
nlohmann::json hnswsq_parameters{{"base_quantization_type", base_quantization_type},
841841
{"max_degree", max_degree},
842842
{"ef_construction", ef_construction},
843-
{"build_thread_count", 1},
843+
{"build_thread_count", 0},
844844
{"extra_info_size", extra_info_size}};
845845
index_parameters = {{"dtype", dtype}, {"metric_type", metric}, {"dim", dim}, {"index_param", hnswsq_parameters}};
846846
}
@@ -977,4 +977,4 @@ extern int deserialize_bin_c(VectorIndexPtr& index_handler,const std::string dir
977977
return deserialize_bin(index_handler, dir);
978978
}
979979

980-
} //namespace obvectorlib
980+
} //namespace obvectorlib

0 commit comments

Comments
 (0)