mirror of https://github.com/milvus-io/milvus.git
Add virtual method Init() in Pass abstract class close #404
parent
00a21da414
commit
7ad5c51497
|
@ -29,6 +29,7 @@ Please mark all change in change log and use the ticket from JIRA.
|
|||
- \#322 - Add option to enable / disable prometheus
|
||||
- \#358 - Add more information in build.sh and install.md
|
||||
- \#255 - Add ivfsq8 test report detailed version
|
||||
- \#404 - Add virtual method Init() in Pass abstract class
|
||||
|
||||
## Task
|
||||
|
||||
|
|
|
@ -84,6 +84,7 @@ load_simple_config() {
|
|||
void
|
||||
StartSchedulerService() {
|
||||
load_simple_config();
|
||||
OptimizerInst::GetInstance()->Init();
|
||||
ResMgrInst::GetInstance()->Start();
|
||||
SchedInst::GetInstance()->Start();
|
||||
JobMgrInst::GetInstance()->Start();
|
||||
|
|
|
@ -23,6 +23,10 @@
|
|||
namespace milvus {
|
||||
namespace scheduler {
|
||||
|
||||
void
|
||||
HybridPass::Init() {
|
||||
}
|
||||
|
||||
bool
|
||||
HybridPass::Run(const TaskPtr& task) {
|
||||
// TODO: future, Index::IVFSQ8H, if nq < threshold set cpu, else set gpu
|
||||
|
|
|
@ -37,6 +37,9 @@ class HybridPass : public Pass {
|
|||
HybridPass() = default;
|
||||
|
||||
public:
|
||||
void
|
||||
Init() override;
|
||||
|
||||
bool
|
||||
Run(const TaskPtr& task) override;
|
||||
};
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
namespace milvus {
|
||||
namespace scheduler {
|
||||
|
||||
LargeSQ8HPass::LargeSQ8HPass() {
|
||||
void
|
||||
LargeSQ8HPass::Init() {
|
||||
server::Config& config = server::Config::GetInstance();
|
||||
Status s = config.GetEngineConfigGpuSearchThreshold(threshold_);
|
||||
if (!s.ok()) {
|
||||
|
|
|
@ -35,9 +35,12 @@ namespace scheduler {
|
|||
|
||||
class LargeSQ8HPass : public Pass {
|
||||
public:
|
||||
LargeSQ8HPass();
|
||||
LargeSQ8HPass() = default;
|
||||
|
||||
public:
|
||||
void
|
||||
Init() override;
|
||||
|
||||
bool
|
||||
Run(const TaskPtr& task) override;
|
||||
|
||||
|
|
|
@ -24,6 +24,10 @@
|
|||
namespace milvus {
|
||||
namespace scheduler {
|
||||
|
||||
void
|
||||
OnlyCPUPass::Init() {
|
||||
}
|
||||
|
||||
bool
|
||||
OnlyCPUPass::Run(const TaskPtr& task) {
|
||||
if (task->Type() != TaskType::SearchTask)
|
||||
|
|
|
@ -37,6 +37,9 @@ class OnlyCPUPass : public Pass {
|
|||
OnlyCPUPass() = default;
|
||||
|
||||
public:
|
||||
void
|
||||
Init() override;
|
||||
|
||||
bool
|
||||
Run(const TaskPtr& task) override;
|
||||
};
|
||||
|
|
|
@ -27,6 +27,10 @@ namespace scheduler {
|
|||
OnlyGPUPass::OnlyGPUPass(bool has_cpu) : has_cpu_(has_cpu) {
|
||||
}
|
||||
|
||||
void
|
||||
OnlyGPUPass::Init() {
|
||||
}
|
||||
|
||||
bool
|
||||
OnlyGPUPass::Run(const TaskPtr& task) {
|
||||
if (task->Type() != TaskType::SearchTask || has_cpu_)
|
||||
|
|
|
@ -37,6 +37,9 @@ class OnlyGPUPass : public Pass {
|
|||
explicit OnlyGPUPass(bool has_cpu);
|
||||
|
||||
public:
|
||||
void
|
||||
Init() override;
|
||||
|
||||
bool
|
||||
Run(const TaskPtr& task) override;
|
||||
|
||||
|
|
|
@ -20,12 +20,12 @@
|
|||
namespace milvus {
|
||||
namespace scheduler {
|
||||
|
||||
// void
|
||||
// Optimizer::Init() {
|
||||
// for (auto& pass : pass_list_) {
|
||||
// pass->Init();
|
||||
// }
|
||||
// }
|
||||
void
|
||||
Optimizer::Init() {
|
||||
for (auto& pass : pass_list_) {
|
||||
pass->Init();
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
Optimizer::Run(const TaskPtr& task) {
|
||||
|
|
|
@ -38,8 +38,8 @@ class Optimizer {
|
|||
explicit Optimizer(std::vector<PassPtr> pass_list) : pass_list_(std::move(pass_list)) {
|
||||
}
|
||||
|
||||
// void
|
||||
// Init();
|
||||
void
|
||||
Init();
|
||||
|
||||
bool
|
||||
Run(const TaskPtr& task);
|
||||
|
|
|
@ -34,9 +34,8 @@ namespace scheduler {
|
|||
|
||||
class Pass {
|
||||
public:
|
||||
// virtual void
|
||||
// Init() {
|
||||
// }
|
||||
virtual void
|
||||
Init() = 0;
|
||||
|
||||
virtual bool
|
||||
Run(const TaskPtr& task) = 0;
|
||||
|
|
Loading…
Reference in New Issue