Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
96c68edc
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,发现更多精彩内容 >>
提交
96c68edc
编写于
5月 28, 2020
作者:
S
shengjun.li
提交者:
JinHai-CN
6月 11, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix search by GPU (#2453)
Signed-off-by:
N
shengjun.li
<
shengjun.li@zilliz.com
>
上级
87d22da1
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
11 addition
and
31 deletion
+11
-31
CHANGELOG.md
CHANGELOG.md
+1
-0
core/src/index/thirdparty/faiss/gpu/impl/IVFUtilsSelect1.cu
core/src/index/thirdparty/faiss/gpu/impl/IVFUtilsSelect1.cu
+2
-5
core/src/index/thirdparty/faiss/gpu/impl/L2Select.cu
core/src/index/thirdparty/faiss/gpu/impl/L2Select.cu
+3
-6
core/src/index/thirdparty/faiss/gpu/utils/BlockSelectKernel.cuh
...rc/index/thirdparty/faiss/gpu/utils/BlockSelectKernel.cuh
+5
-11
core/src/scheduler/task/SearchTask.cpp
core/src/scheduler/task/SearchTask.cpp
+0
-9
未找到文件。
CHANGELOG.md
浏览文件 @
96c68edc
...
...
@@ -34,6 +34,7 @@ Please mark all change in change log and use the issue from GitHub
-
\#
2395 Fix large nq cudaMalloc error
-
\#
2399 The nlist set by the user may not take effect
-
\#
2403 MySQL max_idle_time is 10 by default
-
\#
2450 The deleted vectors may be found on GPU
## Feature
...
...
core/src/index/thirdparty/faiss/gpu/impl/IVFUtilsSelect1.cu
浏览文件 @
96c68edc
...
...
@@ -75,10 +75,9 @@ pass1SelectLists(void** listIndices,
topQueryToCentroid
,
opt
);
if
(
bitsetEmpty
||
(
!
(
bitset
[
index
>>
3
]
&
(
0x1
<<
(
index
&
0x7
)))))
{
heap
.
add
(
distanceStart
[
i
],
start
+
i
);
}
else
{
heap
.
add
((
1.0
/
0.0
),
start
+
i
);
heap
.
addThreadQ
(
distanceStart
[
i
],
start
+
i
);
}
heap
.
checkThreadQ
();
}
// Handle warp divergence separately
...
...
@@ -91,8 +90,6 @@ pass1SelectLists(void** listIndices,
opt
);
if
(
bitsetEmpty
||
(
!
(
bitset
[
index
>>
3
]
&
(
0x1
<<
(
index
&
0x7
)))))
{
heap
.
addThreadQ
(
distanceStart
[
i
],
start
+
i
);
}
else
{
heap
.
addThreadQ
((
1.0
/
0.0
),
start
+
i
);
}
}
...
...
core/src/index/thirdparty/faiss/gpu/impl/L2Select.cu
浏览文件 @
96c68edc
...
...
@@ -161,20 +161,17 @@ __global__ void l2SelectMinK(Tensor<T, 2, true> productDistances,
if
(
bitsetEmpty
||
(
!
(
bitset
[
i
>>
3
]
&
(
0x1
<<
(
i
&
0x7
)))))
{
v
=
Math
<
T
>::
add
(
centroidDistances
[
i
],
productDistances
[
row
][
i
]);
}
else
{
v
=
(
T
)(
1.0
/
0.0
);
heap
.
addThreadQ
(
v
,
i
);
}
heap
.
add
(
v
,
i
);
heap
.
checkThreadQ
(
);
}
if
(
i
<
productDistances
.
getSize
(
1
))
{
if
(
bitsetEmpty
||
(
!
(
bitset
[
i
>>
3
]
&
(
0x1
<<
(
i
&
0x7
)))))
{
v
=
Math
<
T
>::
add
(
centroidDistances
[
i
],
productDistances
[
row
][
i
]);
}
else
{
v
=
(
T
)(
1.0
/
0.0
);
heap
.
addThreadQ
(
v
,
i
);
}
heap
.
addThreadQ
(
v
,
i
);
}
heap
.
reduce
();
...
...
core/src/index/thirdparty/faiss/gpu/utils/BlockSelectKernel.cuh
浏览文件 @
96c68edc
...
...
@@ -146,11 +146,10 @@ __global__ void blockSelect(Tensor<K, 2, true> in,
for
(;
i
<
limit
;
i
+=
ThreadsPerBlock
)
{
if
(
bitsetEmpty
||
(
!
(
bitset
[
i
>>
3
]
&
(
0x1
<<
(
i
&
0x7
)))))
{
heap
.
add
(
*
inStart
,
(
IndexType
)
i
);
}
else
{
heap
.
add
(
-
1.0
,
(
IndexType
)
i
);
heap
.
addThreadQ
(
*
inStart
,
(
IndexType
)
i
);
}
heap
.
checkThreadQ
();
inStart
+=
ThreadsPerBlock
;
}
...
...
@@ -158,8 +157,6 @@ __global__ void blockSelect(Tensor<K, 2, true> in,
if
(
i
<
in
.
getSize
(
1
))
{
if
(
bitsetEmpty
||
(
!
(
bitset
[
i
>>
3
]
&
(
0x1
<<
(
i
&
0x7
)))))
{
heap
.
addThreadQ
(
*
inStart
,
(
IndexType
)
i
);
}
else
{
heap
.
addThreadQ
(
-
1.0
,
(
IndexType
)
i
);
}
}
...
...
@@ -208,10 +205,9 @@ __global__ void blockSelectPair(Tensor<K, 2, true> inK,
for
(;
i
<
limit
;
i
+=
ThreadsPerBlock
)
{
if
(
bitsetEmpty
||
(
!
(
bitset
[
i
>>
3
]
&
(
0x1
<<
(
i
&
0x7
)))))
{
heap
.
add
(
*
inKStart
,
*
inVStart
);
}
else
{
heap
.
add
(
-
1.0
,
*
inVStart
);
heap
.
addThreadQ
(
*
inKStart
,
*
inVStart
);
}
heap
.
checkThreadQ
();
inKStart
+=
ThreadsPerBlock
;
inVStart
+=
ThreadsPerBlock
;
...
...
@@ -221,8 +217,6 @@ __global__ void blockSelectPair(Tensor<K, 2, true> inK,
if
(
i
<
inK
.
getSize
(
1
))
{
if
(
bitsetEmpty
||
(
!
(
bitset
[
i
>>
3
]
&
(
0x1
<<
(
i
&
0x7
)))))
{
heap
.
addThreadQ
(
*
inKStart
,
*
inVStart
);
}
else
{
heap
.
addThreadQ
(
-
1.0
,
*
inVStart
);
}
}
...
...
core/src/scheduler/task/SearchTask.cpp
浏览文件 @
96c68edc
...
...
@@ -288,15 +288,6 @@ XSearchTask::Execute() {
{
std
::
unique_lock
<
std
::
mutex
>
lock
(
search_job
->
mutex
());
if
(
search_job
->
GetResultIds
().
size
()
>
spec_k
)
{
if
(
search_job
->
GetResultIds
().
front
()
==
-
1
)
{
// initialized results set
search_job
->
GetResultIds
().
resize
(
spec_k
*
nq
);
search_job
->
GetResultDistances
().
resize
(
spec_k
*
nq
);
}
}
search_job
->
vector_count
()
=
nq
;
XSearchTask
::
MergeTopkToResultSet
(
output_ids
,
output_distance
,
spec_k
,
nq
,
topk
,
ascending_reduce
,
search_job
->
GetResultIds
(),
search_job
->
GetResultDistances
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录