gpu no usage during index building

This commit is contained in:
fishpenguin 2019-11-23 11:07:42 +08:00
parent b68f4f43c1
commit 288490f980
3 changed files with 4 additions and 3 deletions

View File

@ -20,6 +20,7 @@ Please mark all change in change log and use the ticket from JIRA.
- \#440 - Query API in customization still uses old version
- \#440 - Server cannot startup with gpu_resource_config.enable=false in GPU version
- \#458 - Index data is not compatible between 0.5 and 0.6
- \#486 - gpu no usage during index building
## Feature
- \#12 - Pure CPU version for Milvus

View File

@ -26,8 +26,7 @@ namespace scheduler {
void
BuildIndexPass::Init() {
server::Config& config = server::Config::GetInstance();
std::vector<int64_t> build_resources;
Status s = config.GetGpuResourceConfigBuildIndexResources(build_resources);
Status s = config.GetGpuResourceConfigBuildIndexResources(build_gpu_ids_);
if (!s.ok()) {
throw;
}
@ -47,6 +46,7 @@ BuildIndexPass::Run(const TaskPtr& task) {
res_ptr = ResMgrInst::GetInstance()->GetResource(ResourceType::GPU, build_gpu_ids_[specified_gpu_id_]);
auto label = std::make_shared<SpecResLabel>(std::weak_ptr<Resource>(res_ptr));
task->label() = label;
SERVER_LOG_DEBUG << "Specify gpu" << specified_gpu_id_ << " to build index!";
specified_gpu_id_ = (specified_gpu_id_ + 1) % build_gpu_ids_.size();
return true;

View File

@ -45,7 +45,7 @@ class BuildIndexPass : public Pass {
private:
uint64_t specified_gpu_id_ = 0;
std::vector<int32_t> build_gpu_ids_;
std::vector<int64_t> build_gpu_ids_;
};
using BuildIndexPassPtr = std::shared_ptr<BuildIndexPass>;