Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
e450df84
milvus
项目概览
BaiXuePrincess
/
milvus
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e450df84
编写于
10月 08, 2019
作者:
Y
Yu Kun
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'upstream/branch-0.5.0' into branch-0.5.0-yk
Former-commit-id: a9efa9a72da2b4c178842ab06a610cf324855dae
上级
f048ecf0
50496541
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
226 addition
and
1 deletion
+226
-1
cpp/CHANGELOG.md
cpp/CHANGELOG.md
+1
-0
cpp/src/CMakeLists.txt
cpp/src/CMakeLists.txt
+2
-0
cpp/src/scheduler/optimizer/HybridPass.cpp
cpp/src/scheduler/optimizer/HybridPass.cpp
+35
-0
cpp/src/scheduler/optimizer/HybridPass.h
cpp/src/scheduler/optimizer/HybridPass.h
+48
-0
cpp/src/scheduler/optimizer/Optimizer.cpp
cpp/src/scheduler/optimizer/Optimizer.cpp
+43
-0
cpp/src/scheduler/optimizer/Optimizer.h
cpp/src/scheduler/optimizer/Optimizer.h
+51
-0
cpp/src/scheduler/optimizer/Pass.h
cpp/src/scheduler/optimizer/Pass.h
+46
-0
cpp/src/scheduler/task/Task.h
cpp/src/scheduler/task/Task.h
+0
-1
未找到文件。
cpp/CHANGELOG.md
浏览文件 @
e450df84
...
@@ -27,6 +27,7 @@ Please mark all change in change log and use the ticket from JIRA.
...
@@ -27,6 +27,7 @@ Please mark all change in change log and use the ticket from JIRA.
-
MS-608 - Update TODO names
-
MS-608 - Update TODO names
-
MS-609 - Update task construct function
-
MS-609 - Update task construct function
-
MS-611 - Add resources validity check in ResourceMgr
-
MS-611 - Add resources validity check in ResourceMgr
-
MS-619 - Add optimizer class in scheduler
## New Feature
## New Feature
...
...
cpp/src/CMakeLists.txt
浏览文件 @
e450df84
...
@@ -50,6 +50,7 @@ aux_source_directory(${MILVUS_ENGINE_SRC}/scheduler scheduler_main_files)
...
@@ -50,6 +50,7 @@ aux_source_directory(${MILVUS_ENGINE_SRC}/scheduler scheduler_main_files)
aux_source_directory
(
${
MILVUS_ENGINE_SRC
}
/scheduler/action scheduler_action_files
)
aux_source_directory
(
${
MILVUS_ENGINE_SRC
}
/scheduler/action scheduler_action_files
)
aux_source_directory
(
${
MILVUS_ENGINE_SRC
}
/scheduler/event scheduler_event_files
)
aux_source_directory
(
${
MILVUS_ENGINE_SRC
}
/scheduler/event scheduler_event_files
)
aux_source_directory
(
${
MILVUS_ENGINE_SRC
}
/scheduler/job scheduler_job_files
)
aux_source_directory
(
${
MILVUS_ENGINE_SRC
}
/scheduler/job scheduler_job_files
)
aux_source_directory
(
${
MILVUS_ENGINE_SRC
}
/scheduler/optimizer scheduler_optimizer_files
)
aux_source_directory
(
${
MILVUS_ENGINE_SRC
}
/scheduler/resource scheduler_resource_files
)
aux_source_directory
(
${
MILVUS_ENGINE_SRC
}
/scheduler/resource scheduler_resource_files
)
aux_source_directory
(
${
MILVUS_ENGINE_SRC
}
/scheduler/task scheduler_task_files
)
aux_source_directory
(
${
MILVUS_ENGINE_SRC
}
/scheduler/task scheduler_task_files
)
set
(
scheduler_files
set
(
scheduler_files
...
@@ -57,6 +58,7 @@ set(scheduler_files
...
@@ -57,6 +58,7 @@ set(scheduler_files
${
scheduler_action_files
}
${
scheduler_action_files
}
${
scheduler_event_files
}
${
scheduler_event_files
}
${
scheduler_job_files
}
${
scheduler_job_files
}
${
scheduler_optimizer_files
}
${
scheduler_resource_files
}
${
scheduler_resource_files
}
${
scheduler_task_files
}
${
scheduler_task_files
}
)
)
...
...
cpp/src/scheduler/optimizer/HybridPass.cpp
0 → 100644
浏览文件 @
e450df84
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
#include "HybridPass.h"
#include "scheduler/task/SearchTask.h"
namespace
milvus
{
namespace
scheduler
{
bool
HybridPass
::
Run
(
const
TaskPtr
&
task
)
{
// TODO: Index::IVFSQ8Hybrid, if nq < threshold set cpu, else set gpu
if
(
task
->
Type
()
!=
TaskType
::
SearchTask
)
return
false
;
auto
search_task
=
std
::
static_pointer_cast
<
XSearchTask
>
(
task
);
// if (search_task->file_->engine_type_ == engine::EngineType::FAISS_IVFSQ8Hybrid)
return
false
;
}
}
}
cpp/src/scheduler/optimizer/HybridPass.h
0 → 100644
浏览文件 @
e450df84
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
#pragma once
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <unordered_map>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <memory>
#include "Pass.h"
namespace
milvus
{
namespace
scheduler
{
class
HybridPass
:
public
Pass
{
public:
HybridPass
()
=
default
;
public:
bool
Run
(
const
TaskPtr
&
task
)
override
;
};
using
HybridPassPtr
=
std
::
shared_ptr
<
HybridPass
>
;
}
}
cpp/src/scheduler/optimizer/Optimizer.cpp
0 → 100644
浏览文件 @
e450df84
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
#include "Optimizer.h"
namespace
milvus
{
namespace
scheduler
{
void
Optimizer
::
Init
()
{
for
(
auto
&
pass
:
pass_list_
)
{
pass
->
Init
();
}
}
bool
Optimizer
::
Run
(
const
TaskPtr
&
task
)
{
for
(
auto
&
pass
:
pass_list_
)
{
if
(
pass
->
Run
(
task
))
{
return
true
;
}
}
return
false
;
}
}
}
cpp/src/scheduler/optimizer/Optimizer.h
0 → 100644
浏览文件 @
e450df84
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
#pragma once
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <unordered_map>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <memory>
#include "Pass.h"
namespace
milvus
{
namespace
scheduler
{
class
Optimizer
{
public:
Optimizer
()
=
default
;
void
Init
();
bool
Run
(
const
TaskPtr
&
task
);
private:
std
::
vector
<
PassPtr
>
pass_list_
;
};
}
}
cpp/src/scheduler/optimizer/Pass.h
0 → 100644
浏览文件 @
e450df84
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
#pragma once
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <unordered_map>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <memory>
#include "scheduler/task/Task.h"
namespace
milvus
{
namespace
scheduler
{
class
Pass
{
public:
virtual
void
Init
()
{}
virtual
bool
Run
(
const
TaskPtr
&
task
)
=
0
;
};
using
PassPtr
=
std
::
shared_ptr
<
Pass
>
;
}
}
cpp/src/scheduler/task/Task.h
浏览文件 @
e450df84
...
@@ -86,7 +86,6 @@ class Task {
...
@@ -86,7 +86,6 @@ class Task {
public:
public:
Path
task_path_
;
Path
task_path_
;
// std::vector<SearchContextPtr> search_contexts_;
scheduler
::
JobWPtr
job_
;
scheduler
::
JobWPtr
job_
;
TaskType
type_
;
TaskType
type_
;
TaskLabelPtr
label_
=
nullptr
;
TaskLabelPtr
label_
=
nullptr
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录