mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
GPU search turn into CPU search when nprobe >gpu_max_k (#3586)
Signed-off-by: shengjun.li <shengjun.li@zilliz.com>
This commit is contained in:
parent
af2e7d9a88
commit
dddf697e90
@ -12,6 +12,8 @@
|
||||
#include "scheduler/selector/FaissIVFFlatPass.h"
|
||||
#include "cache/GpuCacheMgr.h"
|
||||
#include "config/ServerConfig.h"
|
||||
#include "faiss/gpu/utils/DeviceUtils.h"
|
||||
#include "knowhere/index/vector_index/helpers/IndexParameter.h"
|
||||
#include "scheduler/SchedInst.h"
|
||||
#include "scheduler/Utils.h"
|
||||
#include "scheduler/task/SearchTask.h"
|
||||
@ -54,7 +56,11 @@ FaissIVFFlatPass::Run(const TaskPtr& task) {
|
||||
LOG_SERVER_DEBUG_ << LogOut("FaissIVFFlatPass: gpu disable, specify cpu to search!");
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else if (search_task->nq() < threshold_) {
|
||||
LOG_SERVER_DEBUG_ << LogOut("FaissIVFFlatPass: nq < gpu_search_threshold, specify cpu to search!");
|
||||
LOG_SERVER_DEBUG_ << LogOut("FaissIVFFlatPass: nq < gpu_search_threshold, specify cpu to search! ");
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else if (search_task->ExtraParam()[knowhere::IndexParams::nprobe].get<int64_t>() >
|
||||
faiss::gpu::getMaxKSelection()) {
|
||||
LOG_SERVER_DEBUG_ << LogOut("FaissIVFFlatPass: nprobe > gpu_max_nprobe_threshold, specify cpu to search!");
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else {
|
||||
LOG_SERVER_DEBUG_ << LogOut("FaissIVFFlatPass: nq >= gpu_search_threshold, specify gpu %d to search!",
|
||||
|
||||
@ -12,6 +12,8 @@
|
||||
#include "scheduler/selector/FaissIVFPQPass.h"
|
||||
#include "cache/GpuCacheMgr.h"
|
||||
#include "config/ServerConfig.h"
|
||||
#include "faiss/gpu/utils/DeviceUtils.h"
|
||||
#include "knowhere/index/vector_index/helpers/IndexParameter.h"
|
||||
#include "scheduler/SchedInst.h"
|
||||
#include "scheduler/Utils.h"
|
||||
#include "scheduler/task/SearchTask.h"
|
||||
@ -58,6 +60,10 @@ FaissIVFPQPass::Run(const TaskPtr& task) {
|
||||
} else if (search_task->nq() < threshold_) {
|
||||
LOG_SERVER_DEBUG_ << LogOut("FaissIVFPQPass: nq < gpu_search_threshold, specify cpu to search!");
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else if (search_task->ExtraParam()[knowhere::IndexParams::nprobe].get<int64_t>() >
|
||||
faiss::gpu::getMaxKSelection()) {
|
||||
LOG_SERVER_DEBUG_ << LogOut("FaissIVFFlatPass: nprobe > gpu_max_nprobe_threshold, specify cpu to search!");
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else {
|
||||
LOG_SERVER_DEBUG_ << LogOut("FaissIVFPQPass: nq >= gpu_search_threshold, specify gpu %d to search!",
|
||||
search_gpus_[idx_]);
|
||||
|
||||
@ -13,6 +13,8 @@
|
||||
#include "scheduler/selector/FaissIVFSQ8HPass.h"
|
||||
#include "cache/GpuCacheMgr.h"
|
||||
#include "config/ServerConfig.h"
|
||||
#include "faiss/gpu/utils/DeviceUtils.h"
|
||||
#include "knowhere/index/vector_index/helpers/IndexParameter.h"
|
||||
#include "scheduler/SchedInst.h"
|
||||
#include "scheduler/Utils.h"
|
||||
#include "scheduler/task/SearchTask.h"
|
||||
@ -55,6 +57,10 @@ FaissIVFSQ8HPass::Run(const TaskPtr& task) {
|
||||
} else if (search_task->nq() < threshold_) {
|
||||
LOG_SERVER_DEBUG_ << LogOut("FaissIVFSQ8HPass: nq < gpu_search_threshold, specify cpu to search!");
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else if (search_task->ExtraParam()[knowhere::IndexParams::nprobe].get<int64_t>() >
|
||||
faiss::gpu::getMaxKSelection()) {
|
||||
LOG_SERVER_DEBUG_ << LogOut("FaissIVFFlatPass: nprobe > gpu_max_nprobe_threshold, specify cpu to search!");
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else {
|
||||
LOG_SERVER_DEBUG_ << LogOut("FaissIVFSQ8HPass: nq >= gpu_search_threshold, specify gpu %d to search!",
|
||||
search_gpus_[idx_]);
|
||||
|
||||
@ -12,6 +12,8 @@
|
||||
#include "scheduler/selector/FaissIVFSQ8Pass.h"
|
||||
#include "cache/GpuCacheMgr.h"
|
||||
#include "config/ServerConfig.h"
|
||||
#include "faiss/gpu/utils/DeviceUtils.h"
|
||||
#include "knowhere/index/vector_index/helpers/IndexParameter.h"
|
||||
#include "scheduler/SchedInst.h"
|
||||
#include "scheduler/Utils.h"
|
||||
#include "scheduler/task/SearchTask.h"
|
||||
@ -56,6 +58,10 @@ FaissIVFSQ8Pass::Run(const TaskPtr& task) {
|
||||
} else if (search_task->nq() < threshold_) {
|
||||
LOG_SERVER_DEBUG_ << LogOut("FaissIVFSQ8Pass: nq < gpu_search_threshold, specify cpu to search!");
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else if (search_task->ExtraParam()[knowhere::IndexParams::nprobe].get<int64_t>() >
|
||||
faiss::gpu::getMaxKSelection()) {
|
||||
LOG_SERVER_DEBUG_ << LogOut("FaissIVFFlatPass: nprobe > gpu_max_nprobe_threshold, specify cpu to search!");
|
||||
res_ptr = ResMgrInst::GetInstance()->GetResource("cpu");
|
||||
} else {
|
||||
LOG_SERVER_DEBUG_ << LogOut("FaissIVFSQ8Pass: nq >= gpu_search_threshold, specify gpu %d to search!",
|
||||
search_gpus_[idx_]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user