Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

reduce cuda stream concurency #914

Merged
merged 1 commit into from
Jun 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/index/ivf_raft/ivf_raft.cu
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,30 @@
#include "knowhere/factory.h"
#include "knowhere/index_node_thread_pool_wrapper.h"

constexpr uint32_t cuda_concurrent_size = 16;

namespace knowhere {
KNOWHERE_REGISTER_GLOBAL(GPU_RAFT_IVF_FLAT, [](const Object& object) {
return Index<IndexNodeThreadPoolWrapper>::Create(
std::make_unique<RaftIvfIndexNode<detail::raft_ivf_flat_index>>(object));
std::make_unique<RaftIvfIndexNode<detail::raft_ivf_flat_index>>(object),
std::make_shared<ThreadPool>(cuda_concurrent_size));
});

KNOWHERE_REGISTER_GLOBAL(GPU_RAFT_IVF_PQ, [](const Object& object) {
return Index<IndexNodeThreadPoolWrapper>::Create(
std::make_unique<RaftIvfIndexNode<detail::raft_ivf_pq_index>>(object));
std::make_unique<RaftIvfIndexNode<detail::raft_ivf_pq_index>>(object),
std::make_shared<ThreadPool>(cuda_concurrent_size));
});

KNOWHERE_REGISTER_GLOBAL(GPU_IVF_FLAT, [](const Object& object) {
return Index<IndexNodeThreadPoolWrapper>::Create(
std::make_unique<RaftIvfIndexNode<detail::raft_ivf_flat_index>>(object));
std::make_unique<RaftIvfIndexNode<detail::raft_ivf_flat_index>>(object),
std::make_shared<ThreadPool>(cuda_concurrent_size));
});

KNOWHERE_REGISTER_GLOBAL(GPU_IVF_PQ, [](const Object& object) {
return Index<IndexNodeThreadPoolWrapper>::Create(
std::make_unique<RaftIvfIndexNode<detail::raft_ivf_pq_index>>(object));
std::make_unique<RaftIvfIndexNode<detail::raft_ivf_pq_index>>(object),
std::make_shared<ThreadPool>(cuda_concurrent_size));
});
} // namespace knowhere