Skip to content
Merged
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
27 changes: 25 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,29 @@ jobs:
date: ${{ inputs.date }}
script: ci/build_cpp.sh
sha: ${{ inputs.sha }}

rocky8-clib-standalone-build:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@main
strategy:
fail-fast: false
matrix:
cuda_version:
- &latest_cuda12 '12.9.1'
- &latest_cuda13 '13.0.2'
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
arch: "amd64"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we only supporting amd64 with the C library?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have on my todo to extend the matrix to arm + x86 but that isn't a hard requirement for 25.12.

If you know how to easily extend the matrix in a custom job I would happily integrate it into this PR.
When I was looking at other yaml files it seemed complicated ( dumping to file for some reason )

Copy link
Contributor

@bdice bdice Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's defer this until later. You can just add a matrix entry here like already exists for the CUDA keys and then use ${{ matrix.arch }} in the arch: value but let's get one arch done before we expand.

date: ${{ inputs.date }}
container_image: "rapidsai/ci-wheel:25.12-cuda${{ matrix.cuda_version }}-rockylinux8-py3.10"
node_type: "cpu16"
name: "${{ matrix.cuda_version }}, amd64, rockylinux8"
# requires_license_builder: false
script: "ci/build_standalone_c.sh"
artifact-name: "libcuvs_c_${{ matrix.cuda_version }}.tar.gz"
file_to_upload: "libcuvs_c.tar.gz"
sha: ${{ inputs.sha }}
rust-build:
needs: cpp-build
secrets: inherit
Expand All @@ -51,8 +74,8 @@ jobs:
fail-fast: false
matrix:
cuda_version:
- &latest_cuda12 '12.9.1'
- &latest_cuda13 '13.0.2'
- *latest_cuda12
- *latest_cuda13
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
Expand Down
102 changes: 85 additions & 17 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ jobs:
- conda-cpp-checks
- conda-python-build
- conda-python-tests
- conda-java-tests
- docs-build
- rocky8-clib-standalone-build
- rocky8-clib-tests
- conda-java-build-and-tests
- rust-build
- go-build
- docs-build
- wheel-build-libcuvs
- wheel-build-cuvs
- wheel-tests-cuvs
Expand Down Expand Up @@ -103,6 +105,30 @@ jobs:
- '!rust/**'
- '!go/**'
- '!thirdparty/LICENSES/**'
test_rust:
- '**'
- '!.devcontainer/**'
- '!.pre-commit-config.yaml'
- '!README.md'
- '!docs/**'
- '!img/**'
- '!notebooks/**'
- '!python/**'
- '!java/**'
- '!go/**'
- '!thirdparty/LICENSES/**'
test_go:
- '**'
- '!.devcontainer/**'
- '!.pre-commit-config.yaml'
- '!README.md'
- '!docs/**'
- '!img/**'
- '!notebooks/**'
- '!python/**'
- '!java/**'
- '!rust/**'
- '!thirdparty/LICENSES/**'
checks:
needs: telemetry-setup
secrets: inherit
Expand Down Expand Up @@ -148,41 +174,72 @@ jobs:
with:
build_type: pull-request
script: ci/test_python.sh
conda-java-tests:
needs: [conda-cpp-build, changed-files]
rocky8-clib-standalone-build:
needs: [checks]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@main
if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_java
# Artifacts are not published from these jobs, so it's safe to run for multiple CUDA versions.
# If these jobs start producing artifacts, the names will have to differentiate between CUDA versions.
strategy:
fail-fast: false
matrix:
cuda_version:
- &latest_cuda12 '12.9.1'
- &latest_cuda13 '13.0.2'
with:
build_type: pull-request
arch: "amd64"
date: ${{ inputs.date }}_c
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 }}
rocky8-clib-tests:
needs: [rocky8-clib-standalone-build, changed-files]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@main
if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp
strategy:
fail-fast: false
matrix:
cuda_version:
- *latest_cuda12
- *latest_cuda13
with:
build_type: pull-request
node_type: "gpu-l4-latest-1"
arch: "amd64"
container_image: "rapidsai/ci-conda:25.12-cuda${{ matrix.cuda_version }}-ubuntu24.04-py3.13"
script: "ci/test_java.sh"
artifact-name: "cuvs-java-cuda${{ matrix.cuda_version }}"
file_to_upload: "java/cuvs-java/target/"
docs-build:
needs: conda-python-build
date: ${{ inputs.date }}_c
container_image: "rapidsai/ci-wheel:25.12-cuda${{ matrix.cuda_version }}-rockylinux8-py3.10"
script: "ci/test_standalone_c.sh"
sha: ${{ inputs.sha }}
conda-java-build-and-tests:
needs: [conda-cpp-build, changed-files]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@main
if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_java || fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp
# Artifacts are not published from these jobs, so it's safe to run for multiple CUDA versions.
# If these jobs start producing artifacts, the names will have to differentiate between CUDA versions.
strategy:
fail-fast: false
matrix:
cuda_version:
- *latest_cuda12
- *latest_cuda13
with:
build_type: pull-request
node_type: "gpu-l4-latest-1"
arch: "amd64"
container_image: "rapidsai/ci-conda:25.12-latest"
script: "ci/build_docs.sh"
container_image: "rapidsai/ci-conda:25.12-cuda${{ matrix.cuda_version }}-ubuntu24.04-py3.13"
script: "ci/test_java.sh"
artifact-name: "cuvs-java-cuda${{ matrix.cuda_version }}"
file_to_upload: "java/cuvs-java/target/"
rust-build:
needs: conda-cpp-build
needs: [conda-cpp-build, changed-files]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@main
if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_rust || fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp
# Artifacts are not published from these jobs, so it's safe to run for multiple CUDA versions.
# If these jobs start producing artifacts, the names will have to differentiate between CUDA versions.
strategy:
Expand All @@ -198,9 +255,10 @@ jobs:
container_image: "rapidsai/ci-conda:25.12-cuda${{ matrix.cuda_version }}-ubuntu24.04-py3.13"
script: "ci/build_rust.sh"
go-build:
needs: conda-cpp-build
needs: [conda-cpp-build, changed-files]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@main
if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_go || fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp
# Artifacts are not published from these jobs, so it's safe to run for multiple CUDA versions.
# If these jobs start producing artifacts, the names will have to differentiate between CUDA versions.
strategy:
Expand All @@ -215,6 +273,16 @@ jobs:
arch: "amd64"
container_image: "rapidsai/ci-conda:25.12-cuda${{ matrix.cuda_version }}-ubuntu24.04-py3.13"
script: "ci/build_go.sh"
docs-build:
needs: conda-python-build
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@main
with:
build_type: pull-request
node_type: "gpu-l4-latest-1"
arch: "amd64"
container_image: "rapidsai/ci-conda:25.12-latest"
script: "ci/build_docs.sh"
wheel-build-libcuvs:
needs: checks
secrets: inherit
Expand Down
9 changes: 9 additions & 0 deletions c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ if(BUILD_CAGRA_HNSWLIB)
include(../cpp/cmake/thirdparty/get_hnswlib.cmake)
endif()

