mirror of https://github.com/milvus-io/milvus.git
fix 1507 (#1509)
* fix Signed-off-by: Nicky <nicky.xj.lin@gmail.com> * update.. Signed-off-by: Nicky <nicky.xj.lin@gmail.com> * update... Signed-off-by: Nicky <nicky.xj.lin@gmail.com> * update... Signed-off-by: Nicky <nicky.xj.lin@gmail.com> * update... Signed-off-by: Nicky <nicky.xj.lin@gmail.com> * comment ut Signed-off-by: xiaojun.lin <xiaojun.lin@zilliz.com> * Fix lint error Signed-off-by: JinHai-CN <hai.jin@zilliz.com> * update.... Signed-off-by: xiaojun.lin <xiaojun.lin@zilliz.com> * update.... Signed-off-by: xiaojun.lin <xiaojun.lin@zilliz.com> * Fix typo Signed-off-by: JinHai-CN <hai.jin@zilliz.com> * Fix typo Signed-off-by: JinHai-CN <hai.jin@zilliz.com> Co-authored-by: Jin Hai <hai.jin@zilliz.com>pull/1540/head^2
parent
626c9bc593
commit
8cd1ec9819
|
@ -27,12 +27,13 @@ Please mark all change in change log and use the issue from GitHub
|
|||
- \#1240 Update license declaration
|
||||
- \#1298 Unit test failed when on CPU2GPU case
|
||||
- \#1359 Negative distance value returned when searching with HNSW index type
|
||||
- \#1429 Server crashed when searching vectors using GPU
|
||||
- \#1429 Server crashed when searching vectors with GPU
|
||||
- \#1476 Fix vectors results bug when getting vectors from segments
|
||||
- \#1484 Index type changed to IDMAP after compacted
|
||||
- \#1499 Fix duplicated ID number issue
|
||||
- \#1491 Server crashed during adding vectors
|
||||
- \#1504 Avoid possible race condition between delete and search
|
||||
- \#1507 set_config for insert_buffer_size is wrong
|
||||
- \#1510 Add set interfaces for WAL configurations
|
||||
- \#1511 Fix big integer cannot pass to server correctly
|
||||
- \#1518 Table count did not match after deleting vectors and compact
|
||||
|
|
|
@ -73,9 +73,6 @@ NSG::Load(const BinarySet& index_binary) {
|
|||
DatasetPtr
|
||||
NSG::Search(const DatasetPtr& dataset, const Config& config) {
|
||||
auto build_cfg = std::dynamic_pointer_cast<NSGCfg>(config);
|
||||
// if (build_cfg != nullptr) {
|
||||
// build_cfg->CheckValid(); // throw exception
|
||||
// }
|
||||
|
||||
if (!index_ || !index_->is_trained) {
|
||||
KNOWHERE_THROW_MSG("index not initialize or trained");
|
||||
|
@ -120,7 +117,6 @@ NSG::Train(const DatasetPtr& dataset, const Config& config) {
|
|||
preprocess_index->Add(dataset, config);
|
||||
preprocess_index->GenGraph(raw_data, build_cfg->knng, knng, config);
|
||||
} else {
|
||||
// TODO(linxj): use ivf instead?
|
||||
auto gpu_idx = cloner::CopyCpuToGpu(idmap, build_cfg->gpu_id, config);
|
||||
auto gpu_idmap = std::dynamic_pointer_cast<GPUIDMAP>(gpu_idx);
|
||||
gpu_idmap->GenGraph(raw_data, build_cfg->knng, knng, config);
|
||||
|
|
|
@ -9,8 +9,12 @@
|
|||
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||
// or implied. See the License for the specific language governing permissions and limitations under the License.
|
||||
|
||||
#include <cache/CpuCacheMgr.h>
|
||||
#include <cache/GpuCacheMgr.h>
|
||||
#include <fiu-local.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
#include <iostream>
|
||||
|
@ -29,10 +33,6 @@
|
|||
#include "utils/StringHelpFunctions.h"
|
||||
#include "utils/ValidationUtil.h"
|
||||
|
||||
#include <cache/CpuCacheMgr.h>
|
||||
#include <cache/GpuCacheMgr.h>
|
||||
#include <fiu-local.h>
|
||||
|
||||
namespace milvus {
|
||||
namespace server {
|
||||
|
||||
|
@ -986,8 +986,9 @@ Config::CheckCacheConfigCpuCacheCapacity(const std::string& value) {
|
|||
std::cerr << "WARNING: cpu cache capacity value is too big" << std::endl;
|
||||
}
|
||||
|
||||
int64_t buffer_value;
|
||||
CONFIG_CHECK(GetCacheConfigInsertBufferSize(buffer_value));
|
||||
std::string str =
|
||||
GetConfigStr(CONFIG_CACHE, CONFIG_CACHE_INSERT_BUFFER_SIZE, CONFIG_CACHE_INSERT_BUFFER_SIZE_DEFAULT);
|
||||
int64_t buffer_value = std::stoll(str);
|
||||
|
||||
int64_t insert_buffer_size = buffer_value * GB;
|
||||
fiu_do_on("Config.CheckCacheConfigCpuCacheCapacity.large_insert_buffer", insert_buffer_size = total_mem + 1);
|
||||
|
@ -1035,9 +1036,13 @@ Config::CheckCacheConfigInsertBufferSize(const std::string& value) {
|
|||
return Status(SERVER_INVALID_ARGUMENT, msg);
|
||||
}
|
||||
|
||||
std::string str =
|
||||
GetConfigStr(CONFIG_CACHE, CONFIG_CACHE_CPU_CACHE_CAPACITY, CONFIG_CACHE_CPU_CACHE_CAPACITY_DEFAULT);
|
||||
int64_t cache_size = std::stoll(str);
|
||||
|
||||
uint64_t total_mem = 0, free_mem = 0;
|
||||
CommonUtil::GetSystemMemInfo(total_mem, free_mem);
|
||||
if (buffer_size >= total_mem) {
|
||||
if (buffer_size + cache_size >= total_mem) {
|
||||
std::string msg = "Invalid insert buffer size: " + value +
|
||||
". Possible reason: cache_config.insert_buffer_size exceeds system memory.";
|
||||
return Status(SERVER_INVALID_ARGUMENT, msg);
|
||||
|
|
|
@ -851,10 +851,10 @@ TEST_F(ConfigTest, SERVER_CONFIG_VALID_FAIL_TEST) {
|
|||
ASSERT_FALSE(s.ok());
|
||||
fiu_disable("ValidationUtil.GetGpuMemory.return_error");
|
||||
|
||||
fiu_enable("check_config_insert_buffer_size_fail", 1, NULL, 0);
|
||||
s = config.GetCacheConfigCpuCacheCapacity(value);
|
||||
ASSERT_FALSE(s.ok());
|
||||
fiu_disable("check_config_insert_buffer_size_fail");
|
||||
// fiu_enable("check_config_insert_buffer_size_fail", 1, NULL, 0);
|
||||
// s = config.GetCacheConfigCpuCacheCapacity(value);
|
||||
// ASSERT_FALSE(s.ok());
|
||||
// fiu_disable("check_config_insert_buffer_size_fail");
|
||||
|
||||
fiu_enable("Config.CheckCacheConfigCpuCacheCapacity.large_insert_buffer", 1, NULL, 0);
|
||||
s = config.GetCacheConfigCpuCacheCapacity(value);
|
||||
|
|
Loading…
Reference in New Issue