Commit caacf40e authored by 余昆's avatar 余昆
Browse files

fix for config change

parents 964d1bfb fddfd1eb
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ metric_config:
    port: 8080                      # port prometheus uses to fetch metrics, must in range [1025, 65534]

cache_config:

  cpu_cache_capacity: 16            # GB, CPU memory used for cache, must be a positive integer
  cpu_cache_threshold: 0.85         # percentage of data that will be kept when cache cleanup is triggered, must be in range (0.0, 1.0]
  cache_insert_data: false          # whether to load inserted data into cache, must be a boolean
@@ -38,7 +37,7 @@ engine_config:
  gpu_search_threshold: 1000        # threshold beyond which the search computation is executed on GPUs only

resource_config:
  search_resources:                 # define the device used for search computation
  search_resources:                 # define the devices used for search computation, must be in format: cpu or gpux
    - cpu
  index_build_device:               # CPU used for building index
  index_build_resources:            # define the devices used for index building, must be in format: cpu or gpux
    - cpu
+1 −1
Original line number Diff line number Diff line
@@ -42,5 +42,5 @@ resource_config:
  search_resources:                 # define the devices used for search computation, must be in format: cpu or gpux
    - cpu
    - gpu0
  index_build_device:              # CPU / GPU used for building index, must be in format: cpu or gpux
  index_build_resources:            # define the devices used for index building, must be in format: cpu or gpux
    - gpu0
+2 −6
Original line number Diff line number Diff line
@@ -355,6 +355,7 @@ ExecutionEngineImpl::CopyToGpu(uint64_t device_id, bool hybrid) {

Status
ExecutionEngineImpl::CopyToIndexFileToGpu(uint64_t device_id) {
    gpu_num_ = device_id;
    auto to_index_data = std::make_shared<ToIndexData>(PhysicalSize());
    cache::DataObjPtr obj = std::static_pointer_cast<cache::DataObj>(to_index_data);
    milvus::cache::GpuCacheMgr::GetInstance(device_id)->InsertItem(location_, obj);
@@ -577,12 +578,7 @@ ExecutionEngineImpl::GpuCache(uint64_t gpu_id) {
// TODO(linxj): remove.
Status
ExecutionEngineImpl::Init() {
    server::Config& config = server::Config::GetInstance();
    std::vector<int64_t> gpu_ids;
    Status s = config.GetResourceConfigIndexBuildDevice(gpu_ids);
    if (!s.ok()) {
        return s;
    }
    auto gpu_ids = scheduler::get_build_resources();
    for (auto id : gpu_ids) {
        if (gpu_num_ == id) {
            return Status::OK();
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ class IVF : public VectorIndex, public FaissBaseIndex {
    void
    set_index_model(IndexModelPtr model) override;


    void
    Add(const DatasetPtr& dataset, const Config& config) override;

+1 −2
Original line number Diff line number Diff line
@@ -54,8 +54,7 @@ load_simple_config() {
    // get resources
    auto gpu_ids = get_gpu_pool();

    std::vector<int64_t> build_gpu_ids;
    config.GetResourceConfigIndexBuildDevice(build_gpu_ids);
    auto build_gpu_ids = get_build_resources();

    // create and connect
    ResMgrInst::GetInstance()->Add(ResourceFactory::Create("disk", "DISK", 0, true, false));
Loading