Skip to content

Commit e50ecb5

Browse files
authored
Merge branch 'release/26.10' into codex/cuvs-bench-prefetch-async-rmm
2 parents 2e89934 + d73e5a7 commit e50ecb5

178 files changed

Lines changed: 1271 additions & 1112 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/pr.yaml‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ jobs:
162162
- '!ci/test_wheel_cuvs.sh'
163163
- '!ci/validate_wheel.sh'
164164
- '!docs/**'
165+
- '!examples/go/**'
166+
- '!examples/java/**'
165167
- '!fern/**'
166168
- '!go/**'
167169
- '!img/**'
@@ -214,7 +216,15 @@ jobs:
214216
- '!conda/recipes/cuvs-bench/**'
215217
- '!conda/recipes/cuvs-bench-cpu/**'
216218
- '!docs/**'
217-
- '!examples/**'
219+
- '!examples/.clang-format'
220+
- '!examples/.clang-tidy'
221+
- '!examples/.clangd'
222+
- '!examples/README.md'
223+
- '!examples/build.sh'
224+
- '!examples/c/**'
225+
- '!examples/cmake/**'
226+
- '!examples/cpp/**'
227+
- '!examples/go/**'
218228
- '!fern/**'
219229
- '!go/**'
220230
- '!img/**'
@@ -268,6 +278,7 @@ jobs:
268278
- '!README.md'
269279
- '!SECURITY.md'
270280
- '!docs/**'
281+
- '!examples/**'
271282
- '!fern/**'
272283
- '!go/**'
273284
- '!img/**'
@@ -325,6 +336,7 @@ jobs:
325336
- '!cpp/.clang-tidy'
326337
- '!cpp/doxygen/**'
327338
- '!docs/**'
339+
- '!examples/**'
328340
- '!fern/**'
329341
- '!java/**'
330342
- '!go/**'
@@ -377,6 +389,7 @@ jobs:
377389
- '!ci/test_wheel_cuvs.sh'
378390
- '!ci/validate_wheel.sh'
379391
- '!docs/**'
392+
- '!examples/**'
380393
- '!fern/**'
381394
- '!go/**'
382395
- '!img/**'
@@ -430,6 +443,15 @@ jobs:
430443
- '!ci/test_wheel_cuvs.sh'
431444
- '!ci/validate_wheel.sh'
432445
- '!docs/**'
446+
- '!examples/.clang-format'
447+
- '!examples/.clang-tidy'
448+
- '!examples/.clangd'
449+
- '!examples/README.md'
450+
- '!examples/build.sh'
451+
- '!examples/c/**'
452+
- '!examples/cmake/**'
453+
- '!examples/cpp/**'
454+
- '!examples/java/**'
433455
- '!fern/**'
434456
- '!img/**'
435457
- '!java/**'

‎.pre-commit-config.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ repos:
121121
name: spotless-fmt
122122
entry: ci/checks/run_spotless.sh
123123
pass_filenames: false
124-
files: ^java/(cuvs-java|cuvs-lucene)/([^/]+/)?src/.*\.java$
124+
files: ^(java|examples/java)/(cuvs-java|cuvs-lucene)/([^/]+/)?src/.*\.java$
125125
exclude: .*/panama/.*
126126
language: script
127127
verbose: true

‎build.sh‎

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ARGS=$*
1919
# scripts, and that this script resides in the repo dir!
2020
REPODIR=$(cd "$(dirname "$0")"; pwd)
2121

