From a6b71d72ed349a118887ff730475eaeda43ef2aa Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 11 Sep 2024 12:57:52 -0500 Subject: [PATCH] Simplify libcuvs conda recipe. (#322) This PR refactors the `libcuvs` conda recipe to use `libraft-headers-only` instead of `libraft`. I removed dependencies on `rmm` from the `cuvs` build -- it is not imported. I included a couple small fixes in CMake and the `cuvs` recipe. Authors: - Bradley Dice (https://github.com/bdice) Approvers: - Mike Sarahan (https://github.com/msarahan) - Corey J. Nolet (https://github.com/cjnolet) URL: https://github.com/rapidsai/cuvs/pull/322 --- conda/recipes/cuvs/meta.yaml | 6 +----- conda/recipes/libcuvs/meta.yaml | 33 ++++++++++++++++++++++++--------- cpp/CMakeLists.txt | 4 ++-- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/conda/recipes/cuvs/meta.yaml b/conda/recipes/cuvs/meta.yaml index 2633b3db8..e7e2daf0c 100644 --- a/conda/recipes/cuvs/meta.yaml +++ b/conda/recipes/cuvs/meta.yaml @@ -1,7 +1,7 @@ # Copyright (c) 2022-2024, NVIDIA CORPORATION. # Usage: -# conda build . -c conda-forge -c numba -c rapidsai -c pytorch +# 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'] %} @@ -54,10 +54,8 @@ requirements: - pylibraft {{ minor_version }} - libcuvs {{ version }} - python x.x - - rmm ={{ minor_version }} - rapids-build-backend>=0.3.0,<0.4.0.dev0 - scikit-build-core >=0.10.0 - - setuptools run: - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} {% if cuda_major == "11" %} @@ -68,7 +66,6 @@ requirements: - pylibraft {{ minor_version }} - libcuvs {{ version }} - python x.x - - rmm ={{ minor_version }} - cuda-python - numpy >=1.23,<3.0a0 @@ -81,5 +78,4 @@ tests: about: home: https://rapids.ai/ license: Apache-2.0 - # license_file: LICENSE summary: cuvs python library diff --git a/conda/recipes/libcuvs/meta.yaml b/conda/recipes/libcuvs/meta.yaml index 4ffdc91e4..e154ccf41 100644 --- a/conda/recipes/libcuvs/meta.yaml +++ b/conda/recipes/libcuvs/meta.yaml @@ -1,7 +1,7 @@ # Copyright (c) 2022-2024, NVIDIA CORPORATION. # Usage: -# conda build . -c conda-forge -c nvidia -c rapidsai +# 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 cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} @@ -63,7 +63,8 @@ outputs: - ninja - {{ stdlib("c") }} host: - - libraft ={{ minor_version }} + - librmm ={{ minor_version }} + - libraft-headers ={{ minor_version }} - cuda-version ={{ cuda_version }} {% if cuda_major == "11" %} - cuda-profiler-api {{ cuda11_cuda_profiler_api_host_version }} @@ -84,7 +85,6 @@ outputs: - libcusparse-dev {% endif %} run: - - libraft ={{ minor_version }} - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} {% if cuda_major != "11" %} - cuda-cudart @@ -129,7 +129,8 @@ outputs: - ninja - {{ stdlib("c") }} host: - - libraft ={{ minor_version }} + - librmm ={{ minor_version }} + - libraft-headers ={{ minor_version }} - cuda-version ={{ cuda_version }} {% if cuda_major == "11" %} - cuda-profiler-api {{ cuda11_cuda_profiler_api_host_version }} @@ -150,7 +151,6 @@ outputs: - libcusparse-dev {% endif %} run: - - libraft ={{ minor_version }} - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} {% if cuda_major != "11" %} - cuda-cudart @@ -195,7 +195,8 @@ outputs: - ninja - {{ stdlib("c") }} host: - - libraft ={{ minor_version }} + - librmm ={{ minor_version }} + - libraft-headers ={{ minor_version }} - {{ pin_subpackage('libcuvs', exact=True) }} - cuda-version ={{ cuda_version }} - openblas # required by some CPU algos in benchmarks @@ -228,7 +229,6 @@ outputs: - libcusolver - libcusparse {% endif %} - - libraft ={{ minor_version }} - {{ pin_subpackage('libcuvs', exact=True) }} about: home: https://rapids.ai/ @@ -248,6 +248,9 @@ outputs: - {{ compiler('cuda') }} - cuda-cudart-dev - libcublas-dev + - libcurand-dev + - libcusolver-dev + - libcusparse-dev {% endif %} requirements: build: @@ -263,17 +266,27 @@ outputs: - ninja - {{ stdlib("c") }} host: - - libraft ={{ minor_version }} + - librmm ={{ minor_version }} + - libraft-headers ={{ 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 }} + - libcurand {{ cuda11_libcurand_host_version }} + - libcurand-dev {{ cuda11_libcurand_host_version }} + - libcusolver {{ cuda11_libcusolver_host_version }} + - libcusolver-dev {{ cuda11_libcusolver_host_version }} + - libcusparse {{ cuda11_libcusparse_host_version }} + - libcusparse-dev {{ cuda11_libcusparse_host_version }} {% else %} - cuda-cudart-dev - cuda-profiler-api - libcublas-dev + - libcurand-dev + - libcusolver-dev + - libcusparse-dev {% endif %} run: - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} @@ -282,8 +295,10 @@ outputs: {% else %} - cuda-cudart - libcublas + - libcurand + - libcusolver + - libcusparse {% endif %} - - libraft ={{ minor_version }} - {{ pin_subpackage('libcuvs', exact=True) }} about: home: https://rapids.ai/ diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index ba46e60b4..fec1248bb 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -53,8 +53,8 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) option(BUILD_SHARED_LIBS "Build cuvs shared libraries" ON) option(BUILD_TESTS "Build cuvs unit-tests" ON) -option(BUILD_C_LIBRARY "Build raft C API library" OFF) -option(BUILD_C_TESTS "Build raft C API tests" OFF) +option(BUILD_C_LIBRARY "Build cuVS C API library" OFF) +option(BUILD_C_TESTS "Build cuVS C API tests" OFF) option(BUILD_ANN_BENCH "Build cuVS ann benchmarks" OFF) option(BUILD_CAGRA_HNSWLIB "Build CAGRA+hnswlib interface" ON) option(CUDA_ENABLE_KERNELINFO "Enable kernel resource usage info" OFF)