diff --git a/cpp/src/neighbors/detail/cagra/cagra_build.cuh b/cpp/src/neighbors/detail/cagra/cagra_build.cuh index 4a927add5..b52273507 100644 --- a/cpp/src/neighbors/detail/cagra/cagra_build.cuh +++ b/cpp/src/neighbors/detail/cagra/cagra_build.cuh @@ -30,13 +30,9 @@ #include #include +#include #include -// TODO: Fixme- this needs to be migrated -#include "../../ivf_pq/ivf_pq_build.cuh" -#include "../../ivf_pq/ivf_pq_search.cuh" -#include "../../nn_descent.cuh" - // TODO: This shouldn't be calling spatial/knn APIs #include "../ann_utils.cuh" @@ -156,8 +152,7 @@ void build_knn_graph( }(); RAFT_LOG_DEBUG("# Building IVF-PQ index %s", model_name.c_str()); - auto index = - cuvs::neighbors::ivf_pq::detail::build(res, pq.build_params, dataset); + auto index = cuvs::neighbors::ivf_pq::build(res, pq.build_params, dataset); // // search top (k + 1) neighbors @@ -169,7 +164,8 @@ void build_knn_graph( const auto num_queries = dataset.extent(0); // Use the same maximum batch size as the ivf_pq::search to avoid allocating more than needed. - using cuvs::neighbors::ivf_pq::detail::kMaxQueries; + constexpr uint32_t kMaxQueries = 4096; + // Heuristic: the build_knn_graph code should use only a fraction of the workspace memory; the // rest should be used by the ivf_pq::search. Here we say that the workspace size should be a good // multiple of what is required for the I/O batching below. @@ -357,8 +353,7 @@ void build_knn_graph( raft::host_matrix_view knn_graph, cuvs::neighbors::nn_descent::index_params build_params) { - auto nn_descent_idx = cuvs::neighbors::nn_descent::index(res, knn_graph); - cuvs::neighbors::nn_descent::build(res, build_params, dataset, nn_descent_idx); + auto nn_descent_idx = cuvs::neighbors::nn_descent::build(res, build_params, dataset); using internal_IdxT = typename std::make_unsigned::type; using g_accessor = typename decltype(nn_descent_idx.graph())::accessor_type; diff --git a/cpp/src/neighbors/detail/cagra/cagra_search.cuh b/cpp/src/neighbors/detail/cagra/cagra_search.cuh index 6dc601f32..523626d2b 100644 --- a/cpp/src/neighbors/detail/cagra/cagra_search.cuh +++ b/cpp/src/neighbors/detail/cagra/cagra_search.cuh @@ -18,7 +18,6 @@ #include "factory.cuh" #include "search_plan.cuh" -#include "search_single_cta_inst.cuh" #include #include @@ -29,10 +28,6 @@ #include #include - -// TODO: Fix these when ivf methods are moved over -#include "../../ivf_common.cuh" -#include "../../ivf_pq/ivf_pq_search.cuh" #include // TODO: This shouldn't be calling spatial/knn apis