提交 2366204d 编写于 作者: Y yu yunfeng

add nlist and use blas conf


Former-commit-id: 4c3cf2ea9b2377eef1da8de67e35a07ae9cd6971
上级 d05ae97f
......@@ -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
\ No newline at end of file
nprobe: 10
nlist: 16381
use_blas_threshold: 10
\ No newline at end of file
......@@ -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: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册