Skip to content

Commit

Permalink
Merge branch 'docs_2404-api_docs' of github.com:rapidsai/cuvs into do…
Browse files Browse the repository at this point in the history
…cs_2404-api_docs
  • Loading branch information
cjnolet committed Mar 8, 2024
2 parents 358df75 + f8c1015 commit e6bff2b
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 63 deletions.
52 changes: 8 additions & 44 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ HELP="$0 [<target> ...] [<flag> ...] [--cmake-args=\"<args>\"] [--cache-tool=<to
Results can be interpreted with cpp/scripts/analyze_nvcc_log.py
-h - print this text
default action (no args) is to build libcuvs, tests, cuvs and cuvs-dask targets
default action (no args) is to build libcuvs, tests and cuvs targets
"
LIBCUVS_BUILD_DIR=${LIBCUVS_BUILD_DIR:=${REPODIR}/cpp/build}
SPHINX_BUILD_DIR=${REPODIR}/docs
DOXYGEN_BUILD_DIR=${REPODIR}/cpp/doxygen
PYTHON_BUILD_DIR=${REPODIR}/python/cuvs/_skbuild
BUILD_DIRS="${LIBCUVS_BUILD_DIR} ${PYTHON_BUILD_DIR} ${CUVS_DASK_BUILD_DIR}"
BUILD_DIRS="${LIBCUVS_BUILD_DIR} ${PYTHON_BUILD_DIR}"

# Set defaults for vars modified by flags to this script
CMAKE_LOG_LEVEL=""
Expand Down Expand Up @@ -218,28 +218,6 @@ if hasArg --uninstall; then
echo "Could not uninstall cuvs from pip or conda. cuvs package will need to be manually uninstalled"
fi
fi

if hasArg cuvs-dask || (( ${NUMARGS} == 1 )); then
echo "Uninstalling cuvs-dask package..."
if [ -e ${CUVS_DASK_BUILD_DIR}/install_manifest.txt ]; then
xargs rm -fv < ${CUVS_DASK_BUILD_DIR}/install_manifest.txt > /dev/null 2>&1
fi

# Try to uninstall via pip if it is installed
if [ -x "$(command -v pip)" ]; then
echo "Using pip to uninstall cuvs-dask"
pip uninstall -y cuvs-dask

# Otherwise, try to uninstall through conda if that's where things are installed
elif [ -x "$(command -v conda)" ] && [ "$INSTALL_PREFIX" == "$CONDA_PREFIX" ]; then
echo "Using conda to uninstall cuvs-dask"
conda uninstall -y cuvs-dask

# Otherwise, fail
else
echo "Could not uninstall cuvs-dask from pip or conda. cuvs-dask package will need to be manually uninstalled."
fi
fi
exit 0
fi

Expand All @@ -261,24 +239,14 @@ if hasArg --allgpuarch; then
BUILD_ALL_GPU_ARCH=1
fi


# Append `-DFIND_CUVS_CPP=ON` to EXTRA_CMAKE_ARGS unless a user specified the option.
if [[ "${EXTRA_CMAKE_ARGS}" != *"DFIND_CUVS_CPP"* ]]; then
EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} -DFIND_CUVS_CPP=ON"
fi

if hasArg tests || (( ${NUMARGS} == 0 )); then
BUILD_TESTS=ON
CMAKE_TARGET="${CMAKE_TARGET};${TEST_TARGETS}"

# Force compile library when needed test targets are specified
if [[ $CMAKE_TARGET == *"CLUSTER_TEST"* || \
$CMAKE_TARGET == *"DISTANCE_TEST"* || \
$CMAKE_TARGET == *"NEIGHBORS_ANN_CAGRA_TEST"* || \
$CMAKE_TARGET == *"NEIGHBORS_ANN_IVF_TEST"* || \
$CMAKE_TARGET == *"NEIGHBORS_ANN_NN_DESCENT_TEST"* || \
$CMAKE_TARGET == *"NEIGHBORS_TEST"* || \
$CMAKE_TARGET == *"STATS_TEST"* ]]; then
if [[ $CMAKE_TARGET == *"CAGRA_C_TEST"* || \
$CMAKE_TARGET == *"INTEROP_TEST"* || \
$CMAKE_TARGET == *"NEIGHBORS_ANN_CAGRA_TEST"* ]]; then
echo "-- Enabling compiled lib for gtests"
COMPILE_LIBRARY=ON
fi
Expand All @@ -304,13 +272,10 @@ if [[ ${CMAKE_TARGET} == "" ]]; then
CMAKE_TARGET="all"
fi

# Append `-DFIND_CUVS_CPP=ON` to EXTRA_CMAKE_ARGS unless a user specified the option.



SKBUILD_EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS}"
if [[ "${EXTRA_CMAKE_ARGS}" != *"DFIND_CUVS_CPP"* ]]; then
SKBUILD_EXTRA_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS} -DFIND_CUVS_CPP=ON"
SKBUILD_EXTRA_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS};-DFIND_CUVS_CPP=ON"
fi

