Remove faiss GPU index support (#22966)

Signed-off-by: Yudong Cai <yudong.cai@zilliz.com>
pull/22988/head
Cai Yudong 2023-03-24 17:53:58 +08:00 committed by GitHub
parent 0be96ab610
commit 8aebc6f3b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 7 additions and 52 deletions

View File

@ -77,13 +77,6 @@ KnowhereSetSimdType(const char* value) {
}
}
void
KnowhereInitGPU(const int32_t gpu_id, const int32_t res_num) {
#ifdef MILVUS_GPU_VERSION
knowhere::KnowhereConfig::InitGPUResource(gpu_id, res_num);
#endif
}
void
KnowhereInitThreadPool(const uint32_t num_threads) {
knowhere::ThreadPool::InitGlobalThreadPool(num_threads);

View File

@ -25,9 +25,6 @@ KnowhereInitImpl(const char*);
std::string
KnowhereSetSimdType(const char*);
void
KnowhereInitGPU(const int32_t, const int32_t);
void
KnowhereInitThreadPool(const uint32_t);

View File

@ -27,8 +27,3 @@ IndexBuilderSetSimdType(const char* value) {
ret[real_type.length()] = 0;
return ret;
}
void
IndexBuilderInitGPU(const int32_t gpu_id, const int32_t res_num) {
milvus::config::KnowhereInitGPU(gpu_id, res_num);
}

View File

@ -22,9 +22,6 @@ IndexBuilderInit(const char*);
char*
IndexBuilderSetSimdType(const char*);
void
IndexBuilderInitGPU(const int32_t, const int32_t);
#ifdef __cplusplus
};
#endif

View File

@ -58,9 +58,4 @@ SegcoreSetSimdType(const char* value) {
return ret;
}
extern "C" void
SegcoreInitGPU(const int32_t gpu_id, const int32_t res_num) {
milvus::config::KnowhereInitGPU(gpu_id, res_num);
}
} // namespace milvus::segcore

View File

@ -31,9 +31,6 @@ SegcoreSetNprobe(const int64_t);
char*
SegcoreSetSimdType(const char*);
void
SegcoreInitGPU(const int32_t, const int32_t);
void
SegcoreSetThreadPoolNum(const uint32_t num_threads);

View File

@ -156,11 +156,6 @@ func (i *IndexNode) initKnowhere() {
cCPUNum := C.int(hardware.GetCPUNum())
C.InitCpuNum(cCPUNum)
// init GPU resource
cGpuId := C.int32_t(0)
cResNum := C.int32_t(1)
C.IndexBuilderInitGPU(cGpuId, cResNum)
initcore.InitLocalStorageConfig(Params)
}

View File

@ -288,11 +288,6 @@ func (node *QueryNode) InitSegcore() {
cCPUNum := C.int(hardware.GetCPUNum())
C.InitCpuNum(cCPUNum)
// init GPU resource
cGpuId := C.int32_t(0)
cResNum := C.int32_t(1)
C.SegcoreInitGPU(cGpuId, cResNum)
initcore.InitLocalStorageConfig(Params)
mmapDirPath := paramtable.Get().QueryNodeCfg.MmapDirPath.GetValue()

View File

@ -46,10 +46,6 @@ func (mgr *ConfAdapterMgrImpl) GetAdapter(indexType string) (ConfAdapter, error)
}
func (mgr *ConfAdapterMgrImpl) registerConfAdapter() {
mgr.adapters[IndexFaissGPUIDMap] = newBaseConfAdapter()
mgr.adapters[IndexFaissGPUIvfFlat] = newIVFConfAdapter()
mgr.adapters[IndexFaissGPUIvfPQ] = newIVFPQConfAdapter()
mgr.adapters[IndexFaissGPUIvfSQ8] = newIVFSQConfAdapter()
mgr.adapters[IndexRaftIvfFlat] = newIVFConfAdapter()
mgr.adapters[IndexRaftIvfPQ] = newIVFPQConfAdapter()
mgr.adapters[IndexFaissIDMap] = newBaseConfAdapter()

View File

@ -16,10 +16,6 @@ type IndexType = string
// IndexType definitions
const (
IndexFaissGPUIDMap IndexType = "GPU_FLAT" // no index is built.
IndexFaissGPUIvfFlat IndexType = "GPU_IVF_FLAT"
IndexFaissGPUIvfPQ IndexType = "GPU_IVF_PQ"
IndexFaissGPUIvfSQ8 IndexType = "GPU_IVF_SQ8"
IndexRaftIvfFlat IndexType = "RAFT_IVF_FLAT"
IndexRaftIvfPQ IndexType = "RAFT_IVF_PQ"
IndexFaissIDMap IndexType = "FLAT" // no index is built.

View File

@ -183,11 +183,10 @@ get_wrong_format_dict = [
""" Specially defined list """
all_index_types = ["FLAT", "IVF_FLAT", "IVF_SQ8", "IVF_PQ", "HNSW", "ANNOY", "DISKANN", "BIN_FLAT", "BIN_IVF_FLAT",
"GPU_FLAT", "GPU_IVF_FLAT", "GPU_IVF_PQ", "GPU_IVF_SQ8", "RAFT_IVF_FLAT", "RAFT_IVF_PQ"]
"RAFT_IVF_FLAT", "RAFT_IVF_PQ"]
default_index_params = [{"nlist": 128}, {"nlist": 128}, {"nlist": 128}, {"nlist": 128, "m": 16, "nbits": 8},
{"M": 48, "efConstruction": 500}, {"n_trees": 50}, {}, {"nlist": 128}, {"nlist": 128},
{}, {"nlist": 128}, {"nlist": 128, "m": 16, "nbits": 8}, {"nlist": 128},
{"nlist": 128}, {"nlist": 128, "m": 16, "nbits": 8}]
Handler_type = ["GRPC", "HTTP"]

View File

@ -1798,8 +1798,8 @@ class TestCollectionSearch(TestcaseBase):
@pytest.mark.tags(CaseLabel.GPU)
@pytest.mark.parametrize("index, params",
zip(ct.all_index_types[9:14],
ct.default_index_params[9:14]))
zip(ct.all_index_types[9:10],
ct.default_index_params[9:10]))
def test_search_after_different_index_with_params_gpu(self, dim, index, params, auto_id, _async):
"""
target: test search after different index
@ -1877,8 +1877,8 @@ class TestCollectionSearch(TestcaseBase):
@pytest.mark.tags(CaseLabel.GPU)
@pytest.mark.parametrize("index, params",
zip(ct.all_index_types[9:14],
ct.default_index_params[9:14]))
zip(ct.all_index_types[9:10],
ct.default_index_params[9:10]))
def test_search_after_different_index_with_min_dim_gpu(self, index, params, auto_id, _async):
"""
target: test search after different index with min dim
@ -1958,8 +1958,8 @@ class TestCollectionSearch(TestcaseBase):
@pytest.mark.tags(CaseLabel.GPU)
@pytest.mark.parametrize("index, params",
zip(ct.all_index_types[9:14],
ct.default_index_params[9:14]))
zip(ct.all_index_types[9:10],
ct.default_index_params[9:10]))
def test_search_after_index_different_metric_type_gpu(self, dim, index, params, auto_id, _async):
"""
target: test search with different metric type