Skip to content

Commit

Permalink
Merge branch 'branch-24.10' into doc-2410-benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
cjnolet authored Oct 4, 2024
2 parents 74a540f + 5adf264 commit 87ed9d8
Show file tree
Hide file tree
Showing 119 changed files with 9,173 additions and 587 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

## Useful Resources

- [Documentation](https://docs.rapids.ai/api/cuvs/): Library documentation.
- [Documentation](https://docs.rapids.ai/api/cuvs/nightly/): Library documentation.
- [Build and Install Guide](https://docs.rapids.ai/api/cuvs/nightly/build): Instructions for installing and building cuVS.
- [Getting Started Guide](https://docs.rapids.ai/api/cuvs/nightly/getting_started): Guide to getting started with cuVS.
- [Code Examples](https://github.com/rapidsai/cuvs/tree/HEAD/examples): Self-contained Code Examples.
Expand Down
32 changes: 30 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ARGS=$*
# scripts, and that this script resides in the repo dir!
REPODIR=$(cd $(dirname $0); pwd)

VALIDARGS="clean libcuvs python rust docs tests bench-ann examples --uninstall -v -g -n --compile-static-lib --allgpuarch --no-nvtx --show_depr_warn --incl-cache-stats --time -h"
VALIDARGS="clean libcuvs python rust docs tests bench-ann examples --uninstall -v -g -n --compile-static-lib --allgpuarch --no-mg --no-cpu --cpu-only --no-shared-libs --no-nvtx --show_depr_warn --incl-cache-stats --time -h"
HELP="$0 [<target> ...] [<flag> ...] [--cmake-args=\"<args>\"] [--cache-tool=<tool>] [--limit-tests=<targets>] [--limit-bench-ann=<targets>] [--build-metrics=<filename>]
where <target> is:
clean - remove all existing build artifacts and configuration (start over)
Expand All @@ -37,10 +37,13 @@ HELP="$0 [<target> ...] [<flag> ...] [--cmake-args=\"<args>\"] [--cache-tool=<to
-n - no install step
--uninstall - uninstall files for specified targets which were built and installed prior
--compile-static-lib - compile static library for all components
--cpu-only - build CPU only components without CUDA. Currently only applies to bench-ann.
--limit-tests - semicolon-separated list of test executables to compile (e.g. NEIGHBORS_TEST;CLUSTER_TEST)
--limit-bench-ann - semicolon-separated list of ann benchmark executables to compute (e.g. HNSWLIB_ANN_BENCH;RAFT_IVF_PQ_ANN_BENCH)
--allgpuarch - build for all supported GPU architectures
--no-mg - disable multi-GPU support
--no-nvtx - disable nvtx (profiling markers), but allow enabling it in downstream projects
--no-shared-libs - build without shared libraries
--show_depr_warn - show cmake deprecation warnings
--build-metrics - filename for generating build metrics report for libcuvs
--incl-cache-stats - include cache statistics in build metrics report
Expand All @@ -65,11 +68,13 @@ CMAKE_LOG_LEVEL=""
VERBOSE_FLAG=""
BUILD_ALL_GPU_ARCH=0
BUILD_TESTS=ON
BUILD_MG_ALGOS=ON
BUILD_TYPE=Release
COMPILE_LIBRARY=OFF
INSTALL_TARGET=install
BUILD_REPORT_METRICS=""
BUILD_REPORT_INCL_CACHE_STATS=OFF
BUILD_SHARED_LIBS=ON

TEST_TARGETS="NEIGHBORS_ANN_CAGRA_TEST"
ANN_BENCH_TARGETS="CUVS_ANN_BENCH_ALL"
Expand Down Expand Up @@ -261,6 +266,10 @@ if hasArg --allgpuarch; then
BUILD_ALL_GPU_ARCH=1
fi

if hasArg --no-mg; then
BUILD_MG_ALGOS=OFF
fi

if hasArg tests || (( ${NUMARGS} == 0 )); then
BUILD_TESTS=ON
CMAKE_TARGET="${CMAKE_TARGET};${TEST_TARGETS}"
Expand All @@ -276,7 +285,20 @@ fi

if hasArg bench-ann || (( ${NUMARGS} == 0 )); then
BUILD_CUVS_BENCH=ON
if ! hasArg tests; then
BUILD_TESTS=OFF
fi
COMPILE_LIBRARY=OFF
CMAKE_TARGET="${CMAKE_TARGET};${ANN_BENCH_TARGETS}"
if hasArg --cpu-only; then
BUILD_CPU_ONLY=ON
BUILD_SHARED_LIBS=OFF
NVTX=OFF
fi
fi

if hasArg --no-shared-libs; then
BUILD_SHARED_LIBS=OFF
fi

if hasArg --no-nvtx; then
Expand Down Expand Up @@ -323,7 +345,11 @@ fi
# Configure for building all C++ targets
if (( ${NUMARGS} == 0 )) || hasArg libcuvs || hasArg docs || hasArg tests || hasArg bench-prims || hasArg bench-ann; then
COMPILE_LIBRARY=ON
CMAKE_TARGET="${CMAKE_TARGET};cuvs"
if (( ${BUILD_SHARED_LIBS} == "OFF" )); then
CMAKE_TARGET="${CMAKE_TARGET};"
else
CMAKE_TARGET="${CMAKE_TARGET};cuvs"
fi

if (( ${BUILD_ALL_GPU_ARCH} == 0 )); then
CUVS_CMAKE_CUDA_ARCHITECTURES="NATIVE"
Expand Down Expand Up @@ -353,7 +379,9 @@ if (( ${NUMARGS} == 0 )) || hasArg libcuvs || hasArg docs || hasArg tests || has
-DBUILD_C_TESTS=${BUILD_TESTS} \
-DBUILD_CUVS_BENCH=${BUILD_CUVS_BENCH} \
-DBUILD_CPU_ONLY=${BUILD_CPU_ONLY} \
-DBUILD_MG_ALGOS=${BUILD_MG_ALGOS} \
-DCMAKE_MESSAGE_LOG_LEVEL=${CMAKE_LOG_LEVEL} \
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} \
${CACHE_ARGS} \
${EXTRA_CMAKE_ARGS}

Expand Down
18 changes: 18 additions & 0 deletions ci/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,22 @@ rapids-conda-retry mambabuild \
--channel "${CPP_CHANNEL}" \
conda/recipes/cuvs

# Build cuvs_bench for each cuda and python version
rapids-conda-retry mambabuild \
--no-test \
--channel "${CPP_CHANNEL}" \
--channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \
conda/recipes/cuvs_bench

# Build cuvs_bench_cpu only in CUDA 12 jobs since it only depends on python
# version
RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}"
if [[ ${RAPIDS_CUDA_MAJOR} == "12" ]]; then
rapids-conda-retry mambabuild \
--no-test \
--channel "${CPP_CHANNEL}" \
--channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \
conda/recipes/cuvs_bench_cpu
fi

rapids-upload-conda-to-s3 python
1 change: 1 addition & 0 deletions conda/environments/all_cuda-118_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dependencies:
- libcusparse=11.7.5.86
- librmm==24.10.*,>=0.0.0a0
- make
- nccl>=2.19
- ninja
- numpy>=1.23,<3.0a0
- numpydoc
Expand Down
1 change: 1 addition & 0 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dependencies:
- libcusparse=11.7.5.86
- librmm==24.10.*,>=0.0.0a0
- make
- nccl>=2.19
- ninja
- numpy>=1.23,<3.0a0
- numpydoc
Expand Down
1 change: 1 addition & 0 deletions conda/environments/all_cuda-125_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ dependencies:
- libcusparse-dev
- librmm==24.10.*,>=0.0.0a0
- make
- nccl>=2.19
- ninja
- numpy>=1.23,<3.0a0
- numpydoc
Expand Down
1 change: 1 addition & 0 deletions conda/environments/all_cuda-125_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ dependencies:
- libcusparse-dev
- librmm==24.10.*,>=0.0.0a0
- make
- nccl>=2.19
- ninja
- numpy>=1.23,<3.0a0
- numpydoc
Expand Down
1 change: 1 addition & 0 deletions conda/environments/bench_ann_cuda-118_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dependencies:
- libcusparse=11.7.5.86
- librmm==24.10.*,>=0.0.0a0
- matplotlib
- nccl>=2.19
- ninja
- nlohmann_json>=3.11.2
- nvcc_linux-aarch64=11.8
Expand Down
1 change: 1 addition & 0 deletions conda/environments/bench_ann_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dependencies:
- libcusparse=11.7.5.86
- librmm==24.10.*,>=0.0.0a0
- matplotlib
- nccl>=2.19
- ninja
- nlohmann_json>=3.11.2
- nvcc_linux-64=11.8
Expand Down
1 change: 1 addition & 0 deletions conda/environments/bench_ann_cuda-125_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ dependencies:
- libcusparse-dev
- librmm==24.10.*,>=0.0.0a0
- matplotlib
- nccl>=2.19
- ninja
- nlohmann_json>=3.11.2
- openblas
Expand Down
1 change: 1 addition & 0 deletions conda/environments/bench_ann_cuda-125_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ dependencies:
- libcusparse-dev
- librmm==24.10.*,>=0.0.0a0
- matplotlib
- nccl>=2.19
- ninja
- nlohmann_json>=3.11.2
- openblas
Expand Down
5 changes: 5 additions & 0 deletions conda/recipes/cuvs_bench/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Copyright (c) 2024, NVIDIA CORPORATION.

./build.sh bench-ann --allgpuarch --no-nvtx --build-metrics=bench_ann --incl-cache-stats
cmake --install cpp/build --component ann_bench
70 changes: 70 additions & 0 deletions conda/recipes/cuvs_bench/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
c_compiler_version:
- 11

cxx_compiler_version:
- 11

cuda_compiler:
- cuda-nvcc

cuda11_compiler:
- nvcc

c_stdlib:
- sysroot

c_stdlib_version:
- "2.17"

cmake_version:
- ">=3.26.4,!=3.30.0"

nccl_version:
- ">=2.19"

glog_version:
- ">=0.6.0"

h5py_version:
- ">=3.8.0"

nlohmann_json_version:
- ">=3.11.2"

# The CTK libraries below are missing from the conda-forge::cudatoolkit package
# for CUDA 11. The "*_host_*" version specifiers correspond to `11.8` packages
# and the "*_run_*" version specifiers correspond to `11.x` packages.

cuda11_libcublas_host_version:
- "=11.11.3.6"

cuda11_libcublas_run_version:
- ">=11.5.2.43,<12.0.0"

cuda11_libcurand_host_version:
- "=10.3.0.86"

cuda11_libcurand_run_version:
- ">=10.2.5.43,<10.3.1"

cuda11_libcusolver_host_version:
- "=11.4.1.48"

cuda11_libcusolver_run_version:
- ">=11.2.0.43,<11.4.2"

cuda11_libcusparse_host_version:
- "=11.7.5.86"

cuda11_libcusparse_run_version:
- ">=11.6.0.43,<12.0.0"

# `cuda-profiler-api` only has `11.8.0` and `12.0.0` packages for all
# architectures. The "*_host_*" version specifiers correspond to `11.8` packages and the
# "*_run_*" version specifiers correspond to `11.x` packages.

cuda11_cuda_profiler_api_host_version:
- "=11.8.86"

cuda11_cuda_profiler_api_run_version:
- ">=11.4.240,<12"
105 changes: 105 additions & 0 deletions conda/recipes/cuvs_bench/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Copyright (c) 2024, NVIDIA CORPORATION.

# Usage:
# conda build . -c rapidsai -c conda-forge -c nvidia
{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
{% set py_version = environ['CONDA_PY'] %}
{% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %}
{% set cuda_major = cuda_version.split('.')[0] %}
{% set date_string = environ['RAPIDS_DATE_STRING'] %}

package:
name: cuvs_bench
version: {{ version }}
script: build.sh

source:
path: ../../..

build:
script_env:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_SESSION_TOKEN
- CMAKE_C_COMPILER_LAUNCHER
- CMAKE_CUDA_COMPILER_LAUNCHER
- CMAKE_CXX_COMPILER_LAUNCHER
- CMAKE_GENERATOR
- PARALLEL_LEVEL
- RAPIDS_ARTIFACTS_DIR
- SCCACHE_BUCKET
- SCCACHE_IDLE_TIMEOUT
- SCCACHE_REGION
- SCCACHE_S3_KEY_PREFIX=cuvs-bench-aarch64 # [aarch64]
- SCCACHE_S3_KEY_PREFIX=cuvs-bench-linux64 # [linux64]
- SCCACHE_S3_USE_SSL
number: {{ GIT_DESCRIBE_NUMBER }}
string: cuda{{ cuda_major }}_py{{ py_version }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
ignore_run_exports_from:
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }}
{% else %}
- {{ compiler('cuda') }}
- cuda-cudart-dev
- libcublas-dev
{% endif %}

requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }} ={{ cuda_version }}
{% else %}
- {{ compiler('cuda') }}
{% endif %}
- cuda-version ={{ cuda_version }}
- cmake {{ cmake_version }}
- ninja
- {{ stdlib("c") }}

host:
- benchmark
- cuda-version ={{ cuda_version }}
{% if cuda_major == "11" %}
- cuda-profiler-api {{ cuda11_cuda_profiler_api_run_version }}
- libcublas {{ cuda11_libcublas_host_version }}
- libcublas-dev {{ cuda11_libcublas_host_version }}
{% else %}
- cuda-cudart-dev
- cuda-profiler-api
- libcublas-dev
{% endif %}
- glog {{ glog_version }}
- libcuvs {{ version }}
- nlohmann_json {{ nlohmann_json_version }}
- openblas
# rmm is needed to determine if package is gpu-enabled
- python
- rapids-build-backend>=0.3.0,<0.4.0.dev0
- rmm ={{ minor_version }}

run:
- benchmark
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
{% if cuda_major == "11" %}
- cudatoolkit
{% else %}
- cuda-cudart
- libcublas
{% endif %}
- glog {{ glog_version }}
- libcuvs {{ version }}
- h5py {{ h5py_version }}
- matplotlib
- pandas
- pyyaml
# rmm is needed to determine if package is gpu-enabled
- pylibraft ={{ minor_version }}
- python
- rmm ={{ minor_version }}
about:
home: https://rapids.ai/
license: Apache-2.0
summary: cuVS GPU and CPU benchmarks
5 changes: 5 additions & 0 deletions conda/recipes/cuvs_bench_cpu/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
# Copyright (c) 2024, NVIDIA CORPORATION.

./build.sh bench-ann --cpu-only --no-nvtx --build-metrics=bench_ann_cpu --incl-cache-stats
cmake --install cpp/build --component ann_bench
Loading

0 comments on commit 87ed9d8

Please sign in to comment.