mirror of https://github.com/milvus-io/milvus.git
* delete redundant check (#860) * add changelog Co-authored-by: Jin Hai <hai.jin@zilliz.com>pull/917/head^2
parent
28da6c73d0
commit
82eb69fbed
|
@ -26,6 +26,7 @@ Please mark all change in change log and use the issue from GitHub
|
||||||
- \#791 - Remove Arrow
|
- \#791 - Remove Arrow
|
||||||
- \#834 - add cpu mode for built-in Faiss
|
- \#834 - add cpu mode for built-in Faiss
|
||||||
- \#848 - Add ready-to-use config files to the Milvus repo for enhanced user experince
|
- \#848 - Add ready-to-use config files to the Milvus repo for enhanced user experince
|
||||||
|
- \#860 - Remove redundant checks in CacheMgr's constructor
|
||||||
- \#908 - Move "primary_path" and "secondary_path" to storage config
|
- \#908 - Move "primary_path" and "secondary_path" to storage config
|
||||||
|
|
||||||
## Task
|
## Task
|
||||||
|
|
|
@ -29,28 +29,17 @@ constexpr int64_t unit = 1024 * 1024 * 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
CpuCacheMgr::CpuCacheMgr() {
|
CpuCacheMgr::CpuCacheMgr() {
|
||||||
|
// All config values have been checked in Config::ValidateConfig()
|
||||||
server::Config& config = server::Config::GetInstance();
|
server::Config& config = server::Config::GetInstance();
|
||||||
Status s;
|
|
||||||
|
|
||||||
int64_t cpu_cache_cap;
|
int64_t cpu_cache_cap;
|
||||||
s = config.GetCacheConfigCpuCacheCapacity(cpu_cache_cap);
|
config.GetCacheConfigCpuCacheCapacity(cpu_cache_cap);
|
||||||
if (!s.ok()) {
|
|
||||||
SERVER_LOG_ERROR << s.message();
|
|
||||||
}
|
|
||||||
int64_t cap = cpu_cache_cap * unit;
|
int64_t cap = cpu_cache_cap * unit;
|
||||||
cache_ = std::make_shared<Cache<DataObjPtr>>(cap, 1UL << 32);
|
cache_ = std::make_shared<Cache<DataObjPtr>>(cap, 1UL << 32);
|
||||||
|
|
||||||
float cpu_cache_threshold;
|
float cpu_cache_threshold;
|
||||||
s = config.GetCacheConfigCpuCacheThreshold(cpu_cache_threshold);
|
config.GetCacheConfigCpuCacheThreshold(cpu_cache_threshold);
|
||||||
if (!s.ok()) {
|
cache_->set_freemem_percent(cpu_cache_threshold);
|
||||||
SERVER_LOG_ERROR << s.message();
|
|
||||||
}
|
|
||||||
if (cpu_cache_threshold > 0.0 && cpu_cache_threshold <= 1.0) {
|
|
||||||
cache_->set_freemem_percent(cpu_cache_threshold);
|
|
||||||
} else {
|
|
||||||
SERVER_LOG_ERROR << "Invalid cpu_cache_threshold: " << cpu_cache_threshold << ", by default set to "
|
|
||||||
<< cache_->freemem_percent();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CpuCacheMgr*
|
CpuCacheMgr*
|
||||||
|
|
|
@ -34,28 +34,17 @@ constexpr int64_t G_BYTE = 1024 * 1024 * 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
GpuCacheMgr::GpuCacheMgr() {
|
GpuCacheMgr::GpuCacheMgr() {
|
||||||
|
// All config values have been checked in Config::ValidateConfig()
|
||||||
server::Config& config = server::Config::GetInstance();
|
server::Config& config = server::Config::GetInstance();
|
||||||
Status s;
|
|
||||||
|
|
||||||
int64_t gpu_cache_cap;
|
int64_t gpu_cache_cap;
|
||||||
s = config.GetGpuResourceConfigCacheCapacity(gpu_cache_cap);
|
config.GetGpuResourceConfigCacheCapacity(gpu_cache_cap);
|
||||||
if (!s.ok()) {
|
|
||||||
SERVER_LOG_ERROR << s.message();
|
|
||||||
}
|
|
||||||
int64_t cap = gpu_cache_cap * G_BYTE;
|
int64_t cap = gpu_cache_cap * G_BYTE;
|
||||||
cache_ = std::make_shared<Cache<DataObjPtr>>(cap, 1UL << 32);
|
cache_ = std::make_shared<Cache<DataObjPtr>>(cap, 1UL << 32);
|
||||||
|
|
||||||
float gpu_mem_threshold;
|
float gpu_mem_threshold;
|
||||||
s = config.GetGpuResourceConfigCacheThreshold(gpu_mem_threshold);
|
config.GetGpuResourceConfigCacheThreshold(gpu_mem_threshold);
|
||||||
if (!s.ok()) {
|
cache_->set_freemem_percent(gpu_mem_threshold);
|
||||||
SERVER_LOG_ERROR << s.message();
|
|
||||||
}
|
|
||||||
if (gpu_mem_threshold > 0.0 && gpu_mem_threshold <= 1.0) {
|
|
||||||
cache_->set_freemem_percent(gpu_mem_threshold);
|
|
||||||
} else {
|
|
||||||
SERVER_LOG_ERROR << "Invalid gpu_mem_threshold: " << gpu_mem_threshold << ", by default set to "
|
|
||||||
<< cache_->freemem_percent();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GpuCacheMgr*
|
GpuCacheMgr*
|
||||||
|
|
Loading…
Reference in New Issue