22-
VALIDARGS="clean libcuvs python rust go java lucene docs tests bench-ann examples --uninstall -v -g -n --allgpuarch --no-mg --mnmg-tests --no-cpu --cpu-only --no-shared-libs --no-nvtx --show_depr_warn --incl-cache-stats --time -h --run-java-tests"
22+
VALIDARGS="clean libcuvs python rust go java lucene docs tests bench-ann examples --uninstall -v -g -n --allgpuarch --no-mg --mnmg-tests --no-cpu --cpu-only --no-shared-libs --no-nvtx --show_depr_warn --incl-cache-stats --time -h --run-java-tests --build-java-examples"
2323
HELP="$0 [<target> ...] [<flag> ...] [--cmake-args=\"<args>\"] [--cache-tool=<tool>] [--limit-tests=<targets>] [--limit-bench-ann=<targets>] [--build-metrics=<filename>]
2424
where <target> is:
2525
clean - remove all existing build artifacts and configuration (start over)
@@ -57,6 +57,8 @@ HELP="$0 [<target> ...] [<flag> ...] [--cmake-args=\"<args>\"] [--cache-tool=<to
5757
--no-shared-libs - build without shared libraries
5858
--show_depr_warn - show cmake deprecation warnings
5959
--run-java-tests - run Java tests after building
60+
--build-java-examples - also build the examples/java/cuvs-java and examples/java/cuvs-lucene
61+
projects against the jars just built (with the 'java'/'lucene' targets)
6062
--build-metrics - filename for generating build metrics report for libcuvs
6163
--incl-cache-stats - include cache statistics in build metrics report
6264
--cmake-args=\\\"<args>\\\" - pass arbitrary list of CMake configuration options (escape all quotes in argument)
@@ -560,11 +562,14 @@ if (( NUMARGS == 0 )) || hasArg java; then
560562
echo "Please add 'libcuvs' to this script's arguments (ex. './build.sh libcuvs java') if libcuvs libraries are not already built"
561563
fi
562564
cd "${REPODIR}"/java
565+
JAVA_BUILD_ARGS=()
563566
if hasArg --run-java-tests; then
564-
./build.sh --run-java-tests
565-
else
566-
./build.sh
567+
JAVA_BUILD_ARGS+=("--run-java-tests")
567568
fi
569+
if hasArg --build-java-examples; then
570+
JAVA_BUILD_ARGS+=("--build-java-examples")
571+
fi
572+
./build.sh "${JAVA_BUILD_ARGS[@]}"
568573
fi
569574

570575
# Build the cuvs-lucene codecs
@@ -573,11 +578,14 @@ if (( NUMARGS == 0 )) || hasArg lucene; then
573578
echo "Please add 'java' to this script's arguments (ex. './build.sh libcuvs java lucene') if the cuvs Java bindings are not already built"
574579
fi
575580
cd "${REPODIR}"/java/cuvs-lucene
581+
LUCENE_BUILD_ARGS=()
576582
if hasArg --run-java-tests; then
577-
./build.sh --run-java-tests
578-
else
579-
./build.sh
583+
LUCENE_BUILD_ARGS+=("--run-java-tests")
584+
fi
585+
if hasArg --build-java-examples; then
586+
LUCENE_BUILD_ARGS+=("--build-java-examples")
580587
fi
588+
./build.sh "${LUCENE_BUILD_ARGS[@]}"
581589
fi
582590

583591
RAPIDS_VERSION="$(sed -E -e 's/^([0-9]{2})\.([0-9]{2})\.([0-9]{2}).*$/\1.\2.\3/' "${REPODIR}/VERSION")"

‎c/src/core/c_api.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ extern "C" cuvsError_t cuvsStreamGet(cuvsResources_t res, cudaStream_t* stream)
144144
{
145145
return cuvs::core::translate_exceptions([=] {
146146
auto res_ptr = reinterpret_cast<raft::resources*>(res);
147-
*stream = raft::resource::get_cuda_stream(*res_ptr);
147+
*stream = raft::resource::get_cuda_stream(*res_ptr).get();
148148
});
149149
}
150150

‎c/src/neighbors/nn_descent.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION.
2+
* SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

@@ -107,7 +107,7 @@ void _get_distances(cuvsResources_t res, cuvsNNDescentIndex_t index, DLManagedTe
107107
src->data_handle(),
108108
dst.extent(0) * dst.extent(1) * sizeof(float),
109109
cudaMemcpyDefault,
110-
raft::resource::get_cuda_stream(*res_ptr));
110+
raft::resource::get_cuda_stream(*res_ptr).get());
111111

