mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-04 09:52:30 +08:00
update debug log (#2275)
Signed-off-by: yudong.cai <yudong.cai@zilliz.com>
This commit is contained in:
parent
a37f9b0764
commit
e63904867b
@ -47,13 +47,9 @@ BuildIndexPass::Run(const TaskPtr& task) {
|
||||
LOG_SERVER_WARNING_ << "BuildIndexPass cannot get build index gpu!";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (specified_gpu_id_ >= build_gpus_.size()) {
|
||||
specified_gpu_id_ = specified_gpu_id_ % build_gpus_.size();
|
||||
}
|
||||
LOG_SERVER_DEBUG_ << "Specify gpu" << specified_gpu_id_ << " to build index!";
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource(ResourceType::GPU, build_gpus_[specified_gpu_id_]);
|
||||
specified_gpu_id_ = (specified_gpu_id_ + 1) % build_gpus_.size();
|
||||
LOG_SERVER_DEBUG_ << "Specify gpu" << build_gpus_[idx_] << " to build index!";
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource(ResourceType::GPU, build_gpus_[idx_]);
|
||||
idx_ = (idx_ + 1) % build_gpus_.size();
|
||||
}
|
||||
|
||||
auto label = std::make_shared<SpecResLabel>(std::weak_ptr<Resource>(res_ptr));
|
||||
|
||||
@ -40,7 +40,7 @@ class BuildIndexPass : public Pass, public server::GpuResourceConfigHandler {
|
||||
Run(const TaskPtr& task) override;
|
||||
|
||||
private:
|
||||
uint64_t specified_gpu_id_ = 0;
|
||||
uint64_t idx_ = 0;
|
||||
};
|
||||
|
||||
using BuildIndexPassPtr = std::shared_ptr<BuildIndexPass>;
|
||||
|
||||
@ -61,11 +61,10 @@ FaissFlatPass::Run(const TaskPtr& task) {
|
||||
"search", 0);
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else {
|
||||
auto best_device_id = count_ % search_gpus_.size();
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissFlatPass: nq > gpu_search_threshold, specify gpu %d to search!",
|
||||
"search", 0, best_device_id);
|
||||
++count_;
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource(ResourceType::GPU, search_gpus_[best_device_id]);
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissFlatPass: nq >= gpu_search_threshold, specify gpu %d to search!",
|
||||
"search", 0, search_gpus_[idx_]);
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource(ResourceType::GPU, search_gpus_[idx_]);
|
||||
idx_ = (idx_ + 1) % search_gpus_.size();
|
||||
}
|
||||
auto label = std::make_shared<SpecResLabel>(res_ptr);
|
||||
task->label() = label;
|
||||
|
||||
@ -41,7 +41,7 @@ class FaissFlatPass : public Pass, public server::GpuResourceConfigHandler {
|
||||
Run(const TaskPtr& task) override;
|
||||
|
||||
private:
|
||||
int64_t count_ = 0;
|
||||
int64_t idx_ = 0;
|
||||
};
|
||||
|
||||
using FaissFlatPassPtr = std::shared_ptr<FaissFlatPass>;
|
||||
|
||||
@ -62,11 +62,10 @@ FaissIVFFlatPass::Run(const TaskPtr& task) {
|
||||
"search", 0);
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else {
|
||||
auto best_device_id = count_ % search_gpus_.size();
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissIVFFlatPass: nq > gpu_search_threshold, specify gpu %d to search!",
|
||||
"search", 0, best_device_id);
|
||||
count_++;
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource(ResourceType::GPU, search_gpus_[best_device_id]);
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissIVFFlatPass: nq >= gpu_search_threshold, specify gpu %d to search!",
|
||||
"search", 0, search_gpus_[idx_]);
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource(ResourceType::GPU, search_gpus_[idx_]);
|
||||
idx_ = (idx_ + 1) % search_gpus_.size();
|
||||
}
|
||||
auto label = std::make_shared<SpecResLabel>(res_ptr);
|
||||
task->label() = label;
|
||||
|
||||
@ -41,7 +41,7 @@ class FaissIVFFlatPass : public Pass, public server::GpuResourceConfigHandler {
|
||||
Run(const TaskPtr& task) override;
|
||||
|
||||
private:
|
||||
int64_t count_ = 0;
|
||||
int64_t idx_ = 0;
|
||||
};
|
||||
|
||||
using FaissIVFFlatPassPtr = std::shared_ptr<FaissIVFFlatPass>;
|
||||
|
||||
@ -64,11 +64,10 @@ FaissIVFPQPass::Run(const TaskPtr& task) {
|
||||
"search", 0);
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else {
|
||||
auto best_device_id = count_ % search_gpus_.size();
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissIVFPQPass: nq > gpu_search_threshold, specify gpu %d to search!",
|
||||
"search", 0, best_device_id);
|
||||
++count_;
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource(ResourceType::GPU, search_gpus_[best_device_id]);
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissIVFPQPass: nq >= gpu_search_threshold, specify gpu %d to search!",
|
||||
"search", 0, search_gpus_[idx_]);
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource(ResourceType::GPU, search_gpus_[idx_]);
|
||||
idx_ = (idx_ + 1) % search_gpus_.size();
|
||||
}
|
||||
auto label = std::make_shared<SpecResLabel>(res_ptr);
|
||||
task->label() = label;
|
||||
|
||||
@ -41,7 +41,7 @@ class FaissIVFPQPass : public Pass, public server::GpuResourceConfigHandler {
|
||||
Run(const TaskPtr& task) override;
|
||||
|
||||
private:
|
||||
int64_t count_ = 0;
|
||||
int64_t idx_ = 0;
|
||||
};
|
||||
|
||||
using FaissIVFPQPassPtr = std::shared_ptr<FaissIVFPQPass>;
|
||||
|
||||
@ -62,11 +62,10 @@ FaissIVFSQ8HPass::Run(const TaskPtr& task) {
|
||||
"search", 0);
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else {
|
||||
auto best_device_id = count_ % search_gpus_.size();
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissIVFSQ8HPass: nq > gpu_search_threshold, specify gpu %d to search!",
|
||||
"search", 0, best_device_id);
|
||||
++count_;
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource(ResourceType::GPU, search_gpus_[best_device_id]);
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissIVFSQ8HPass: nq >= gpu_search_threshold, specify gpu %d to search!",
|
||||
"search", 0, search_gpus_[idx_]);
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource(ResourceType::GPU, search_gpus_[idx_]);
|
||||
idx_ = (idx_ + 1) % search_gpus_.size();
|
||||
}
|
||||
auto label = std::make_shared<SpecResLabel>(res_ptr);
|
||||
task->label() = label;
|
||||
|
||||
@ -41,7 +41,7 @@ class FaissIVFSQ8HPass : public Pass, public server::GpuResourceConfigHandler {
|
||||
Run(const TaskPtr& task) override;
|
||||
|
||||
private:
|
||||
int64_t count_ = 0;
|
||||
int64_t idx_ = 0;
|
||||
};
|
||||
|
||||
using FaissIVFSQ8HPassPtr = std::shared_ptr<FaissIVFSQ8HPass>;
|
||||
|
||||
@ -62,11 +62,10 @@ FaissIVFSQ8Pass::Run(const TaskPtr& task) {
|
||||
"search", 0);
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else {
|
||||
auto best_device_id = count_ % search_gpus_.size();
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissIVFSQ8Pass: nq > gpu_search_threshold, specify gpu %d to search!",
|
||||
"search", 0, best_device_id);
|
||||
count_++;
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource(ResourceType::GPU, search_gpus_[best_device_id]);
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissIVFSQ8Pass: nq >= gpu_search_threshold, specify gpu %d to search!",
|
||||
"search", 0, search_gpus_[idx_]);
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource(ResourceType::GPU, search_gpus_[idx_]);
|
||||
idx_ = (idx_ + 1) % search_gpus_.size();
|
||||
}
|
||||
auto label = std::make_shared<SpecResLabel>(res_ptr);
|
||||
task->label() = label;
|
||||
|
||||
@ -41,7 +41,7 @@ class FaissIVFSQ8Pass : public Pass, public server::GpuResourceConfigHandler {
|
||||
Run(const TaskPtr& task) override;
|
||||
|
||||
private:
|
||||
int64_t count_ = 0;
|
||||
int64_t idx_ = 0;
|
||||
};
|
||||
|
||||
using FaissIVFSQ8PassPtr = std::shared_ptr<FaissIVFSQ8Pass>;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user