Skip to content

Commit 2ba3e43

Browse files
authored
Merge branch 'main' into c_abi_checker
2 parents 365f83a + d6b4d71 commit 2ba3e43

145 files changed

Lines changed: 8581 additions & 653 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/build.yaml‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ jobs:
4343
node_type: cpu16
4444
script: ci/build_cpp.sh
4545
sha: ${{ inputs.sha }}
46-
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
4746

4847
rocky8-clib-standalone-build:
4948
secrets: inherit
@@ -69,7 +68,6 @@ jobs:
6968
artifact-name: "libcuvs_c_${{ matrix.cuda_version }}_${{ matrix.arch }}.tar.gz"
7069
file_to_upload: "libcuvs_c.tar.gz"
7170
sha: ${{ inputs.sha }}
72-
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
7371
rust-build:
7472
needs: cpp-build
7573
secrets: inherit
@@ -91,7 +89,6 @@ jobs:
9189
node_type: "gpu-l4-latest-1"
9290
script: "ci/build_rust.sh"
9391
sha: ${{ inputs.sha }}
94-
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
9592
go-build:
9693
needs: cpp-build
9794
secrets: inherit
@@ -135,7 +132,6 @@ jobs:
135132
artifact-name: "cuvs-java-cuda${{ matrix.cuda_version }}"
136133
file_to_upload: "java/cuvs-java/target/"
137134
sha: ${{ inputs.sha }}
138-
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
139135
python-build:
140136
needs: [cpp-build]
141137
secrets: inherit
@@ -146,7 +142,8 @@ jobs:
146142
date: ${{ inputs.date }}
147143
script: ci/build_python.sh
148144
sha: ${{ inputs.sha }}
149-
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
145+
# Build a conda package for each CUDA x ARCH x minimum supported Python version
146+
matrix_filter: group_by({CUDA_VER, ARCH}) | map(min_by(.PY_VER | split(".") | map(tonumber)))
150147
upload-conda:
151148
needs: [cpp-build, python-build]
152149
secrets: inherit
@@ -189,7 +186,6 @@ jobs:
189186
matrix_filter: group_by([.ARCH, (.CUDA_VER|split(".")|map(tonumber)|.[0])]) | map(max_by(.PY_VER|split(".")|map(tonumber)))
190187
package-name: libcuvs
191188
package-type: cpp
192-
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
193189
wheel-publish-libcuvs:
194190
needs: wheel-build-libcuvs
195191
secrets: inherit
@@ -213,8 +209,9 @@ jobs:
213209
node_type: cpu8
214210
script: ci/build_wheel_cuvs.sh
215211
package-name: cuvs
216-
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
217212
package-type: python
213+
# Build a wheel for each CUDA x ARCH x minimum supported Python version
214+
matrix_filter: group_by({CUDA_VER, ARCH}) | map(min_by(.PY_VER | split(".") | map(tonumber)))
218215
wheel-publish-cuvs:
219216
needs: wheel-build-cuvs
220217
secrets: inherit
@@ -226,3 +223,4 @@ jobs:
226223
date: ${{ inputs.date }}
227224
package-name: cuvs
228225
package-type: python
226+
publish-wheel-search-key: cuvs_wheel_python_abi3

