Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

# syntax=docker/dockerfile:1.5

ARG BASE
Expand Down Expand Up @@ -42,6 +45,7 @@ ENV HISTFILE="/home/coder/.cache/._bash_history"
ENV AWS_ROLE_ARN="arn:aws:iam::279114543810:role/nv-gha-token-sccache-devs"
ENV SCCACHE_REGION="us-east-2"
ENV SCCACHE_BUCKET="rapids-sccache-devs"
ENV SCCACHE_S3_USE_PREPROCESSOR_CACHE_MODE=true
ENV SCCACHE_IDLE_TIMEOUT=0

###
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ jobs:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
node_type: cpu16
script: ci/build_cpp.sh
sha: ${{ inputs.sha }}
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN

rocky8-clib-standalone-build:
secrets: inherit
Expand All @@ -63,6 +65,7 @@ jobs:
artifact-name: "libcuvs_c_${{ matrix.cuda_version }}.tar.gz"
file_to_upload: "libcuvs_c.tar.gz"
sha: ${{ inputs.sha }}
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
rust-build:
needs: cpp-build
secrets: inherit
Expand All @@ -84,6 +87,7 @@ jobs:
node_type: "gpu-l4-latest-1"
script: "ci/build_rust.sh"
sha: ${{ inputs.sha }}
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
go-build:
needs: cpp-build
secrets: inherit
Expand Down Expand Up @@ -127,6 +131,7 @@ jobs:
artifact-name: "cuvs-java-cuda${{ matrix.cuda_version }}"
file_to_upload: "java/cuvs-java/target/"
sha: ${{ inputs.sha }}
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
python-build:
needs: [cpp-build]
secrets: inherit
Expand All @@ -137,6 +142,7 @@ jobs:
date: ${{ inputs.date }}
script: ci/build_python.sh
sha: ${{ inputs.sha }}
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
upload-conda:
needs: [cpp-build, python-build]
secrets: inherit
Expand Down Expand Up @@ -173,11 +179,13 @@ jobs:
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
node_type: cpu16
script: ci/build_wheel_libcuvs.sh
# build for every combination of arch and CUDA version, but only for the latest Python
matrix_filter: group_by([.ARCH, (.CUDA_VER|split(".")|map(tonumber)|.[0])]) | map(max_by(.PY_VER|split(".")|map(tonumber)))
package-name: libcuvs
package-type: cpp
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
wheel-publish-libcuvs:
needs: wheel-build-libcuvs
secrets: inherit
Expand All @@ -198,8 +206,10 @@ jobs:
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
node_type: cpu8
script: ci/build_wheel_cuvs.sh
package-name: cuvs
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
package-type: python
wheel-publish-cuvs:
needs: wheel-build-cuvs
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ jobs:
build_type: pull-request
node_type: cpu16
script: ci/build_cpp.sh
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
conda-cpp-tests:
needs: [conda-cpp-build, changed-files]
secrets: inherit
Expand All @@ -152,6 +153,7 @@ jobs:
with:
build_type: pull-request
script: ci/test_cpp.sh
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
conda-cpp-checks:
needs: conda-cpp-build
secrets: inherit
Expand All @@ -174,6 +176,7 @@ jobs:
with:
build_type: pull-request
script: ci/test_python.sh
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
rocky8-clib-standalone-build:
needs: [checks]
secrets: inherit
Expand All @@ -187,14 +190,15 @@ jobs:
with:
build_type: pull-request
arch: "amd64"
date: ${{ inputs.date }}_c
date: ${{ inputs.date }}
container_image: "rapidsai/ci-wheel:25.12-cuda${{ matrix.cuda_version }}-rockylinux8-py3.10"
node_type: "cpu16"
# requires_license_builder: false
script: "ci/build_standalone_c.sh --build-tests"
artifact-name: "libcuvs_c_${{ matrix.cuda_version }}.tar.gz"
file_to_upload: "libcuvs_c.tar.gz"
sha: ${{ inputs.sha }}
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
rocky8-clib-tests:
needs: [rocky8-clib-standalone-build, changed-files]
secrets: inherit
Expand All @@ -210,7 +214,7 @@ jobs:
build_type: pull-request
node_type: "gpu-l4-latest-1"
arch: "amd64"
date: ${{ inputs.date }}_c
date: ${{ inputs.date }}
container_image: "rapidsai/ci-wheel:25.12-cuda${{ matrix.cuda_version }}-rockylinux8-py3.10"
script: "ci/test_standalone_c.sh"
sha: ${{ inputs.sha }}
Expand All @@ -235,6 +239,7 @@ jobs:
script: "ci/test_java.sh"
artifact-name: "cuvs-java-cuda${{ matrix.cuda_version }}"
file_to_upload: "java/cuvs-java/target/"
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
rust-build:
needs: [conda-cpp-build, changed-files]
secrets: inherit
Expand All @@ -254,6 +259,7 @@ jobs:
arch: "amd64"
container_image: "rapidsai/ci-conda:25.12-cuda${{ matrix.cuda_version }}-ubuntu24.04-py3.13"
script: "ci/build_rust.sh"
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
go-build:
needs: [conda-cpp-build, changed-files]
secrets: inherit
Expand Down Expand Up @@ -289,20 +295,24 @@ jobs:
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@release/25.12
with:
build_type: pull-request
node_type: cpu16
script: ci/build_wheel_libcuvs.sh
# build for every combination of arch and CUDA version, but only for the latest Python
matrix_filter: group_by([.ARCH, (.CUDA_VER|split(".")|map(tonumber)|.[0])]) | map(max_by(.PY_VER|split(".")|map(tonumber)))
package-name: libcuvs
package-type: cpp
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
wheel-build-cuvs:
needs: wheel-build-libcuvs
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@release/25.12
with:
build_type: pull-request
node_type: cpu8
script: ci/build_wheel_cuvs.sh
package-name: cuvs
package-type: python
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
wheel-tests-cuvs:
needs: [wheel-build-cuvs, changed-files]
secrets: inherit
Expand All @@ -311,6 +321,7 @@ jobs:
with:
build_type: pull-request
script: ci/test_wheel_cuvs.sh
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
devcontainer:
secrets: inherit
needs: telemetry-setup
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
date: ${{ inputs.date }}
script: ci/test_cpp.sh
sha: ${{ inputs.sha }}
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
conda-python-tests:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@release/25.12
Expand All @@ -50,6 +51,7 @@ jobs:
date: ${{ inputs.date }}
script: ci/test_python.sh
sha: ${{ inputs.sha }}
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
conda-java-tests:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@release/25.12
Expand All @@ -70,6 +72,7 @@ jobs:
arch: "amd64"
container_image: "rapidsai/ci-conda:25.12-cuda${{ matrix.cuda_version }}-ubuntu24.04-py3.13"
script: "ci/test_java.sh"
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
wheel-tests-cuvs:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@release/25.12
Expand All @@ -79,3 +82,4 @@ jobs:
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
script: ci/test_wheel_cuvs.sh
sccache-dist-token-secret-name: GIST_REPO_READ_ORG_GITHUB_TOKEN
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# <div align="left"><img src="https://rapids.ai/assets/images/rapids_logo.png" width="90px"/>&nbsp;cuVS: Vector Search and Clustering on the GPU</div>

