Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
dad07c70
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,发现更多精彩内容 >>
提交
dad07c70
编写于
9月 06, 2019
作者:
H
Heisenberg
浏览文件
操作
浏览文件
下载
差异文件
MS-453 GPU search error when nprobe set more than 1024
Former-commit-id: a32159a5cca42d592efc24cac2f9acb9b35defb3
上级
bb7a0511
646a4d3f
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
39 addition
and
14 deletion
+39
-14
cpp/CHANGELOG.md
cpp/CHANGELOG.md
+3
-0
cpp/src/core/include/knowhere/index/vector_index/gpu_ivf.h
cpp/src/core/include/knowhere/index/vector_index/gpu_ivf.h
+6
-1
cpp/src/core/src/knowhere/index/vector_index/gpu_ivf.cpp
cpp/src/core/src/knowhere/index/vector_index/gpu_ivf.cpp
+13
-1
cpp/src/core/test/test_idmap.cpp
cpp/src/core/test/test_idmap.cpp
+5
-0
cpp/src/core/test/test_ivf.cpp
cpp/src/core/test/test_ivf.cpp
+4
-2
cpp/src/server/Server.cpp
cpp/src/server/Server.cpp
+2
-0
cpp/src/server/grpc_impl/GrpcRequestTask.cpp
cpp/src/server/grpc_impl/GrpcRequestTask.cpp
+2
-9
cpp/unittest/CMakeLists.txt
cpp/unittest/CMakeLists.txt
+1
-1
cpp/unittest/knowhere/knowhere_test.cpp
cpp/unittest/knowhere/knowhere_test.cpp
+3
-0
未找到文件。
cpp/CHANGELOG.md
浏览文件 @
dad07c70
...
...
@@ -26,6 +26,8 @@ Please mark all change in change log and use the ticket from JIRA.
-
MS-467 - mysql db test failed
-
MS-470 - Drop index success, which table not created
-
MS-471 - code coverage run failed
-
MS-492 - Drop index failed if index have been created with index_type: FLAT
-
MS-493 - Knowhere unittest crash
-
MS-453 - GPU search error when nprobe set more than 1024
## Improvement
...
...
@@ -85,6 +87,7 @@ Please mark all change in change log and use the ticket from JIRA.
-
MS-455 - Distribute tasks by minimal cost in scheduler
-
MS-460 - Put transport speed as weight when choosing neighbour to execute task
-
MS-459 - Add cache for pick function in tasktable
-
MS-476 - Improve search performance
-
MS-482 - Change search stream transport to unary in grpc
-
MS-487 - Define metric type in CreateTable
-
MS-488 - Improve code format in scheduler
...
...
cpp/src/core/include/knowhere/index/vector_index/gpu_ivf.h
浏览文件 @
dad07c70
...
...
@@ -9,7 +9,7 @@ namespace zilliz {
namespace
knowhere
{
struct
Resource
{
Resource
(
std
::
shared_ptr
<
faiss
::
gpu
::
StandardGpuResources
>
&
r
)
:
faiss_res
(
r
)
{
explicit
Resource
(
std
::
shared_ptr
<
faiss
::
gpu
::
StandardGpuResources
>
&
r
)
:
faiss_res
(
r
)
{
static
int64_t
global_id
=
0
;
id
=
global_id
++
;
}
...
...
@@ -32,6 +32,11 @@ class FaissGpuResourceMgr {
static
FaissGpuResourceMgr
&
GetInstance
();
// Free gpu resource, avoid cudaGetDevice error when deallocate.
// this func should be invoke before main return
void
Free
();
void
AllocateTempMem
(
ResPtr
&
resource
,
const
int64_t
&
device_id
,
const
int64_t
&
size
);
...
...
cpp/src/core/src/knowhere/index/vector_index/gpu_ivf.cpp
浏览文件 @
dad07c70
...
...
@@ -282,7 +282,7 @@ void FaissGpuResourceMgr::InitResource() {
for
(
auto
&
device
:
devices_params_
)
{
auto
&
resource_vec
=
idle_
[
device
.
first
];
for
(
int
i
=
0
;
i
<
device
.
second
.
resource_num
;
++
i
)
{
for
(
int
64_t
i
=
0
;
i
<
device
.
second
.
resource_num
;
++
i
)
{
auto
res
=
std
::
make_shared
<
faiss
::
gpu
::
StandardGpuResources
>
();
// TODO(linxj): enable set pinned memory
...
...
@@ -351,6 +351,18 @@ void FaissGpuResourceMgr::MoveToIdle(const int64_t &device_id, const ResPtr &res
idle_
[
device_id
].
insert
(
it
,
res
);
}
void
FaissGpuResourceMgr
::
Free
()
{
for
(
auto
&
item
:
in_use_
)
{
auto
&
res_vec
=
item
.
second
;
res_vec
.
clear
();
}
for
(
auto
&
item
:
idle_
)
{
auto
&
res_vec
=
item
.
second
;
res_vec
.
clear
();
}
is_init
=
false
;
}
void
GPUIndex
::
SetGpuDevice
(
const
int
&
gpu_id
)
{
gpu_id_
=
gpu_id
;
}
...
...
cpp/src/core/test/test_idmap.cpp
浏览文件 @
dad07c70
...
...
@@ -26,6 +26,11 @@ class IDMAPTest : public DataGen, public ::testing::Test {
Init_with_default
();
index_
=
std
::
make_shared
<
IDMAP
>
();
}
void
TearDown
()
override
{
FaissGpuResourceMgr
::
GetInstance
().
Free
();
}
protected:
IDMAPPtr
index_
=
nullptr
;
};
...
...
cpp/src/core/test/test_ivf.cpp
浏览文件 @
dad07c70
...
...
@@ -7,13 +7,11 @@
#include <gtest/gtest.h>
#include <iostream>
#include <sstream>
#include <thread>
#include <faiss/AutoTune.h>
#include <faiss/gpu/GpuAutoTune.h>
#include <faiss/gpu/GpuIndexIVFFlat.h>
#include <faiss/gpu/GpuClonerOptions.h>
#include "knowhere/index/vector_index/gpu_ivf.h"
#include "knowhere/index/vector_index/ivf.h"
...
...
@@ -58,6 +56,9 @@ class IVFTest
index_
=
IndexFactory
(
index_type
);
FaissGpuResourceMgr
::
GetInstance
().
InitDevice
(
device_id
,
1024
*
1024
*
200
,
1024
*
1024
*
300
,
2
);
}
void
TearDown
()
override
{
FaissGpuResourceMgr
::
GetInstance
().
Free
();
}
protected:
std
::
string
index_type
;
...
...
@@ -369,6 +370,7 @@ class GPURESTEST
void
TearDown
()
override
{
delete
ids
;
delete
dis
;
FaissGpuResourceMgr
::
GetInstance
().
Free
();
}
protected:
...
...
cpp/src/server/Server.cpp
浏览文件 @
dad07c70
...
...
@@ -19,6 +19,7 @@
#include <unistd.h>
#include <string.h>
#include <src/scheduler/SchedInst.h>
#include "knowhere/index/vector_index/gpu_ivf.h"
#include "metrics/Metrics.h"
#include "DBWrapper.h"
...
...
@@ -232,6 +233,7 @@ Server::StopService() {
grpc
::
GrpcMilvusServer
::
StopService
();
DBWrapper
::
GetInstance
().
StopService
();
engine
::
StopSchedulerService
();
knowhere
::
FaissGpuResourceMgr
::
GetInstance
().
Free
();
// free gpu resource.
}
}
...
...
cpp/src/server/grpc_impl/GrpcRequestTask.cpp
浏览文件 @
dad07c70
...
...
@@ -955,15 +955,8 @@ DropIndexTask::OnExecute() {
return
SetError
(
res
,
"Invalid table name: "
+
table_name_
);
}
//step 2:check index existence
engine
::
TableIndex
index
;
engine
::
Status
stat
=
DBWrapper
::
DB
()
->
DescribeIndex
(
table_name_
,
index
);
if
(
index
.
engine_type_
==
1
)
{
return
SetError
(
SERVER_UNEXPECTED_ERROR
,
"index not existed"
);
}
//step 3: check table existence
stat
=
DBWrapper
::
DB
()
->
DropIndex
(
table_name_
);
//step 2: check table existence
auto
stat
=
DBWrapper
::
DB
()
->
DropIndex
(
table_name_
);
if
(
!
stat
.
ok
())
{
return
SetError
(
DB_META_TRANSACTION_FAILED
,
stat
.
ToString
());
}
...
...
cpp/unittest/CMakeLists.txt
浏览文件 @
dad07c70
...
...
@@ -40,7 +40,7 @@ set(unittest_libs
add_subdirectory
(
server
)
add_subdirectory
(
db
)
#
add_subdirectory(knowhere)
add_subdirectory
(
knowhere
)
add_subdirectory
(
metrics
)
#add_subdirectory(scheduler)
#add_subdirectory(storage)
\ No newline at end of file
cpp/unittest/knowhere/knowhere_test.cpp
浏览文件 @
dad07c70
...
...
@@ -40,6 +40,9 @@ class KnowhereWrapperTest
index_
=
GetVecIndexFactory
(
index_type
);
}
void
TearDown
()
override
{
zilliz
::
knowhere
::
FaissGpuResourceMgr
::
GetInstance
().
Free
();
}
void
AssertResult
(
const
std
::
vector
<
long
>
&
ids
,
const
std
::
vector
<
float
>
&
dis
)
{
EXPECT_EQ
(
ids
.
size
(),
nq
*
k
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录