‎.github/workflows/pr.yaml‎

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,22 @@ jobs:
4444
if: ${{ vars.TELEMETRY_ENABLED == 'true' }}
4545
uses: rapidsai/shared-actions/telemetry-dispatch-stash-base-env-vars@main
4646
check-nightly-ci:
47-
needs: telemetry-setup
4847
runs-on: ubuntu-latest
48+
permissions:
49+
actions: read
50+
id-token: write
4951
env:
50-
RAPIDS_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
GH_TOKEN: ${{ github.token }}
5153
steps:
54+
- name: Get PR Info
55+
id: get-pr-info
56+
uses: nv-gha-runners/get-pr-info@main
5257
- name: Check if nightly CI is passing
5358
uses: rapidsai/shared-actions/check_nightly_success/dispatch@main
5459
with:
55-
repo: cuvs
56-
max_days_without_success: 30
60+
repo: ${{ github.repository }}
61+
target-branch: ${{ fromJSON(steps.get-pr-info.outputs.pr-info).base.ref }}
62+
max-days-without-success: 30
5763
changed-files:
5864
needs: telemetry-setup
5965
secrets: inherit
@@ -321,7 +327,6 @@ jobs:
321327
build_type: pull-request
322328
node_type: cpu16
323329
script: ci/build_cpp.sh
324-
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
325330
conda-cpp-tests:
326331
needs: [conda-cpp-build, changed-files]
327332
secrets: inherit
@@ -330,7 +335,6 @@ jobs:
330335
with:
331336
build_type: pull-request
332337
script: ci/test_cpp.sh
333-
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
334338
conda-cpp-checks:
335339
needs: conda-cpp-build
336340
secrets: inherit
@@ -345,6 +349,8 @@ jobs:
345349
with:
346350
build_type: pull-request
347351
script: ci/build_python.sh
352+
# Build a conda package for each CUDA x ARCH x minimum supported Python version
353+
matrix_filter: group_by({CUDA_VER, ARCH}) | map(min_by(.PY_VER | split(".") | map(tonumber)))
348354
conda-python-tests:
349355
needs: [conda-python-build, changed-files]
350356
secrets: inherit
@@ -353,7 +359,6 @@ jobs:
353359
with:
354360
build_type: pull-request
355361
script: ci/test_python.sh
356-
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
357362
rocky8-clib-standalone-build:
358363
needs: [checks]
359364
secrets: inherit
@@ -378,7 +383,6 @@ jobs:
378383
artifact-name: "libcuvs_c_${{ matrix.cuda_version }}_${{ matrix.arch }}.tar.gz"
379384
file_to_upload: "libcuvs_c.tar.gz"
380385
sha: ${{ inputs.sha }}
381-
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
382386
rocky8-clib-tests:
383387
needs: [rocky8-clib-standalone-build, changed-files]
384388
secrets: inherit
@@ -422,7 +426,6 @@ jobs:
422426
script: "ci/test_java.sh"
423427
artifact-name: "cuvs-java-cuda${{ matrix.cuda_version }}"
424428
file_to_upload: "java/cuvs-java/target/"
425-
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
426429
rust-build:
427430
needs: [conda-cpp-build, changed-files]
428431
secrets: inherit
@@ -442,7 +445,6 @@ jobs:
442445
arch: "amd64"
443446
container_image: "rapidsai/ci-conda:26.04-cuda${{ matrix.cuda_version }}-ubuntu24.04-py3.13"
444447
script: "ci/build_rust.sh"
445-
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
446448
go-build:
447449
needs: [conda-cpp-build, changed-files]
448450
secrets: inherit
@@ -484,7 +486,6 @@ jobs:
484486
matrix_filter: group_by([.ARCH, (.CUDA_VER|split(".")|map(tonumber)|.[0])]) | map(max_by(.PY_VER|split(".")|map(tonumber)))
485487
package-name: libcuvs
486488
package-type: cpp
487-
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
488489
wheel-build-cuvs:
489490
needs: wheel-build-libcuvs
490491
secrets: inherit
@@ -495,7 +496,8 @@ jobs:
495496
script: ci/build_wheel_cuvs.sh
496497
package-name: cuvs
497498
package-type: python
498-
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
499+
# Build a wheel for each CUDA x ARCH x minimum supported Python version
500+
matrix_filter: group_by({CUDA_VER, ARCH}) | map(min_by(.PY_VER | split(".") | map(tonumber)))
499501
wheel-tests-cuvs:
500502
needs: [wheel-build-cuvs, changed-files]
501503
secrets: inherit
@@ -504,7 +506,6 @@ jobs:
504506
with:
505507
build_type: pull-request
506508
script: ci/test_wheel_cuvs.sh
507-
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
508509
devcontainer:
509510
secrets: inherit
510511
needs: telemetry-setup
@@ -513,12 +514,10 @@ jobs:
513514
arch: '["amd64", "arm64"]'
514515
cuda: '["13.1"]'
515516
node_type: "cpu8"
516-
rapids-aux-secret-1: GIST_REPO_READ_ORG_GITHUB_TOKEN
517517
env: |
518518
SCCACHE_DIST_MAX_RETRIES=inf
519519
SCCACHE_SERVER_LOG=sccache=debug
520520
SCCACHE_DIST_FALLBACK_TO_LOCAL_COMPILE=false
521-
SCCACHE_DIST_AUTH_TOKEN_VAR=RAPIDS_AUX_SECRET_1
522521
build_command: |
523522
sccache --zero-stats;
524523
build-all -j0 --verbose 2>&1 | tee telemetry-artifacts/build.log;

