Skip to content

Commit 71fead2

Browse files
authored
Merge branch 'branch-25.10' into java/seamless-matrix-type-change
2 parents f92be71 + 587f975 commit 71fead2

25 files changed

Lines changed: 643 additions & 85 deletions

ci/release/update-version.sh

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ NEXT_MAJOR=$(echo "$NEXT_FULL_TAG" | awk '{split($0, a, "."); print a[1]}')
2222
NEXT_MINOR=$(echo "$NEXT_FULL_TAG" | awk '{split($0, a, "."); print a[2]}')
2323
NEXT_PATCH=$(echo "$NEXT_FULL_TAG" | awk '{split($0, a, "."); print a[3]}')
2424
NEXT_SHORT_TAG=${NEXT_MAJOR}.${NEXT_MINOR}
25-
NEXT_UCXX_SHORT_TAG="$(curl -sL https://version.gpuci.io/rapids/"${NEXT_SHORT_TAG}")"
2625

2726
# Need to distutils-normalize the original version
2827
NEXT_SHORT_TAG_PEP440=$(python -c "from packaging.version import Version; print(Version('${NEXT_SHORT_TAG}'))")
29-
NEXT_UCXX_SHORT_TAG_PEP440=$(python -c "from packaging.version import Version; print(Version('${NEXT_UCXX_SHORT_TAG}'))")
3028
PATCH_PEP440=$(python -c "from packaging.version import Version; print(Version('${NEXT_PATCH}'))")
3129

