diff --git a/cpp/CHANGELOG.md b/cpp/CHANGELOG.md index c9247d970ef73f4ac55edcab7d237c15e2b65ec0..bd55a247f2987907e36e14bf8dcee4b84a4431c5 100644 --- a/cpp/CHANGELOG.md +++ b/cpp/CHANGELOG.md @@ -83,6 +83,7 @@ Please mark all change in change log and use the ticket from JIRA. - MS-455 - Distribute tasks by minimal cost in scheduler - MS-460 - Put transport speed as weight when choosing neighbour to execute task - MS-459 - Add cache for pick function in tasktable +- MS-482 - Change search stream transport to unary in grpc ## New Feature - MS-343 - Implement ResourceMgr diff --git a/cpp/src/scheduler/SchedInst.cpp b/cpp/src/scheduler/SchedInst.cpp index 35c8eeb1de4cc77234ea597ff5350f915b33f21b..5eaaf7e953381a585d2b5c036414685f4fbbf35a 100644 --- a/cpp/src/scheduler/SchedInst.cpp +++ b/cpp/src/scheduler/SchedInst.cpp @@ -42,6 +42,22 @@ StartSchedulerService() { auto temp_memory = resconf.GetInt64Value(server::CONFIG_RESOURCE_TEMP_MEMORY); auto resource_num = resconf.GetInt64Value(server::CONFIG_RESOURCE_NUM); + auto res = ResMgrInst::GetInstance()->Add(ResourceFactory::Create(resname, + type, + device_id, + enable_loader, + enable_executor)); + + if (res.lock()->Type() == ResourceType::GPU) { + auto pinned_memory = resconf.GetInt64Value(server::CONFIG_RESOURCE_PIN_MEMORY, 300); + auto temp_memory = resconf.GetInt64Value(server::CONFIG_RESOURCE_TEMP_MEMORY, 300); + auto resource_num = resconf.GetInt64Value(server::CONFIG_RESOURCE_NUM, 2); + pinned_memory = 1024 * 1024 * pinned_memory; + temp_memory = 1024 * 1024 * temp_memory; + knowhere::FaissGpuResourceMgr::GetInstance().InitDevice(device_id, pinned_memory, temp_memory, resource_num); + } + + ResMgrInst::GetInstance()->Add(ResourceFactory::Create(resname, type, device_id, @@ -55,7 +71,6 @@ StartSchedulerService() { knowhere::FaissGpuResourceMgr::GetInstance().InitResource(); -// auto default_connection = Connection("default_connection", 500.0); auto connections = config.GetChild(server::CONFIG_RESOURCE_CONNECTIONS).GetChildren(); for (auto &conn : connections) { auto &connect_name = conn.first;