‎.github/workflows/test.yaml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ jobs:
4141
date: ${{ inputs.date }}
4242
script: ci/test_cpp.sh
4343
sha: ${{ inputs.sha }}
44-
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
4544
conda-python-tests:
4645
secrets: inherit
4746
uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@main
@@ -51,7 +50,6 @@ jobs:
5150
date: ${{ inputs.date }}
5251
script: ci/test_python.sh
5352
sha: ${{ inputs.sha }}
54-
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
5553
conda-java-tests:
5654
secrets: inherit
5755
uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@main
@@ -72,7 +70,6 @@ jobs:
7270
arch: "amd64"
7371
container_image: "rapidsai/ci-conda:26.04-cuda${{ matrix.cuda_version }}-ubuntu24.04-py3.13"
7472
script: "ci/test_java.sh"
75-
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
7673
wheel-tests-cuvs:
7774
secrets: inherit
7875
uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@main
@@ -82,4 +79,3 @@ jobs:
8279
date: ${{ inputs.date }}
8380
sha: ${{ inputs.sha }}
8481
script: ci/test_wheel_cuvs.sh
85-
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN

‎.pre-commit-config.yaml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ repos:
2525
args: [--fix]
2626
- id: ruff-format
2727
- repo: https://github.com/pre-commit/mirrors-mypy
28-
rev: 'v0.971'
28+
rev: 'v1.19.1'
2929
hooks:
3030
- id: mypy
3131
additional_dependencies: [types-cachetools]
3232
args: ["--config-file=pyproject.toml",
33-
"python/cuvs/cuvs"]
33+
"python/cuvs/cuvs",
34+
"cpp/cmake/modules",
35+
"cpp/tests/python"]
3436
pass_filenames: false
3537
- repo: https://github.com/PyCQA/pydocstyle
3638
rev: 6.1.1

