Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
f23e8e21
M
milvus
项目概览
milvus
/
milvus
12 个月 前同步成功
通知
261
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f23e8e21
编写于
10月 19, 2019
作者:
X
xiaojun.lin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clang-format...
Former-commit-id: 3bd5e246b34d8ca7800dbc6ce0e784dfa26ce18a
上级
6572e6bf
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
37 addition
and
38 deletion
+37
-38
core/src/db/engine/ExecutionEngineImpl.cpp
core/src/db/engine/ExecutionEngineImpl.cpp
+3
-3
core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIVF.cpp
...ndex/knowhere/knowhere/index/vector_index/IndexGPUIVF.cpp
+2
-2
core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIVFPQ.cpp
...ex/knowhere/knowhere/index/vector_index/IndexGPUIVFPQ.cpp
+1
-1
core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIVFSQ.cpp
...ex/knowhere/knowhere/index/vector_index/IndexGPUIVFSQ.cpp
+1
-1
core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.cpp
...index/knowhere/knowhere/index/vector_index/IndexIDMAP.cpp
+2
-2
core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.cpp
...c/index/knowhere/knowhere/index/vector_index/IndexIVF.cpp
+1
-1
core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQ.cpp
...index/knowhere/knowhere/index/vector_index/IndexIVFSQ.cpp
+1
-1
core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.cpp
...knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.cpp
+18
-18
core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.h
...x/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.h
+1
-1
core/src/index/unittest/test_customized_index.cpp
core/src/index/unittest/test_customized_index.cpp
+1
-2
core/src/index/unittest/test_ivf.cpp
core/src/index/unittest/test_ivf.cpp
+3
-3
core/src/scheduler/optimizer/LargeSQ8HPass.cpp
core/src/scheduler/optimizer/LargeSQ8HPass.cpp
+3
-3
未找到文件。
core/src/db/engine/ExecutionEngineImpl.cpp
浏览文件 @
f23e8e21
...
...
@@ -18,13 +18,13 @@
#include "db/engine/ExecutionEngineImpl.h"
#include "cache/CpuCacheMgr.h"
#include "cache/GpuCacheMgr.h"
#include "knowhere/common/Config.h"
#include "metrics/Metrics.h"
#include "scheduler/Utils.h"
#include "server/Config.h"
#include "utils/CommonUtil.h"
#include "utils/Exception.h"
#include "utils/Log.h"
#include "knowhere/common/Config.h"
#include "scheduler/Utils.h"
#include "server/Config.h"
#include "wrapper/ConfAdapter.h"
#include "wrapper/ConfAdapterMgr.h"
#include "wrapper/VecImpl.h"
...
...
core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIVF.cpp
浏览文件 @
f23e8e21
...
...
@@ -17,10 +17,10 @@
#include <memory>
#include <faiss/gpu/GpuCloner.h>
#include <faiss/gpu/GpuIndexIVF.h>
#include <faiss/gpu/GpuIndexIVFFlat.h>
#include <faiss/index_io.h>
#include <faiss/gpu/GpuCloner.h>
#include "knowhere/adapter/VectorAdapter.h"
#include "knowhere/common/Exception.h"
...
...
@@ -133,7 +133,7 @@ GPUIVF::search_impl(int64_t n, const float* data, int64_t k, float* distances, i
if
(
auto
device_index
=
std
::
dynamic_pointer_cast
<
faiss
::
gpu
::
GpuIndexIVF
>
(
index_
))
{
auto
search_cfg
=
std
::
dynamic_pointer_cast
<
IVFCfg
>
(
cfg
);
device_index
->
nprobe
=
search_cfg
->
nprobe
;
// assert(device_index->getNumProbes() == search_cfg->nprobe);
// assert(device_index->getNumProbes() == search_cfg->nprobe);
{
ResScope
rs
(
res_
,
gpu_id_
);
...
...
core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIVFPQ.cpp
浏览文件 @
f23e8e21
...
...
@@ -16,9 +16,9 @@
// under the License.
#include <faiss/IndexIVFPQ.h>
#include <faiss/gpu/GpuCloner.h>
#include <faiss/gpu/GpuIndexIVFPQ.h>
#include <faiss/index_factory.h>
#include <faiss/gpu/GpuCloner.h>
#include <memory>
...
...
core/src/index/knowhere/knowhere/index/vector_index/IndexGPUIVFSQ.cpp
浏览文件 @
f23e8e21
...
...
@@ -15,8 +15,8 @@
// specific language governing permissions and limitations
// under the License.
#include <faiss/index_factory.h>
#include <faiss/gpu/GpuCloner.h>
#include <faiss/index_factory.h>
#include <memory>
...
...
core/src/index/knowhere/knowhere/index/vector_index/IndexIDMAP.cpp
浏览文件 @
f23e8e21
...
...
@@ -17,9 +17,9 @@
#include <faiss/IndexFlat.h>
#include <faiss/MetaIndexes.h>
#include <faiss/index_io.h>
#include <faiss/index_factory.h>
#include <faiss/gpu/GpuCloner.h>
#include <faiss/index_factory.h>
#include <faiss/index_io.h>
#include <vector>
...
...
core/src/index/knowhere/knowhere/index/vector_index/IndexIVF.cpp
浏览文件 @
f23e8e21
...
...
@@ -15,11 +15,11 @@
// specific language governing permissions and limitations
// under the License.
#include <faiss/gpu/GpuCloner.h>
#include <faiss/IVFlib.h>
#include <faiss/IndexFlat.h>
#include <faiss/IndexIVF.h>
#include <faiss/IndexIVFFlat.h>
#include <faiss/gpu/GpuCloner.h>
#include <memory>
#include <utility>
#include <vector>
...
...
core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQ.cpp
浏览文件 @
f23e8e21
...
...
@@ -15,8 +15,8 @@
// specific language governing permissions and limitations
// under the License.
#include <faiss/index_factory.h>
#include <faiss/gpu/GpuCloner.h>
#include <faiss/index_factory.h>
#include <memory>
#include "knowhere/adapter/VectorAdapter.h"
...
...
core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.cpp
浏览文件 @
f23e8e21
...
...
@@ -22,19 +22,19 @@
#include <utility>
#include <faiss/gpu/GpuCloner.h>
#include <faiss/gpu/GpuIndexIVF.h>
#include <faiss/index_factory.h>
#include <faiss/gpu/GpuCloner.h>
namespace
knowhere
{
#ifdef CUSTOMIZATION
//std::mutex g_mutex;
//
std::mutex g_mutex;
IndexModelPtr
IVFSQHybrid
::
Train
(
const
DatasetPtr
&
dataset
,
const
Config
&
config
)
{
// std::lock_guard<std::mutex> lk(g_mutex);
// std::lock_guard<std::mutex> lk(g_mutex);
auto
build_cfg
=
std
::
dynamic_pointer_cast
<
IVFSQCfg
>
(
config
);
if
(
build_cfg
!=
nullptr
)
{
...
...
@@ -74,12 +74,12 @@ IVFSQHybrid::CopyGpuToCpu(const Config& config) {
}
std
::
lock_guard
<
std
::
mutex
>
lk
(
mutex_
);
faiss
::
Index
*
device_index
=
index_
.
get
();
faiss
::
Index
*
host_index
=
faiss
::
gpu
::
index_gpu_to_cpu
(
device_index
);
faiss
::
Index
*
device_index
=
index_
.
get
();
faiss
::
Index
*
host_index
=
faiss
::
gpu
::
index_gpu_to_cpu
(
device_index
);
std
::
shared_ptr
<
faiss
::
Index
>
new_index
;
new_index
.
reset
(
host_index
);
return
std
::
make_shared
<
IVFSQHybrid
>
(
new_index
);
std
::
shared_ptr
<
faiss
::
Index
>
new_index
;
new_index
.
reset
(
host_index
);
return
std
::
make_shared
<
IVFSQHybrid
>
(
new_index
);
}
VectorIndexPtr
...
...
@@ -119,14 +119,14 @@ IVFSQHybrid::LoadImpl(const BinarySet& index_binary) {
void
IVFSQHybrid
::
search_impl
(
int64_t
n
,
const
float
*
data
,
int64_t
k
,
float
*
distances
,
int64_t
*
labels
,
const
Config
&
cfg
)
{
// std::lock_guard<std::mutex> lk(g_mutex);
// static int64_t search_count;
// ++search_count;
// std::lock_guard<std::mutex> lk(g_mutex);
// static int64_t search_count;
// ++search_count;
if
(
gpu_mode
==
2
)
{
GPUIVF
::
search_impl
(
n
,
data
,
k
,
distances
,
labels
,
cfg
);
// index_->search(n, (float*)data, k, distances, labels);
}
else
if
(
gpu_mode
==
1
)
{
// hybrid
// index_->search(n, (float*)data, k, distances, labels);
}
else
if
(
gpu_mode
==
1
)
{
// hybrid
if
(
auto
res
=
FaissGpuResourceMgr
::
GetInstance
().
GetRes
(
quantizer_gpu_id_
))
{
ResScope
rs
(
res
,
quantizer_gpu_id_
,
true
);
IVF
::
search_impl
(
n
,
data
,
k
,
distances
,
labels
,
cfg
);
...
...
@@ -140,7 +140,7 @@ IVFSQHybrid::search_impl(int64_t n, const float* data, int64_t k, float* distanc
QuantizerPtr
IVFSQHybrid
::
LoadQuantizer
(
const
Config
&
conf
)
{
// std::lock_guard<std::mutex> lk(g_mutex);
// std::lock_guard<std::mutex> lk(g_mutex);
auto
quantizer_conf
=
std
::
dynamic_pointer_cast
<
QuantizerCfg
>
(
conf
);
if
(
quantizer_conf
!=
nullptr
)
{
...
...
@@ -179,7 +179,7 @@ IVFSQHybrid::LoadQuantizer(const Config& conf) {
void
IVFSQHybrid
::
SetQuantizer
(
const
QuantizerPtr
&
q
)
{
// std::lock_guard<std::mutex> lk(g_mutex);
// std::lock_guard<std::mutex> lk(g_mutex);
auto
ivf_quantizer
=
std
::
dynamic_pointer_cast
<
FaissIVFQuantizer
>
(
q
);
if
(
ivf_quantizer
==
nullptr
)
{
...
...
@@ -199,7 +199,7 @@ IVFSQHybrid::SetQuantizer(const QuantizerPtr& q) {
void
IVFSQHybrid
::
UnsetQuantizer
()
{
// std::lock_guard<std::mutex> lk(g_mutex);
// std::lock_guard<std::mutex> lk(g_mutex);
auto
*
ivf_index
=
dynamic_cast
<
faiss
::
IndexIVF
*>
(
index_
.
get
());
if
(
ivf_index
==
nullptr
)
{
...
...
@@ -212,7 +212,7 @@ IVFSQHybrid::UnsetQuantizer() {
VectorIndexPtr
IVFSQHybrid
::
LoadData
(
const
knowhere
::
QuantizerPtr
&
q
,
const
Config
&
conf
)
{
// std::lock_guard<std::mutex> lk(g_mutex);
// std::lock_guard<std::mutex> lk(g_mutex);
auto
quantizer_conf
=
std
::
dynamic_pointer_cast
<
QuantizerCfg
>
(
conf
);
if
(
quantizer_conf
!=
nullptr
)
{
...
...
@@ -251,7 +251,7 @@ IVFSQHybrid::LoadData(const knowhere::QuantizerPtr& q, const Config& conf) {
std
::
pair
<
VectorIndexPtr
,
QuantizerPtr
>
IVFSQHybrid
::
CopyCpuToGpuWithQuantizer
(
const
int64_t
&
device_id
,
const
Config
&
config
)
{
// std::lock_guard<std::mutex> lk(g_mutex);
// std::lock_guard<std::mutex> lk(g_mutex);
if
(
auto
res
=
FaissGpuResourceMgr
::
GetInstance
().
GetRes
(
device_id
))
{
ResScope
rs
(
res
,
device_id
,
false
);
...
...
core/src/index/knowhere/knowhere/index/vector_index/IndexIVFSQHybrid.h
浏览文件 @
f23e8e21
...
...
@@ -17,8 +17,8 @@
#pragma once
#include <faiss/index_io.h>
#include <faiss/gpu/GpuIndexFlat.h>
#include <faiss/index_io.h>
#include <memory>
#include <utility>
...
...
core/src/index/unittest/test_customized_index.cpp
浏览文件 @
f23e8e21
...
...
@@ -125,7 +125,7 @@ TEST_F(SingleIndexTest, IVFSQHybrid) {
}
}
//TEST_F(SingleIndexTest, thread_safe) {
//
TEST_F(SingleIndexTest, thread_safe) {
// assert(!xb.empty());
//
// index_type = "IVFSQHybrid";
...
...
@@ -234,5 +234,4 @@ TEST_F(SingleIndexTest, IVFSQHybrid) {
//
//}
#endif
core/src/index/unittest/test_ivf.cpp
浏览文件 @
f23e8e21
...
...
@@ -44,9 +44,9 @@ class IVFTest : public DataGen, public TestWithParam<::std::tuple<std::string, P
ParameterType
parameter_type
;
std
::
tie
(
index_type
,
parameter_type
)
=
GetParam
();
// Init_with_default();
// nb = 1000000;
// nq = 1000;
// k = 1000;
// nb = 1000000;
// nq = 1000;
// k = 1000;
Generate
(
DIM
,
NB
,
NQ
);
index_
=
IndexFactory
(
index_type
);
conf
=
ParamGenerator
::
GetInstance
().
Gen
(
parameter_type
);
...
...
core/src/scheduler/optimizer/LargeSQ8HPass.cpp
浏览文件 @
f23e8e21
...
...
@@ -26,8 +26,8 @@
namespace
milvus
{
namespace
scheduler
{
bool
LargeSQ8HPass
::
Run
(
const
TaskPtr
&
task
)
{
bool
LargeSQ8HPass
::
Run
(
const
TaskPtr
&
task
)
{
if
(
task
->
Type
()
!=
TaskType
::
SearchTask
)
{
return
false
;
}
...
...
@@ -67,7 +67,7 @@ namespace scheduler {
task
->
label
()
=
label
;
return
true
;
}
}
}
// namespace scheduler
}
// namespace milvus
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录