3230
echo "Preparing release $CURRENT_TAG => $NEXT_FULL_TAG"
@@ -51,24 +49,15 @@ DEPENDENCIES=(
5149
rmm
5250
rapids-dask-dependency
5351
)
54-
UCXX_DEPENDENCIES=(
55-
ucx-py
56-
)
5752
for FILE in dependencies.yaml conda/environments/*.yaml; do
5853
for DEP in "${DEPENDENCIES[@]}"; do
5954
sed_runner "/-.* ${DEP}\(-cu[[:digit:]]\{2\}\)\{0,1\}==/ s/==.*/==${NEXT_SHORT_TAG_PEP440}.*,>=0.0.0a0/g" "${FILE}"
6055
done
61-
for DEP in "${UCXX_DEPENDENCIES[@]}"; do
62-
sed_runner "/-.* ${DEP}\(-cu[[:digit:]]\{2\}\)\{0,1\}==/ s/==.*/==${NEXT_UCXX_SHORT_TAG_PEP440}.*,>=0.0.0a0/g" "${FILE}"
63-
done
6456
done
6557
for FILE in python/*/pyproject.toml; do
6658
for DEP in "${DEPENDENCIES[@]}"; do
6759
sed_runner "/\"${DEP}==/ s/==.*\"/==${NEXT_SHORT_TAG_PEP440}.*,>=0.0.0a0\"/g" "${FILE}"
6860
done
69-
for DEP in "${UCXX_DEPENDENCIES[@]}"; do
70-
sed_runner "/\"${DEP}\(-cu[[:digit:]]\{2\}\)\{0,1\}==/ s/==.*\"/==${NEXT_UCXX_SHORT_TAG_PEP440}.*,>=0.0.0a0\"/g" "${FILE}"
71-
done
7261
done
7362

7463
for FILE in .github/workflows/*.yaml; do

cpp/bench/ann/CMakeLists.txt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,13 @@ option(CUVS_ANN_BENCH_USE_HNSWLIB "Include hnsw algorithm in benchmark" ON)
3939
option(CUVS_ANN_BENCH_USE_GGNN "Include ggnn algorithm in benchmark" OFF)
4040
option(CUVS_ANN_BENCH_USE_DISKANN "Include DISKANN search in benchmark" ON)
4141
option(CUVS_ANN_BENCH_USE_CUVS_VAMANA "Include cuVS Vamana with DiskANN search in benchmark" ON)
42+
option(CUVS_ANN_BENCH_USE_CUVS_CAGRA_DISKANN "Include cuVS CAGRA with DISKANN search in benchmark"
43+
ON
44+
)
4245
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(ARM|arm|aarch64)")
4346
set(CUVS_ANN_BENCH_USE_DISKANN OFF)
4447
set(CUVS_ANN_BENCH_USE_CUVS_VAMANA OFF)
48+
set(CUVS_ANN_BENCH_USE_CUVS_CAGRA_DISKANN OFF)
4549
endif()
4650
option(CUVS_ANN_BENCH_USE_CUVS_MG "Include cuVS ann mg algorithm in benchmark" ${BUILD_MG_ALGOS})
4751
option(CUVS_ANN_BENCH_SINGLE_EXE
@@ -69,6 +73,7 @@ if(BUILD_CPU_ONLY)
6973
set(CUVS_KNN_BENCH_USE_CUVS_BRUTE_FORCE OFF)
7074
set(CUVS_ANN_BENCH_USE_CUVS_MG OFF)
7175
set(CUVS_ANN_BENCH_USE_CUVS_VAMANA OFF)
76+
set(CUVS_ANN_BENCH_USE_CUVS_CAGRA_DISKANN OFF)
7277
else()
7378
set(CUVS_FAISS_ENABLE_GPU ON)
7479
endif()
@@ -82,6 +87,7 @@ if(CUVS_ANN_BENCH_USE_CUVS_IVF_PQ
8287
OR CUVS_KNN_BENCH_USE_CUVS_BRUTE_FORCE
8388
OR CUVS_ANN_BENCH_USE_CUVS_MG
8489
OR CUVS_ANN_BENCH_USE_CUVS_VAMANA
90+
OR CUVS_ANN_BENCH_USE_CUVS_CAGRA_DISKANN
8591
)
8692
set(CUVS_ANN_BENCH_USE_CUVS ON)
8793
endif()
@@ -99,7 +105,10 @@ if(CUVS_ANN_BENCH_USE_GGNN)
99105
include(cmake/thirdparty/get_ggnn)
100106
endif()
101107

102-
if(CUVS_ANN_BENCH_USE_DISKANN OR CUVS_ANN_BENCH_USE_CUVS_VAMANA)
108+
if(CUVS_ANN_BENCH_USE_DISKANN
109+
OR CUVS_ANN_BENCH_USE_CUVS_VAMANA
110+
OR CUVS_ANN_BENCH_USE_CUVS_CAGRA_DISKANN
111+
)
103112
include(cmake/thirdparty/get_diskann)
104113
endif()
105114

@@ -341,6 +350,12 @@ if(CUVS_ANN_BENCH_USE_CUVS_VAMANA)
341350
ConfigureAnnBench(NAME CUVS_VAMANA PATH src/cuvs/cuvs_vamana.cu LINKS cuvs diskann::diskann aio)
342351
endif()
343352

353+
if(CUVS_ANN_BENCH_USE_CUVS_CAGRA_DISKANN)
354+
ConfigureAnnBench(
355+
NAME CUVS_CAGRA_DISKANN PATH src/cuvs/cuvs_cagra_diskann.cu LINKS cuvs diskann::diskann aio
356+
)
357+
endif()
358+
344359
# ##################################################################################################
345360
# * Dynamically-loading ANN_BENCH executable -------------------------------------------------------
346361
if(CUVS_ANN_BENCH_SINGLE_EXE)

cpp/bench/ann/src/cuvs/cuvs_ann_bench_param_parser.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@ extern template class cuvs::bench::cuvs_ivf_flat<uint8_t, int64_t>;
2727
extern template class cuvs::bench::cuvs_ivf_flat<int8_t, int64_t>;
2828
#endif
2929
#if defined(CUVS_ANN_BENCH_USE_CUVS_IVF_PQ) || defined(CUVS_ANN_BENCH_USE_CUVS_CAGRA) || \
30-
defined(CUVS_ANN_BENCH_USE_CUVS_CAGRA_HNSWLIB)
30+
defined(CUVS_ANN_BENCH_USE_CUVS_CAGRA_HNSWLIB) || defined(CUVS_ANN_BENCH_USE_CUVS_CAGRA_DISKANN)
3131
#include "cuvs_ivf_pq_wrapper.h"
3232
#endif
3333
#ifdef CUVS_ANN_BENCH_USE_CUVS_IVF_PQ
3434
extern template class cuvs::bench::cuvs_ivf_pq<float, int64_t>;
3535
extern template class cuvs::bench::cuvs_ivf_pq<uint8_t, int64_t>;
3636
extern template class cuvs::bench::cuvs_ivf_pq<int8_t, int64_t>;
3737
#endif
38-
#if defined(CUVS_ANN_BENCH_USE_CUVS_CAGRA) || defined(CUVS_ANN_BENCH_USE_CUVS_CAGRA_HNSWLIB)
38+
#if defined(CUVS_ANN_BENCH_USE_CUVS_CAGRA) || defined(CUVS_ANN_BENCH_USE_CUVS_CAGRA_HNSWLIB) || \
39+
defined(CUVS_ANN_BENCH_USE_CUVS_CAGRA_DISKANN)
3940
#include "cuvs_cagra_wrapper.h"
4041
#endif
4142
#ifdef CUVS_ANN_BENCH_USE_CUVS_CAGRA
@@ -96,8 +97,9 @@ void parse_search_param(const nlohmann::json& conf,
9697
}
9798
#endif
9899

99-
#if defined(CUVS_ANN_BENCH_USE_CUVS_IVF_PQ) || defined(CUVS_ANN_BENCH_USE_CUVS_CAGRA) || \
100-
defined(CUVS_ANN_BENCH_USE_CUVS_CAGRA_HNSWLIB) || defined(CUVS_ANN_BENCH_USE_CUVS_MG)
100+
#if defined(CUVS_ANN_BENCH_USE_CUVS_IVF_PQ) || defined(CUVS_ANN_BENCH_USE_CUVS_CAGRA) || \
101+
defined(CUVS_ANN_BENCH_USE_CUVS_CAGRA_HNSWLIB) || defined(CUVS_ANN_BENCH_USE_CUVS_MG) || \
102+
defined(CUVS_ANN_BENCH_USE_CUVS_CAGRA_DISKANN)
101103
template <typename T, typename IdxT>
102104
void parse_build_param(const nlohmann::json& conf,
103105
typename cuvs::bench::cuvs_ivf_pq<T, IdxT>::build_param& param)
@@ -188,7 +190,7 @@ void parse_search_param(const nlohmann::json& conf,
188190
#endif
189191

190192
#if defined(CUVS_ANN_BENCH_USE_CUVS_CAGRA) || defined(CUVS_ANN_BENCH_USE_CUVS_CAGRA_HNSWLIB) || \
191-
defined(CUVS_ANN_BENCH_USE_CUVS_MG)
193+
defined(CUVS_ANN_BENCH_USE_CUVS_MG) || defined(CUVS_ANN_BENCH_USE_CUVS_CAGRA_DISKANN)
192194
template <typename T, typename IdxT>
193195
void parse_build_param(const nlohmann::json& conf, cuvs::neighbors::nn_descent::index_params& param)
194196
{

cpp/bench/ann/src/cuvs/cuvs_ann_bench_utils.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023-2024, NVIDIA CORPORATION.
2+
* Copyright (c) 2023-2025, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -192,9 +192,9 @@ inline auto configured_raft_resources::operator=(configured_raft_resources&&)
192192
/** A helper to refine the neighbors when the data is on device or on host. */
193193
template <typename DatasetT, typename QueriesT, typename CandidatesT>
194194
void refine_helper(const raft::resources& res,
195-
DatasetT dataset,
196-
QueriesT queries,
197-
CandidatesT candidates,
195+
const DatasetT& dataset,
196+
const QueriesT& queries,
197+
const CandidatesT& candidates,
198198
int k,
199199
algo_base::index_type* neighbors,
200200
float* distances,
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/*
2+
* Copyright (c) 2025, NVIDIA CORPORATION.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#include "../common/ann_types.hpp"
18+
#include "cuvs_ann_bench_param_parser.h"
19+
#include "cuvs_cagra_diskann_wrapper.h"
20+
21+
#include <rmm/cuda_device.hpp>
22+
#include <rmm/mr/device/pool_memory_resource.hpp>
23+
#include <rmm/resource_ref.hpp>
24+
25+
namespace cuvs::bench {
26+
27+
template <typename T, typename IdxT>
28+
void parse_search_param(const nlohmann::json& conf,
29+
typename cuvs::bench::cuvs_cagra_diskann<T, IdxT>::search_param& param)
30+
{
31+
if (conf.contains("L_search")) { param.L_search = conf.at("L_search"); }
32+
}
33+
34+
template <typename T>
35+
auto create_algo(const std::string& algo_name,
36+
const std::string& distance,
37+
int dim,
38+
const nlohmann::json& conf) -> std::unique_ptr<cuvs::bench::algo<T>>
39+
{
40+
[[maybe_unused]] cuvs::bench::Metric metric = parse_metric(distance);
41+
std::unique_ptr<cuvs::bench::algo<T>> a;
42+
43+
if constexpr (std::is_same_v<T, float> || std::is_same_v<T, std::uint8_t> ||
44+
std::is_same_v<T, std::int8_t>) {
45+
if (algo_name == "cuvs_cagra_diskann") {
46+
typename cuvs::bench::cuvs_cagra_diskann<T, uint32_t>::build_param param;
47+
::parse_build_param<T, uint32_t>(conf, param);
48+
a = std::make_unique<cuvs::bench::cuvs_cagra_diskann<T, uint32_t>>(metric, dim, param);
49+
}
50+
}
51+
52+
if (!a) { throw std::runtime_error("invalid algo: '" + algo_name + "'"); }
53+
54+
return a;
55+
}
56+
57+
template <typename T>
58+
auto create_search_param(const std::string& algo_name, const nlohmann::json& conf)
59+
-> std::unique_ptr<typename cuvs::bench::algo<T>::search_param>
60+
{
61+
if (algo_name == "cuvs_cagra_diskann") {
62+
auto param =
63+
std::make_unique<typename cuvs::bench::cuvs_cagra_diskann<T, uint32_t>::search_param>();
64+
parse_search_param<T, uint32_t>(conf, *param);
65+
return param;
66+
}
67+
68+
throw std::runtime_error("invalid algo: '" + algo_name + "'");
69+
}
70+
71+
} // namespace cuvs::bench
72+
73+
REGISTER_ALGO_INSTANCE(float);
74+
REGISTER_ALGO_INSTANCE(std::int8_t);
75+
REGISTER_ALGO_INSTANCE(std::uint8_t);
76+
77+
#ifdef ANN_BENCH_BUILD_MAIN
78+
#include "../common/benchmark.hpp"
79+
/*
80+
[NOTE] Dear developer,
81+
82+
Please don't modify the content of the `main` function; this will make the behavior of the benchmark
83+
executable differ depending on the cmake flags and will complicate the debugging. In particular,
84+
don't try to setup an RMM memory resource here; it will anyway be modified by the memory resource
85+
set on per-algorithm basis. For example, see `cuvs/cuvs_ann_bench_utils.h`.
86+
*/
87+
int main(int argc, char** argv) { return cuvs::bench::run_main(argc, argv); }
88+
#endif

0 commit comments

Comments
 (0)