‎build.sh‎

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ function gpuArch {
224224

225225
# Check for gpu-arch option
226226
if [[ -n $(echo "$ARGS" | { grep -E "\-\-gpu\-arch" || true; } ) ]]; then
227-
GPU_ARCH_ARG=$(echo "$ARGS" | { grep -Eo "\-\-gpu\-arch=.+( |$)" || true; })
227+
GPU_ARCH_ARG=$(echo "$ARGS" | { grep -Eo "\-\-gpu\-arch=[^ ]+" || true; })
228228
if [[ -n ${GPU_ARCH_ARG} ]]; then
229229
# Remove the full argument from ARGS
230230
ARGS=${ARGS//$GPU_ARCH_ARG/}
@@ -371,10 +371,13 @@ fi
371371

372372
################################################################################
373373
# Configure for building all C++ targets
374-
if (( NUMARGS == 0 )) || hasArg libcuvs || hasArg docs || hasArg tests || hasArg bench-prims || hasArg bench-ann; then
374+
if (( NUMARGS == 0 )) || hasArg libcuvs || hasArg docs || hasArg tests || hasArg bench-prims || hasArg bench-ann || hasArg examples; then
375375
COMPILE_LIBRARY=ON
376376
if [[ "${BUILD_SHARED_LIBS}" != "OFF" ]]; then
377377
CMAKE_TARGET+=("cuvs")
378+
if hasArg examples; then
379+
CMAKE_TARGET+=("cuvs_c")
380+
fi
378381
fi
379382

380383
# get the current count before the compile starts
@@ -469,16 +472,33 @@ if (( NUMARGS == 0 )) || hasArg libcuvs || hasArg docs || hasArg tests || hasArg
469472
fi
470473
fi
471474

475+
476+
PYTHON_ARGS_FOR_INSTALL=(
477+
"-v"
478+
"--no-build-isolation"
479+
"--no-deps"
480+
"--config-settings"
481+
"rapidsai.disable-cuda=true"
482+
)
483+
484+
# If `RAPIDS_PY_VERSION` is set, use that as the lower-bound for the stable ABI CPython version
485+
if [ -n "${RAPIDS_PY_VERSION:-}" ]; then
486+
RAPIDS_PY_API="cp${RAPIDS_PY_VERSION//./}"
487+
PYTHON_ARGS_FOR_INSTALL+=("--config-settings" "skbuild.wheel.py-api=${RAPIDS_PY_API}")
488+
fi
489+
472490
# Build and (optionally) install the cuvs Python package
473491
if (( NUMARGS == 0 )) || hasArg python; then
474492
SKBUILD_CMAKE_ARGS="${EXTRA_CMAKE_ARGS[*]}" \
475493
SKBUILD_BUILD_OPTIONS="-j${PARALLEL_LEVEL}" \
476-
python -m pip install --no-build-isolation --no-deps --config-settings rapidsai.disable-cuda=true "${REPODIR}"/python/cuvs
494+
python -m pip install \
495+
"${PYTHON_ARGS_FOR_INSTALL[@]}" "${REPODIR}"/python/cuvs
477496
fi
478497

479498
# Build and (optionally) install the cuvs-bench Python package
480499
if (( NUMARGS == 0 )) || (hasArg bench-ann && ! hasArg -n); then
481-
python -m pip install --no-build-isolation --no-deps --config-settings rapidsai.disable-cuda=true "${REPODIR}"/python/cuvs_bench
500+
python -m pip install \
501+
"${PYTHON_ARGS_FOR_INSTALL[@]}" "${REPODIR}"/python/cuvs_bench
482502
fi
483503

484504
# Build the cuvs Rust bindings

‎c/src/neighbors/hnsw.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ extern "C" cuvsError_t cuvsHnswAceParamsDestroy(cuvsHnswAceParams_t params)
169169
extern "C" cuvsError_t cuvsHnswIndexParamsCreate(cuvsHnswIndexParams_t* params)
170170
{
171171
return cuvs::core::translate_exceptions([=] {
172-
*params = new cuvsHnswIndexParams{.hierarchy = cuvsHnswHierarchy::NONE,
172+
*params = new cuvsHnswIndexParams{.hierarchy = cuvsHnswHierarchy::GPU,
173173
.ef_construction = 200,
174174
.num_threads = 0,
175175
.M = 32,

‎c/tests/neighbors/ann_hnsw_c.cu‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ TEST(CagraHnswC, BuildSearch)
102102
hnsw_index->dtype = index->dtype;
103103
cuvsHnswIndexParams_t hnsw_params;
104104
cuvsHnswIndexParamsCreate(&hnsw_params);
105+
// Use NONE hierarchy since cuvsCagraSerializeToHnswlib creates a base-layer-only index
106+
hnsw_params->hierarchy = NONE;
105107
cuvsHnswDeserialize(res, hnsw_params, "/tmp/cagra_hnswlib.index", 2, L2Expanded, hnsw_index);
106108

107109
// search index

‎ci/build_docs.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/bin/bash
2-
# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION.
2+
# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION.
33
# SPDX-License-Identifier: Apache-2.0
44

55
set -euo pipefail
66

77
rapids-logger "Downloading artifacts from previous jobs"
88
CPP_CHANNEL=$(rapids-download-conda-from-github cpp)
9-
PYTHON_CHANNEL=$(rapids-download-conda-from-github python)
9+
PYTHON_CHANNEL=$(rapids-download-from-github "$(rapids-package-name "conda_python" cuvs --stable --cuda "$RAPIDS_CUDA_VERSION")")
1010

1111
rapids-logger "Create test conda environment"
1212
. /opt/conda/etc/profile.d/conda.sh

‎ci/build_python.sh‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION.
2+
# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION.
33
# SPDX-License-Identifier: Apache-2.0
44

55
set -euo pipefail
@@ -58,3 +58,6 @@ if [[ ${RAPIDS_CUDA_MAJOR} == "13" ]]; then
5858
sccache --show-adv-stats
5959
sccache --stop-server >/dev/null 2>&1 || true
6060
fi
61+
62+
RAPIDS_PACKAGE_NAME="$(rapids-package-name conda_python cuvs --stable --cuda "$RAPIDS_CUDA_VERSION")"
63+
export RAPIDS_PACKAGE_NAME

‎ci/build_wheel.sh‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ set -euo pipefail
66

77
package_name=$1
88
package_dir=$2
9+
shift 2
10+
11+
# Parse optional flags
12+
stable_abi=false
13+
while [[ $# -gt 0 ]]; do
14+
case "$1" in
15+
--stable)
16+
stable_abi=true
17+
shift
18+
;;
19+
*)
20+
echo "Unknown option: $1" >&2
21+
exit 1
22+
;;
23+
esac
24+
done
925

1026
source rapids-configure-sccache
1127
source rapids-date-string
@@ -53,6 +69,12 @@ RAPIDS_PIP_WHEEL_ARGS=(
5369
--no-deps
5470
--disable-pip-version-check
5571
)
72+
73+
# Add py-api setting for stable ABI builds
74+
if [[ "${stable_abi}" == "true" ]] && [[ -n "${RAPIDS_PY_API:-}" ]]; then
75+
RAPIDS_PIP_WHEEL_ARGS+=(--config-settings="skbuild.wheel.py-api=${RAPIDS_PY_API}")
76+
fi
77+
5678
# Only use --build-constraint when build isolation is enabled.
5779
#
5880
# Passing '--build-constraint' and '--no-build-isolation` together results in an error from 'pip',

0 commit comments

Comments
 (0)