# If clean given, run it prior to any other steps
Expand Down Expand Up @@ -353,7 +318,6 @@ if (( ${NUMARGS} == 0 )) || hasArg libcuvs || hasArg docs || hasArg tests || has
-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} \
-DCMAKE_CUDA_ARCHITECTURES=${CUVS_CMAKE_CUDA_ARCHITECTURES} \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCUVS_COMPILE_LIBRARY=${COMPILE_LIBRARY} \
-DBUILD_C_LIBRARY=${COMPILE_LIBRARY} \
-DCUVS_NVTX=${NVTX} \
-DCUDA_LOG_COMPILE_TIME=${LOG_COMPILE_TIME} \
Expand Down Expand Up @@ -422,9 +386,9 @@ fi

# Build and (optionally) install the cuvs Python package
if (( ${NUMARGS} == 0 )) || hasArg python; then
SKBUILD_CONFIGURE_OPTIONS="${SKBUILD_EXTRA_CMAKE_ARGS}" \
SKBUILD_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS}" \
SKBUILD_BUILD_OPTIONS="-j${PARALLEL_LEVEL}" \
python -m pip install --no-build-isolation --no-deps ${REPODIR}/python/cuvs
python -m pip install --no-build-isolation --no-deps -vvv ${REPODIR}/python/cuvs
fi

if hasArg docs; then
Expand Down
2 changes: 1 addition & 1 deletion ci/build_wheel_cuvs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
set -euo pipefail

# Set up skbuild options. Enable sccache in skbuild config options
export SKBUILD_CONFIGURE_OPTIONS="-DDETECT_CONDA_ENV=OFF -DFIND_CUVS_CPP=OFF"
export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF -DFIND_CUVS_CPP=OFF"

ci/build_wheel.sh cuvs python/cuvs
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 @@ -20,6 +20,7 @@ dependencies:
- cupy>=12.0.0
- cxx-compiler
- cython>=3.0.0
- dlpack>=0.8,<1.0
- doxygen>=1.8.20
- gcc_linux-aarch64=11.*
- gmock>=1.13.0
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 @@ -20,6 +20,7 @@ dependencies:
- cupy>=12.0.0
- cxx-compiler
- cython>=3.0.0
- dlpack>=0.8,<1.0
- doxygen>=1.8.20
- gcc_linux-64=11.*
- gmock>=1.13.0
Expand Down
1 change: 1 addition & 0 deletions conda/environments/all_cuda-122_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dependencies:
- cupy>=12.0.0
- cxx-compiler
- cython>=3.0.0
- dlpack>=0.8,<1.0
- doxygen>=1.8.20
- gcc_linux-aarch64=11.*
- gmock>=1.13.0
Expand Down
1 change: 1 addition & 0 deletions conda/environments/all_cuda-122_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dependencies:
- cupy>=12.0.0
- cxx-compiler
- cython>=3.0.0
- dlpack>=0.8,<1.0
- doxygen>=1.8.20
- gcc_linux-64=11.*
- gmock>=1.13.0
Expand Down
6 changes: 6 additions & 0 deletions conda/recipes/cuvs/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ build:
ignore_run_exports_from:
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }}
{% else %}
- {{ compiler('cuda') }}
- cuda-cudart-dev
{% endif %}

requirements:
Expand All @@ -43,6 +46,7 @@ requirements:
- cudatoolkit
{% else %}
- cuda-python >=12.0,<13.0a0
- cuda-cudart-dev
{% endif %}
- cuda-version ={{ cuda_version }}
- cython >=3.0.0
Expand All @@ -57,6 +61,8 @@ requirements:
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
{% if cuda_major == "11" %}
- cudatoolkit
{% else %}
- cuda-cudart
{% endif %}
- pylibraft {{ minor_version }}
- libcuvs {{ version }}
Expand Down
72 changes: 61 additions & 11 deletions conda/recipes/libcuvs/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Copyright (c) 2022-2024, NVIDIA CORPORATION.