112112
} else {
113113
RAFT_FAIL("Unsupported nn-descent index dtype: %d and bits: %d", dtype.code, dtype.bits);

‎c/tests/neighbors/ann_ivf_sq_c.cu‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION.
2+
* SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

@@ -108,7 +108,7 @@ TEST(IvfSqC, BuildSearch)
108108

109109
cuvsResources_t res;
110110
cuvsResourcesCreate(&res);
111-
cuvsStreamSet(res, stream);
111+
cuvsStreamSet(res, stream.get());
112112

113113
run_ivf_sq(res,
114114
n_rows,

‎c/tests/neighbors/ann_mg_c.cu‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION.
2+
* SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

66
#include <cuda.h>
77
#include <gtest/gtest.h>
8+
#include <cuda/stream>
9+
810
#include <raft/core/device_mdarray.hpp>
911
#include <raft/core/handle.hpp>
1012
#include <raft/random/rng.cuh>
@@ -158,12 +160,12 @@ class MgCTest : public ::testing::TestWithParam<mg_test_params> {
158160

159161
protected:
160162
mg_test_params params;
161-
rmm::device_uvector<float> index_data{0, rmm::cuda_stream_default};
162-
rmm::device_uvector<float> query_data{0, rmm::cuda_stream_default};
163-
rmm::device_uvector<int64_t> neighbors_data{0, rmm::cuda_stream_default};
164-
rmm::device_uvector<float> distances_data{0, rmm::cuda_stream_default};
165-
rmm::device_uvector<int64_t> ref_neighbors_data{0, rmm::cuda_stream_default};
166-
rmm::device_uvector<float> ref_distances_data{0, rmm::cuda_stream_default};
163+
rmm::device_uvector<float> index_data{0, cuda::stream_ref{cudaStream_t{cudaStreamDefault}}};
164+
rmm::device_uvector<float> query_data{0, cuda::stream_ref{cudaStream_t{cudaStreamDefault}}};
165+
rmm::device_uvector<int64_t> neighbors_data{0, cuda::stream_ref{cudaStream_t{cudaStreamDefault}}};
166+
rmm::device_uvector<float> distances_data{0, cuda::stream_ref{cudaStream_t{cudaStreamDefault}}};
167+
rmm::device_uvector<int64_t> ref_neighbors_data{0, cuda::stream_ref{cudaStream_t{cudaStreamDefault}}};
168+
rmm::device_uvector<float> ref_distances_data{0, cuda::stream_ref{cudaStream_t{cudaStreamDefault}}};
167169

168170
// Host memory for multi-GPU tests
169171
std::vector<float> index_data_host;

‎ci/build_java.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export SCCACHE_S3_USE_PREPROCESSOR_CACHE_MODE=true
1313
# TODO: Remove this argument-handling when build and test workflows are separated,
1414
# and test_java.sh no longer calls build_java.sh
1515
# ref: https://github.com/nvidia/cuvs/issues/868
16-
EXTRA_BUILD_ARGS=()
16+
EXTRA_BUILD_ARGS=("--build-java-examples")
1717
if [[ "${1:-}" == "--run-java-tests" ]]; then
1818
EXTRA_BUILD_ARGS+=("--run-java-tests")
1919
fi

‎ci/build_lucene.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set -euo pipefail
99
# TODO: Remove the flag handling when build and test workflows are separated,
1010
# and test_lucene.sh no longer calls build_lucene.sh
1111
# ref: https://github.com/rapidsai/cuvs/issues/868
12-
EXTRA_BUILD_ARGS=()
12+
EXTRA_BUILD_ARGS=("--build-java-examples")
1313
CUVS_JAVA_ARTIFACT=""
1414
for arg in "$@"; do
1515
case "${arg}" in

‎ci/checks/run_spotless.sh‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# SPDX-License-Identifier: Apache-2.0
44

55
# pre-commit hook wrapper that runs 'spotless:apply' to format the Java sources of every Maven
6-
# project under java/.
6+
# project under java/ and examples/java/.
77
#
88
# Most cuvs contributors do not work on the Java client and do not have Maven installed. For them,
99
# running 'pre-commit run --all-files' matches every Java source file in the repo regardless of
@@ -15,11 +15,11 @@ set -euo pipefail
1515

1616
# Keep these in sync with the spotless-fmt hook's 'files'/'exclude' entries in
1717
# .pre-commit-config.yaml.
18-
JAVA_SRC_PATTERN='^java/(cuvs-java|cuvs-lucene)/([^/]+/)?src/.*\.java$'
18+
JAVA_SRC_PATTERN='^(java|examples/java)/(cuvs-java|cuvs-lucene)/([^/]+/)?src/.*\.java$'
1919
JAVA_SRC_EXCLUDE='.*/panama/.*'
2020

2121
java_sources_modified() {
22-
git status --porcelain --untracked-files=all -- java/cuvs-java java/cuvs-lucene |
22+
git status --porcelain --untracked-files=all -- java/cuvs-java java/cuvs-lucene examples/java |
2323
cut -c4- |
2424
grep -Ev "${JAVA_SRC_EXCLUDE}" |
2525
grep -Eq "${JAVA_SRC_PATTERN}"
@@ -42,7 +42,8 @@ POMS=(
4242
java/cuvs-java/pom.xml
4343
java/cuvs-lucene/pom.xml
4444
java/cuvs-lucene/bench/pom.xml
45-
java/cuvs-lucene/examples/pom.xml
45+
examples/java/cuvs-java/pom.xml
46+
examples/java/cuvs-lucene/pom.xml
4647
)
4748

4849
for pom in "${POMS[@]}"; do

0 commit comments

Comments
 (0)