> [!note]
> cuVS is a new library mostly derived from the approximate nearest neighbors and clustering algorithms in the [RAPIDS RAFT](https://github.com/rapidsai/raft) library of machine learning and data mining primitives. As of version 24.10 (Release in October 2024), cuVS contains the most fully-featured versions of the approximate nearest neighbors and clustering algorithms from RAFT. The algorithms which have been migrated over to cuVS will be removed from RAFT in version 24.12 (released in December 2024).

## Contents

Expand Down Expand Up @@ -67,7 +65,7 @@ There are several benefits to using cuVS and GPUs for vector search, including
6. Multiple language support
7. Building blocks for composing new or accelerating existing algorithms

In addition to the items above, cuVS takes on the burden of keeping non-trivial accelerated code up to date as new NVIDIA architectures and CUDA versions are released. This provides a delightful development experience, guaranteeing that any libraries, databases, or applications built on top of it will always be getting the best performance and scale.
In addition to the items above, cuVS shoulders the burden of keeping non-trivial accelerated code up to date as new NVIDIA architectures and CUDA versions are released. This provides a delightful development experience, guaranteeing that any libraries, databases, or applications built on top of it will always be getting the best performance and scale.

## cuVS Technology Stack

Expand All @@ -93,7 +91,7 @@ It is recommended to use [mamba](https://conda.github.io/conda-libmamba-solver/u
conda install -c rapidsai -c conda-forge cuvs
```

The cuVS Python package can also be `installed through pip <https://docs.rapids.ai/install#pip>`_.
The cuVS Python package can also be installed through [pip](https://docs.rapids.ai/install#pip>).

```bash
# CUDA 13
Expand All @@ -114,7 +112,10 @@ conda install -c rapidsai-nightly -c conda-forge cuvs=25.12 cuda-version=13.0
conda install -c rapidsai-nightly -c conda-forge cuvs=25.12 cuda-version=12.9
```

cuVS also has `pip` wheel packages that can be installed. Please see the [Build and Install Guide](https://docs.rapids.ai/api/cuvs/nightly/build/) for more information on installing the available cuVS packages and building from source.
> [!NOTE]
> If compiled binary size is a concern, please note that the cuVS builds for CUDA 13 are roughly half the size of CUDA 12 builds. This is a result of improved compression rates in the newer supported CUDA drivers. We will be adopting the newer drivers for CUDA 12 builds in Spring of 2026, which will ultimately bring them down to roughly the size of the CUDA 13 builds. In the meantime, the NVIDIA cuVS team is continuing to shave down the binary sizes for all supported CUDA versions. If binary size is an issue for you, please consider linking to cuVS statically either by building from source or using pre-built `libcuvs-static` conda package.

Please see the [Build and Install Guide](https://docs.rapids.ai/api/cuvs/nightly/build/) for more information on installing the available cuVS packages and building from source.

## Getting Started

Expand Down
35 changes: 14 additions & 21 deletions c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ option(CUVSC_STATIC_CUVS_LIBRARY "Link against statical version of libcuvs" OFF)
# Check if cuVS is already available. If so, it is the user's responsibility to ensure that the
# CMake package is also available at build time of the Python cuvs package.
if(NOT TARGET cuvs::cuvs)
find_package(cuvs "${RAPIDS_VERSION}" REQUIRED)
if(CUVSC_STATIC_CUVS_LIBRARY)
find_package(cuvs "${RAPIDS_VERSION}" REQUIRED COMPONENTS cuvs_static)
else()
find_package(cuvs "${RAPIDS_VERSION}" REQUIRED COMPONENTS cuvs_shared)
endif()
else()
set(BUILDING_FROM_CUVS ON)
endif()
Expand Down Expand Up @@ -167,40 +171,29 @@ if(PROJECT_IS_TOP_LEVEL)
include(CPack)

# Add CUDAToolkit as an export dependency
rapids_export_package(INSTALL CUDAToolkit cuvs-c-exports)
rapids_export_package(BUILD CUDAToolkit cuvs-c-exports)
rapids_export_package(INSTALL CUDAToolkit cuvs-exports)
rapids_export_package(BUILD CUDAToolkit cuvs-exports)

install(
TARGETS cuvs_c
DESTINATION ${lib_dir}
COMPONENT cuvs_c
COMPONENT c_api
EXPORT cuvs-c-exports
)

rapids_export(
INSTALL cuvs_c
VERSION "${RAPIDS_VERSION}"
EXPORT_SET cuvs-c-exports
GLOBAL_TARGETS cuvs_c
NAMESPACE cuvs::
)
rapids_export(
BUILD cuvs_c
VERSION "${RAPIDS_VERSION}"
EXPORT_SET cuvs-c-exports
GLOBAL_TARGETS cuvs_c
NAMESPACE cuvs::
)
install(
DIRECTORY include/cuvs
COMPONENT cuvs_c
COMPONENT c_api
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/include/cuvs/core/c_config.h
COMPONENT cuvs_c
COMPONENT c_api
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/cuvs/core/
)

include(../cpp/cmake/modules/generate_cuvs_export.cmake)
generate_cuvs_export(CLIB COMPONENTS c_api EXPORT_SETS cuvs-c-exports)

endif()

# ##################################################################################################
Expand Down
5 changes: 2 additions & 3 deletions ci/build_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
set -euo pipefail

source rapids-configure-sccache

source rapids-date-string

export CMAKE_GENERATOR=Ninja
Expand All @@ -14,8 +13,7 @@ rapids-print-env

rapids-logger "Begin cpp build"

sccache --zero-stats

sccache --stop-server 2>/dev/null || true

RAPIDS_PACKAGE_VERSION=$(rapids-generate-version)
export RAPIDS_PACKAGE_VERSION
Expand All @@ -35,6 +33,7 @@ rattler-build build --recipe conda/recipes/libcuvs \
"${RATTLER_CHANNELS[@]}"

sccache --show-adv-stats
sccache --stop-server >/dev/null 2>&1 || true

# remove build_cache directory
rm -rf "$RAPIDS_CONDA_BLD_OUTPUT_DIR"/build_cache
9 changes: 9 additions & 0 deletions ci/build_java.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

set -euo pipefail

source rapids-configure-sccache

export SCCACHE_S3_KEY_PREFIX="cuvs-java/${RAPIDS_CONDA_ARCH}/cuda${RAPIDS_CUDA_VERSION%%.*}/maven/objects-cache"
export SCCACHE_S3_PREPROCESSOR_CACHE_KEY_PREFIX="cuvs-java/${RAPIDS_CONDA_ARCH}/cuda${RAPIDS_CUDA_VERSION%%.*}/maven/preprocessor-cache"
export SCCACHE_S3_USE_PREPROCESSOR_CACHE_MODE=true

# TODO: Remove this argument-handling when build and test workflows are separated,
# and test_java.sh no longer calls build_java.sh
# ref: https://github.com/rapidsai/cuvs/issues/868
Expand Down Expand Up @@ -49,5 +55,8 @@ export RAPIDS_CUDA_MAJOR

bash ./build.sh java "${EXTRA_BUILD_ARGS[@]}"

sccache --show-adv-stats
sccache --stop-server >/dev/null 2>&1 || true

rapids-logger "Test script exiting with value: $EXITCODE"
exit ${EXITCODE}
Loading