if(BUILD_MG_ALGOS AND CUVSC_STATIC_CUVS_LIBRARY)
rapids_find_generate_module(
NCCL
HEADER_NAMES nccl.h
LIBRARY_NAMES nccl
)
find_package(NCCL REQUIRED)
endif()

# ##################################################################################################
# * cuvs_c -------------------------------------------------------------------------------
add_library(
Expand Down
5 changes: 4 additions & 1 deletion c/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ if(PROJECT_IS_TOP_LEVEL)
rapids_test_init()
endif()

rapids_cmake_install_lib_dir(lib_dir)
include(GNUInstallDirs)

include(${rapids-cmake-dir}/cpm/gtest.cmake)
rapids_cpm_gtest(BUILD_STATIC)

Expand Down Expand Up @@ -46,7 +49,7 @@ function(ConfigureTest)
set_target_properties(
${TEST_NAME}
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${CUVS_C_BINARY_DIR}/gtests>"
INSTALL_RPATH "\$ORIGIN/../../../lib"
INSTALL_RPATH "\$ORIGIN/../../../${lib_dir}"
)

target_include_directories(
Expand Down
4 changes: 3 additions & 1 deletion ci/build_java.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ if [[ "${1:-}" == "--run-java-tests" ]]; then
EXTRA_BUILD_ARGS+=("--run-java-tests")
fi

. /opt/conda/etc/profile.d/conda.sh
if [ -e "/opt/conda/etc/profile.d/conda.sh" ]; then
. /opt/conda/etc/profile.d/conda.sh
fi

rapids-logger "Downloading artifacts from previous jobs"
CPP_CHANNEL=$(rapids-download-conda-from-github cpp)
Expand Down
90 changes: 90 additions & 0 deletions ci/build_standalone_c.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0

set -euo pipefail

TOOLSET_VERSION=14
CMAKE_VERSION=3.31.8
CMAKE_ARCH=x86_64

BUILD_C_LIB_TESTS="OFF"
if [[ "${1:-}" == "--build-tests" ]]; then
BUILD_C_LIB_TESTS="ON"
fi

dnf install -y \
patch \
tar \
make

# Fetch and install CMake.
if [ ! -e "/usr/local/bin/cmake" ]; then
pushd /usr/local
wget --quiet https://github.com/Kitware/CMake/releases/download/v"${CMAKE_VERSION}"/cmake-"${CMAKE_VERSION}"-linux-"${CMAKE_ARCH}".tar.gz
tar zxf cmake-"${CMAKE_VERSION}"-linux-"${CMAKE_ARCH}".tar.gz
rm cmake-"${CMAKE_VERSION}"-linux-"${CMAKE_ARCH}".tar.gz
ln -s /usr/local/cmake-"${CMAKE_VERSION}"-linux-"${CMAKE_ARCH}"/bin/cmake /usr/local/bin/cmake
popd
fi

source rapids-configure-sccache

source rapids-date-string

rapids-print-env

rapids-logger "Begin cpp build"

sccache --zero-stats


RAPIDS_PACKAGE_VERSION=$(rapids-generate-version)
export RAPIDS_PACKAGE_VERSION

RAPIDS_ARTIFACTS_DIR=${RAPIDS_ARTIFACTS_DIR:-"${PWD}/artifacts"}
mkdir -p "${RAPIDS_ARTIFACTS_DIR}"
export RAPIDS_ARTIFACTS_DIR

scl enable gcc-toolset-${TOOLSET_VERSION} -- \
cmake -S cpp -B cpp/build/ \
-DCMAKE_CUDA_HOST_COMPILER=/opt/rh/gcc-toolset-${TOOLSET_VERSION}/root/usr/bin/gcc \
-DCMAKE_CUDA_ARCHITECTURES=RAPIDS \
-DBUILD_SHARED_LIBS=OFF \
-DCUTLASS_ENABLE_TESTS=OFF \
-DDISABLE_OPENMP=OFF \
-DBUILD_TESTS=OFF \
-DBUILD_SHARED_LIBS=ON \
-DCUVS_STATIC_RAPIDS_LIBRARIES=ON
cmake --build cpp/build "-j${PARALLEL_LEVEL}"

rapids-logger "Begin c build"

scl enable gcc-toolset-${TOOLSET_VERSION} -- \
cmake -S c -B c/build \
-DCMAKE_CUDA_HOST_COMPILER=/opt/rh/gcc-toolset-${TOOLSET_VERSION}/root/usr/bin/gcc \
-DCUVSC_STATIC_CUVS_LIBRARY=ON \
-DCMAKE_PREFIX_PATH="$PWD/cpp/build/" \
-DBUILD_TESTS=${BUILD_C_LIB_TESTS}
cmake --build c/build "-j${PARALLEL_LEVEL}"

rapids-logger "Begin c install"
cmake --install c/build --prefix c/build/install

# need to install the tests
if [ "${BUILD_C_LIB_TESTS}" != "OFF" ]; then
cmake --install c/build --prefix c/build/install --component testing
fi


rapids-logger "Begin gathering licenses"
cp LICENSE c/build/install/
if [ -e "./tool/extract_licenses_via_spdx.py" ]; then
python ./tool/extract_licenses_via_spdx.py "." --with-licenses >> c/build/install/LICENSE
fi

rapids-logger "Begin c tarball creation"
tar czf libcuvs_c.tar.gz -C c/build/install/ .
ls -lh libcuvs_c.tar.gz

sccache --show-adv-stats
37 changes: 37 additions & 0 deletions ci/test_standalone_c.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0

set -euo pipefail

CMAKE_VERSION=4.1.2
CMAKE_ARCH=x86_64

# Fetch and install CMake.
if [ ! -e "/usr/local/bin/cmake" ]; then
pushd /usr/local
wget --quiet https://github.com/Kitware/CMake/releases/download/v"${CMAKE_VERSION}"/cmake-"${CMAKE_VERSION}"-linux-"${CMAKE_ARCH}".tar.gz
tar zxf cmake-"${CMAKE_VERSION}"-linux-"${CMAKE_ARCH}".tar.gz
rm cmake-"${CMAKE_VERSION}"-linux-"${CMAKE_ARCH}".tar.gz
ln -s /usr/local/cmake-"${CMAKE_VERSION}"-linux-"${CMAKE_ARCH}"/bin/cmake /usr/local/bin/cmake
popd
fi

# Download the standalone C library artifact
payload_name="libcuvs_c_${RAPIDS_CUDA_VERSION}.tar.gz"
pkg_name="libcuvs_c.tar.gz"
rapids-logger "Download ${payload_name} artifacts from previous jobs"
DOWNLOAD_LOCATION=$(rapids-download-from-github "${payload_name}")

# Extract the artifact to a staging directory
INSTALL_PREFIX="${PWD}/libcuvs_c_install"
mkdir -p "${INSTALL_PREFIX}"
ls -l "${DOWNLOAD_LOCATION}"
tar -xf "${DOWNLOAD_LOCATION}/${pkg_name}" -C "${INSTALL_PREFIX}"

rapids-logger "Run C API tests"
ls -l "${INSTALL_PREFIX}"
cd "$INSTALL_PREFIX"/bin/gtests/libcuvs
ctest -j8 --output-on-failure

rapids-logger "C API tests completed successfully"
6 changes: 3 additions & 3 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -689,10 +689,10 @@ SECTIONS
PUBLIC rmm::rmm
raft::raft
${CUVS_CTK_MATH_DEPENDENCIES}
$<BUILD_LOCAL_INTERFACE:$<TARGET_NAME_IF_EXISTS:NCCL::NCCL>>
$<BUILD_LOCAL_INTERFACE:$<TARGET_NAME_IF_EXISTS:hnswlib::hnswlib>>
$<$<BOOL:${CUVS_NVTX}>:CUDA::nvtx3>
$<TARGET_NAME_IF_EXISTS:NCCL::NCCL> # needs to be public for DT_NEEDED
$<BUILD_LOCAL_INTERFACE:$<TARGET_NAME_IF_EXISTS:hnswlib::hnswlib>> # header only
PRIVATE nvidia::cutlass::cutlass $<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_CXX>
$<$<BOOL:${CUVS_NVTX}>:CUDA::nvtx3>
)
endif()

Expand Down