# Usage:
# conda build . -c conda-forge -c nvidia -c rapidsai
{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
{% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %}
{% set cuda_major = cuda_version.split('.')[0] %}
{% set cuda_spec = ">=" + cuda_major ~ ",<" + (cuda_major | int + 1) ~ ".0a0" %} # i.e. >=11,<12.0a0
{% set date_string = environ['RAPIDS_DATE_STRING'] %}
# conda build . -c conda-forge -c nvidia -c rapidsai
{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') + environ.get('VERSION_SUFFIX', '') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
{% 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: libcuvs-split
Expand Down Expand Up @@ -42,6 +41,13 @@ outputs:
ignore_run_exports_from:
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }}
{% else %}
- {{ compiler('cuda') }}
- cuda-cudart-dev
- libcublas-dev
- libcurand-dev
- libcusolver-dev
- libcusparse-dev
{% endif %}
requirements:
build:
Expand Down Expand Up @@ -70,6 +76,7 @@ outputs:
- libcusparse {{ cuda11_libcusparse_host_version }}
- libcusparse-dev {{ cuda11_libcusparse_host_version }}
{% else %}
- cuda-cudart-dev
- cuda-profiler-api
- libcublas-dev
- libcurand-dev
Expand All @@ -79,6 +86,13 @@ outputs:
run:
- libraft ={{ minor_version }}
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
{% if cuda_major != "11" %}
- cuda-cudart
- libcublas
- libcurand
- libcusolver
- libcusparse
{% endif %}
about:
home: https://rapids.ai/
license: Apache-2.0
Expand All @@ -93,6 +107,13 @@ outputs:
ignore_run_exports_from:
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }}
{% else %}
- {{ compiler('cuda') }}
- cuda-cudart-dev
- libcublas-dev
- libcurand-dev
- libcusolver-dev
- libcusparse-dev
{% endif %}
requirements:
build:
Expand Down Expand Up @@ -121,6 +142,7 @@ outputs:
- libcusparse {{ cuda11_libcusparse_host_version }}
- libcusparse-dev {{ cuda11_libcusparse_host_version }}
{% else %}
- cuda-cudart-dev
- cuda-profiler-api
- libcublas-dev
- libcurand-dev
Expand All @@ -130,6 +152,13 @@ outputs:
run:
- libraft ={{ minor_version }}
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
{% if cuda_major != "11" %}
- cuda-cudart
- libcublas
- libcurand
- libcusolver
- libcusparse
{% endif %}
about:
home: https://rapids.ai/
license: Apache-2.0
Expand All @@ -144,6 +173,13 @@ outputs:
ignore_run_exports_from:
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }}
{% else %}
- {{ compiler('cuda') }}
- cuda-cudart-dev
- libcublas-dev
- libcurand-dev
- libcusolver-dev
- libcusparse-dev
{% endif %}
requirements:
build:
Expand All @@ -160,7 +196,7 @@ outputs:
- sysroot_{{ target_platform }} {{ sysroot_version }}
host:
- libraft ={{ minor_version }}
- libcuvs ={{ minor_version }}
- {{ pin_subpackage('libcuvs', exact=True) }}
- cuda-version ={{ cuda_version }}
{% if cuda_major == "11" %}
- cuda-profiler-api {{ cuda11_cuda_profiler_api_run_version }}
Expand All @@ -186,9 +222,15 @@ outputs:
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
{% if cuda_major == "11" %}
- cudatoolkit
{% else %}
- cuda-cudart
- libcublas
- libcurand
- libcusolver
- libcusparse
{% endif %}
- libraft ={{ minor_version }}
- libcuvs ={{ minor_version }}
- {{ pin_subpackage('libcuvs', exact=True) }}
- gmock {{ gtest_version }}
- gtest {{ gtest_version }}
about:
Expand All @@ -205,6 +247,10 @@ outputs:
ignore_run_exports_from:
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }}
{% else %}
- {{ compiler('cuda') }}
- cuda-cudart-dev
- libcublas-dev
{% endif %}
requirements:
build:
Expand All @@ -221,23 +267,27 @@ outputs:
- sysroot_{{ target_platform }} {{ sysroot_version }}
host:
- libraft ={{ minor_version }}
- libcuvs ={{ minor_version }}
- {{ pin_subpackage('libcuvs', exact=True) }}
- 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 %}
run:
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
{% if cuda_major == "11" %}
- cudatoolkit
{% else %}
- cuda-cudart
- libcublas
{% endif %}
- libraft ={{ minor_version }}
- libcuvs ={{ minor_version }}
- {{ pin_subpackage('libcuvs', exact=True) }}
about:
home: https://rapids.ai/
license: Apache-2.0
Expand Down
7 changes: 4 additions & 3 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ files:
rust:
output: none
includes:
- cuda_version
- build
- cuda
- rust
Expand Down Expand Up @@ -138,6 +139,7 @@ dependencies:
packages:
- &rmm_conda rmm==24.4.*
- &pylibraft_conda pylibraft==24.4.*
- dlpack>=0.8,<1.0
- output_types: requirements
packages:
# pip recognizes the index as a global option for the requirements.txt file
Expand Down Expand Up @@ -320,7 +322,7 @@ dependencies:
- make
- rust
# clang/liblclang only needed for bindgen support
- clang
- clang
- libclang
build_wheels:
common:
Expand Down Expand Up @@ -380,7 +382,7 @@ dependencies:
- matrix: {cuda: "11.*"}
packages:
- *pylibraft_cu11
- {matrix: null, packages: [*rmm_conda]}
- {matrix: null, packages: [*pylibraft_conda]}
test_python_common:
common:
- output_types: [conda, requirements, pyproject]
Expand All @@ -391,5 +393,4 @@ dependencies:
common:
- output_types: [conda, requirements, pyproject]
packages:
- *pylibraft_conda
- scikit-learn
Loading

0 comments on commit e6bff2b

Please sign in to comment.