mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-30 15:35:33 +08:00
add nlist and use blas conf
Former-commit-id: 4c3cf2ea9b2377eef1da8de67e35a07ae9cd6971
This commit is contained in:
parent
d05ae97f7e
commit
2366204de3
@ -18,6 +18,7 @@ Please mark all change in change log and use the ticket from JIRA.
|
||||
- MS-152 - Delete assert in MySQLMetaImpl and change MySQLConnectionPool impl
|
||||
|
||||
## New Feature
|
||||
- MS-195 - Add nlist and use_blas_threshold conf
|
||||
|
||||
## Task
|
||||
|
||||
|
||||
@ -33,4 +33,6 @@ cache_config: # cache configure
|
||||
cpu_cache_capacity: 16 # how many memory are used as cache, unit: GB, range: 0 ~ less than total memory
|
||||
|
||||
engine_config:
|
||||
nprobe: 10
|
||||
nprobe: 10
|
||||
nlist: 16381
|
||||
use_blas_threshold: 10
|
||||
@ -167,6 +167,7 @@ Status FaissExecutionEngine::Init() {
|
||||
ServerConfig &config = ServerConfig::GetInstance();
|
||||
ConfigNode engine_config = config.GetConfig(CONFIG_ENGINE);
|
||||
nprobe_ = engine_config.GetInt32Value(CONFIG_NPROBE, 1000);
|
||||
nlist_ = engine_config.GetInt32Value(CONFIG_NLIST,16384);
|
||||
|
||||
} else if(build_index_type_ == "IDMap") {
|
||||
;
|
||||
|
||||
@ -65,6 +65,7 @@ protected:
|
||||
std::string raw_index_type_;
|
||||
|
||||
size_t nprobe_ = 0;
|
||||
size_t nlist_ = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
|
||||
#include "milvus_types.h"
|
||||
#include "milvus_constants.h"
|
||||
#include "faiss/utils.h"
|
||||
|
||||
#include <thrift/protocol/TBinaryProtocol.h>
|
||||
#include <thrift/protocol/TJSONProtocol.h>
|
||||
@ -25,6 +26,8 @@
|
||||
#include <thread>
|
||||
#include <iostream>
|
||||
|
||||
//extern int distance_compute_blas_threshold;
|
||||
|
||||
namespace zilliz {
|
||||
namespace milvus {
|
||||
namespace server {
|
||||
@ -46,11 +49,12 @@ MilvusServer::StartService() {
|
||||
|
||||
ServerConfig &config = ServerConfig::GetInstance();
|
||||
ConfigNode server_config = config.GetConfig(CONFIG_SERVER);
|
||||
|
||||
ConfigNode engine_config = config.GetConfig(CONFIG_ENGINE);
|
||||
std::string address = server_config.GetValue(CONFIG_SERVER_ADDRESS, "127.0.0.1");
|
||||
int32_t port = server_config.GetInt32Value(CONFIG_SERVER_PORT, 19530);
|
||||
std::string protocol = server_config.GetValue(CONFIG_SERVER_PROTOCOL, "binary");
|
||||
|
||||
faiss::distance_compute_blas_threshold = engine_config.GetInt32Value(CONFIG_DCBT,20);
|
||||
// std::cout<<"distance_compute_blas_threshold = "<< faiss::distance_compute_blas_threshold << std::endl;
|
||||
try {
|
||||
DBWrapper::DB();//initialize db
|
||||
|
||||
|
||||
@ -44,6 +44,8 @@ static const std::string CONFIG_METRIC_PROMETHEUS_PORT = "port";
|
||||
|
||||
static const std::string CONFIG_ENGINE = "engine_config";
|
||||
static const std::string CONFIG_NPROBE = "nprobe";
|
||||
static const std::string CONFIG_NLIST = "nlist";
|
||||
static const std::string CONFIG_DCBT = "use_blas_threshold";
|
||||
|
||||
class ServerConfig {
|
||||
public:
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
// Proprietary and confidential.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <src/server/ServerConfig.h>
|
||||
#include "Operand.h"
|
||||
|
||||
|
||||
@ -38,8 +39,15 @@ string Operand::get_index_type(const int &nb) {
|
||||
break;
|
||||
}
|
||||
case IVF: {
|
||||
|
||||
using namespace zilliz::milvus::server;
|
||||
ServerConfig &config = ServerConfig::GetInstance();
|
||||
ConfigNode engine_config = config.GetConfig(CONFIG_ENGINE);
|
||||
size_t nlist = engine_config.GetInt32Value(CONFIG_NLIST, 16384);
|
||||
|
||||
index_str += (ncent != 0 ? index_type + std::to_string(ncent) :
|
||||
index_type + std::to_string(int(nb / 1000000.0 * 16384)));
|
||||
index_type + std::to_string(int(nb / 1000000.0 * nlist)));
|
||||
// std::cout<<"nlist = "<<nlist<<std::endl;
|
||||
break;
|
||||
}
|
||||
case IDMAP: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user