提交 adc77015 编写于 作者: X xj.lin

MS-307 enable-nsg


Former-commit-id: 5ed714d17e5ad58b610fd01d1041eb11203b15bf
上级 3db2702a
......@@ -20,7 +20,7 @@ enum class EngineType {
FAISS_IVFFLAT,
FAISS_IVFSQ8,
NSG_MIX,
MAX_VALUE = FAISS_IVFSQ8,
MAX_VALUE = NSG_MIX,
};
class ExecutionEngine {
......
......@@ -203,11 +203,13 @@ void AutoGenParams(const IndexType &type, const long &size, zilliz::knowhere::Co
case IndexType::NSG_MIX: {
auto scale_factor = round(cfg["dim"].as<int>() / 128.0);
scale_factor = scale_factor >= 4 ? 4 : scale_factor;
if (!cfg.contains("nprobe")) { cfg["nprobe"] = 16 + 10 * scale_factor; }
cfg["nlist"] = int(size / 1000000.0 * 8192);
if (!cfg.contains("nprobe")) { cfg["nprobe"] = 6 + 10 * scale_factor; }
if (!cfg.contains("knng")) { cfg["knng"] = 100 + 100 * scale_factor; }
if (!cfg.contains("search_length")) { cfg["search_length"] = 30 + 10 * scale_factor; }
if (!cfg.contains("out_degree")) { cfg["out_degree"] = 40 + 5 * scale_factor; }
if (!cfg.contains("search_length")) { cfg["search_length"] = 40 + 5 * scale_factor; }
if (!cfg.contains("out_degree")) { cfg["out_degree"] = 50 + 5 * scale_factor; }
if (!cfg.contains("candidate_pool_size")) { cfg["candidate_pool_size"] = 200 + 100 * scale_factor; }
WRAPPER_LOG_DEBUG << pretty_print(cfg);
break;
}
}
......
knowhere @ 6a4f242e
Subproject commit 5032e91e3d8bee1760c3f86f7eb4c857e59546ad
Subproject commit 6a4f242ec40c539f1e6d9a7305282f7ff03c19d2
......@@ -110,9 +110,9 @@ INSTANTIATE_TEST_CASE_P(WrapperParam, KnowhereWrapperTest,
Config::object{{"dim", 64}, {"k", 10}, {"nprobe", 5}}
),
std::make_tuple(IndexType::NSG_MIX, "Default",
128, 100000, 10, 10,
Config::object{{"dim", 128}, {"nlist", 1638}, {"nprobe", 10}, {"metric_type", "L2"},
{"knng", 50}, {"search_length", 40}, {"out_degree", 30}, {"candidate_pool_size", 200}},
128, 250000, 10, 10,
Config::object{{"dim", 128}, {"nlist", 8192}, {"nprobe", 16}, {"metric_type", "L2"},
{"knng", 200}, {"search_length", 40}, {"out_degree", 60}, {"candidate_pool_size", 200}},
Config::object{{"k", 10}, {"search_length", 20}}
)
//std::make_tuple(IndexType::SPTAG_KDT_RNT_CPU, "Default",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册