mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-30 23:45:28 +08:00
Merge branch 'branch-0.4.0' into 'branch-0.4.0'
MS-413 - MS-413 - Create index failed and server exited See merge request megasearch/milvus!441 Former-commit-id: aebea3c146c338c427c0a6e9f2cfa4e3c0017d3c
This commit is contained in:
commit
2c7556410c
@ -9,6 +9,7 @@ Please mark all change in change log and use the ticket from JIRA.
|
||||
- MS-412 - Fix gpu cache logical error
|
||||
- MS-416 - ExecutionEngineImpl::GpuCache has not return value cause crash
|
||||
- MS-417 - YAML sequence load disable cause scheduler startup failed
|
||||
- MS-413 - Create index failed and server exited
|
||||
|
||||
## Improvement
|
||||
- MS-327 - Clean code for milvus
|
||||
|
||||
@ -19,6 +19,8 @@ namespace zilliz {
|
||||
namespace milvus {
|
||||
namespace engine {
|
||||
|
||||
static constexpr float TYPICAL_COUNT = 1000000.0;
|
||||
|
||||
struct FileIOWriter {
|
||||
std::fstream fs;
|
||||
std::string name;
|
||||
@ -192,7 +194,13 @@ server::KnowhereError write_index(VecIndexPtr index, const std::string &location
|
||||
// TODO(linxj): redo here.
|
||||
void AutoGenParams(const IndexType &type, const long &size, zilliz::knowhere::Config &cfg) {
|
||||
auto nlist = cfg.get_with_default("nlist", 0);
|
||||
if (int(size/1000000.0) * nlist == 0) { cfg["nlist"] = int(size / 1000000.0 * 16384); }
|
||||
if (size <= TYPICAL_COUNT/16384 + 1) {
|
||||
//handle less row count, avoid nlist set to 0
|
||||
cfg["nlist"] = 1;
|
||||
} else if (int(size/TYPICAL_COUNT) * nlist == 0) {
|
||||
//calculate a proper nlist if nlist not specified or size less than TYPICAL_COUNT
|
||||
cfg["nlist"] = int(size / TYPICAL_COUNT * 16384);
|
||||
}
|
||||
|
||||
if (!cfg.contains("gpu_id")) { cfg["gpu_id"] = int(0); }
|
||||
if (!cfg.contains("metric_type")) { cfg["metric_type"] = "L2"; }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user