mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-02-02 01:06:41 +08:00
GPU search turn into CPU search when nprobe >2048 (#3594)
* gpu nprobe Signed-off-by: cqy <yaya645@126.com> * [skip ci] changelog Signed-off-by: cqy <yaya645@126.com>
This commit is contained in:
parent
a9751fec4f
commit
d5ecdf2dda
@ -8,6 +8,7 @@ Please mark all change in change log and use the issue from GitHub
|
||||
## Feature
|
||||
- \#3213 Allow users to specify a distance type at runtime for Flat index
|
||||
- \#3254 Allow more choices for the parameter ‘m’ of CPU IVF_PQ
|
||||
- \#3606 Searching auto turn into CPU when the parameter 'nprobe' of IVF is larger than 2048
|
||||
|
||||
## Improvement
|
||||
|
||||
|
||||
@ -12,11 +12,13 @@
|
||||
#include "scheduler/selector/FaissIVFFlatPass.h"
|
||||
#include "cache/GpuCacheMgr.h"
|
||||
#include "config/Config.h"
|
||||
#include "knowhere/index/vector_index/helpers/IndexParameter.h"
|
||||
#include "scheduler/SchedInst.h"
|
||||
#include "scheduler/Utils.h"
|
||||
#include "scheduler/task/SearchTask.h"
|
||||
#include "scheduler/tasklabel/SpecResLabel.h"
|
||||
#include "utils/Log.h"
|
||||
#include "utils/ValidationUtil.h"
|
||||
|
||||
namespace milvus {
|
||||
namespace scheduler {
|
||||
@ -61,6 +63,11 @@ FaissIVFFlatPass::Run(const TaskPtr& task) {
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissIVFFlatPass: nq < gpu_search_threshold, specify cpu to search!",
|
||||
"search", 0);
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else if (search_job->extra_params()[knowhere::IndexParams::nprobe].get<int64_t>() <
|
||||
milvus::server::QUERY_MAX_TOPK) {
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissIVFFlatPass: nprobe > gpu_nprobe_threshold, specify cpu to search!",
|
||||
"search", 0);
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else {
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissIVFFlatPass: nq >= gpu_search_threshold, specify gpu %d to search!",
|
||||
"search", 0, search_gpus_[idx_]);
|
||||
|
||||
@ -12,11 +12,13 @@
|
||||
#include "scheduler/selector/FaissIVFPQPass.h"
|
||||
#include "cache/GpuCacheMgr.h"
|
||||
#include "config/Config.h"
|
||||
#include "knowhere/index/vector_index/helpers/IndexParameter.h"
|
||||
#include "scheduler/SchedInst.h"
|
||||
#include "scheduler/Utils.h"
|
||||
#include "scheduler/task/SearchTask.h"
|
||||
#include "scheduler/tasklabel/SpecResLabel.h"
|
||||
#include "utils/Log.h"
|
||||
#include "utils/ValidationUtil.h"
|
||||
|
||||
#include <fiu-local.h>
|
||||
|
||||
@ -63,6 +65,11 @@ FaissIVFPQPass::Run(const TaskPtr& task) {
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissIVFPQPass: nq < gpu_search_threshold, specify cpu to search!",
|
||||
"search", 0);
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else if (search_job->extra_params()[knowhere::IndexParams::nprobe].get<int64_t>() <
|
||||
milvus::server::QUERY_MAX_TOPK) {
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissIVFFlatPass: nprobe > gpu_nprobe_threshold, specify cpu to search!",
|
||||
"search", 0);
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else {
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissIVFPQPass: nq >= gpu_search_threshold, specify gpu %d to search!",
|
||||
"search", 0, search_gpus_[idx_]);
|
||||
|
||||
@ -13,11 +13,13 @@
|
||||
#include "scheduler/selector/FaissIVFSQ8HPass.h"
|
||||
#include "cache/GpuCacheMgr.h"
|
||||
#include "config/Config.h"
|
||||
#include "knowhere/index/vector_index/helpers/IndexParameter.h"
|
||||
#include "scheduler/SchedInst.h"
|
||||
#include "scheduler/Utils.h"
|
||||
#include "scheduler/task/SearchTask.h"
|
||||
#include "scheduler/tasklabel/SpecResLabel.h"
|
||||
#include "utils/Log.h"
|
||||
#include "utils/ValidationUtil.h"
|
||||
|
||||
namespace milvus {
|
||||
namespace scheduler {
|
||||
@ -61,6 +63,11 @@ FaissIVFSQ8HPass::Run(const TaskPtr& task) {
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissIVFSQ8HPass: nq < gpu_search_threshold, specify cpu to search!",
|
||||
"search", 0);
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else if (search_job->extra_params()[knowhere::IndexParams::nprobe].get<int64_t>() <
|
||||
milvus::server::QUERY_MAX_TOPK) {
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissIVFFlatPass: nprobe > gpu_nprobe_threshold, specify cpu to search!",
|
||||
"search", 0);
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else {
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissIVFSQ8HPass: nq >= gpu_search_threshold, specify gpu %d to search!",
|
||||
"search", 0, search_gpus_[idx_]);
|
||||
|
||||
@ -12,11 +12,13 @@
|
||||
#include "scheduler/selector/FaissIVFSQ8Pass.h"
|
||||
#include "cache/GpuCacheMgr.h"
|
||||
#include "config/Config.h"
|
||||
#include "knowhere/index/vector_index/helpers/IndexParameter.h"
|
||||
#include "scheduler/SchedInst.h"
|
||||
#include "scheduler/Utils.h"
|
||||
#include "scheduler/task/SearchTask.h"
|
||||
#include "scheduler/tasklabel/SpecResLabel.h"
|
||||
#include "utils/Log.h"
|
||||
#include "utils/ValidationUtil.h"
|
||||
|
||||
namespace milvus {
|
||||
namespace scheduler {
|
||||
@ -61,6 +63,11 @@ FaissIVFSQ8Pass::Run(const TaskPtr& task) {
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissIVFSQ8Pass: nq < gpu_search_threshold, specify cpu to search!",
|
||||
"search", 0);
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else if (search_job->extra_params()[knowhere::IndexParams::nprobe].get<int64_t>() <
|
||||
milvus::server::QUERY_MAX_TOPK) {
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissIVFFlatPass: nprobe > gpu_nprobe_threshold, specify cpu to search!",
|
||||
"search", 0);
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else {
|
||||
LOG_SERVER_DEBUG_ << LogOut("[%s][%d] FaissIVFSQ8Pass: nq >= gpu_search_threshold, specify gpu %d to search!",
|
||||
"search", 0, search_gpus_[idx_]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user