Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port remaining scripts to cuvs_bench #368

Merged
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8add0ab
build and package cuvs_bench
divyegala Oct 1, 2024
db07cc3
add cpu bench package
divyegala Oct 1, 2024
dd16e2b
port remaining scripts
divyegala Oct 1, 2024
21b2660
additions to build.sh
divyegala Oct 1, 2024
66a01c3
attempt to fix syntax
divyegala Oct 1, 2024
dccef49
address review
divyegala Oct 1, 2024
dc9978d
sort dependencies alphabetically
divyegala Oct 1, 2024
f5cc010
get_cuvs.cmake to use libcuvs.so for bench
divyegala Oct 2, 2024
61bf8e2
FIX relative imports that were accidentally deleted
dantegd Oct 2, 2024
7ce126c
Style fixes
dantegd Oct 2, 2024
f103d6d
disable build on shared_libs option
divyegala Oct 2, 2024
72d1603
enable build on shared_libs option
divyegala Oct 2, 2024
7d23545
message to debug
divyegala Oct 2, 2024
54022c2
more debug msgs
divyegala Oct 2, 2024
7c0a54b
no shared libs
divyegala Oct 2, 2024
4bd1ab6
build all libcuvs in conda-python cuvs_bench
divyegala Oct 2, 2024
4b5abbf
merge upstream
divyegala Oct 2, 2024
58975f8
merge packaging
divyegala Oct 2, 2024
bbb94f5
address review
divyegala Oct 2, 2024
c40805b
fix cpu bench-ann building
divyegala Oct 2, 2024
265a8ac
include cutlass properly
divyegala Oct 2, 2024
86da10a
fix cpu bench-ann building
divyegala Oct 2, 2024
d03c28d
include cutlass properly
divyegala Oct 2, 2024
2d8691d
don't include get_cuvs.cmake in bench
divyegala Oct 3, 2024
996f11b
don't include get_cuvs.cmake in bench
divyegala Oct 3, 2024
c053faf
add openblass to recipe
divyegala Oct 3, 2024
1cda681
add openblass to recipe
divyegala Oct 3, 2024
d448b4c
Merge branch 'cuvs_bench_packaging' into cuvs_bench_remainder_scripts
divyegala Oct 3, 2024
18b81b2
Replacing more occurrences of raft with cuvs in cuvs_bench
cjnolet Oct 3, 2024
d8cc035
merge upstream
divyegala Oct 3, 2024
6b9a576
merge upstream
divyegala Oct 3, 2024
6c5b403
readd missing flags from build.sh
divyegala Oct 3, 2024
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
24 changes: 18 additions & 6 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 --cpu-only --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 --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,11 +37,12 @@ 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. Applies to bench-ann only currently.
--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-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 Down Expand Up @@ -71,6 +72,7 @@ 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 @@ -277,16 +279,21 @@ 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
COMPILE_LIBRARY=OFF
BUILD_CPU_ONLY=ON
NVTX=OFF
else
COMPILE_LIBRARY=ON
fi
fi

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

if hasArg --no-nvtx; then
NVTX=OFF
fi
Expand Down Expand Up @@ -331,7 +338,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 hasArg --no-shared-libs; 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 @@ -362,6 +373,7 @@ if (( ${NUMARGS} == 0 )) || hasArg libcuvs || hasArg docs || hasArg tests || has
-DBUILD_CUVS_BENCH=${BUILD_CUVS_BENCH} \
-DBUILD_CPU_ONLY=${BUILD_CPU_ONLY} \
-DCMAKE_MESSAGE_LOG_LEVEL=${CMAKE_LOG_LEVEL} \
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} \
${CACHE_ARGS} \
${EXTRA_CMAKE_ARGS}

Expand Down
4 changes: 2 additions & 2 deletions ci/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ rapids-conda-retry mambabuild \
--channel "${RAPIDS_CONDA_BLD_OUTPUT_DIR}" \
conda/recipes/cuvs_bench

# Build cuvs_bench_cpu only in CUDA 11 jobs since it only depends on python
# 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} == "11" ]]; then
if [[ ${RAPIDS_CUDA_MAJOR} == "12" ]]; then
rapids-conda-retry mambabuild \
--no-test \
--channel "${CPP_CHANNEL}" \
Expand Down
29 changes: 13 additions & 16 deletions conda/recipes/cuvs_bench/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2022-2024, NVIDIA CORPORATION.
# Copyright (c) 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 py_version = environ['CONDA_PY'] %}
Expand Down Expand Up @@ -31,8 +31,8 @@ build:
- SCCACHE_BUCKET
- SCCACHE_IDLE_TIMEOUT
- SCCACHE_REGION
- SCCACHE_S3_KEY_PREFIX=libraft-aarch64 # [aarch64]
- SCCACHE_S3_KEY_PREFIX=libraft-linux64 # [linux64]
- 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 }}
Expand Down Expand Up @@ -60,8 +60,7 @@ requirements:
- {{ stdlib("c") }}

host:
- python
- libcuvs {{ version }}
- benchmark
- cuda-version ={{ cuda_version }}
{% if cuda_major == "11" %}
- cuda-profiler-api {{ cuda11_cuda_profiler_api_run_version }}
Expand All @@ -73,17 +72,15 @@ requirements:
- libcublas-dev
{% endif %}
- glog {{ glog_version }}
- libcuvs {{ version }}
- nlohmann_json {{ nlohmann_json_version }}
- benchmark
# rmm is needed to determine if package is gpu-enabled
- rmm ={{ minor_version }}
- python
- rapids-build-backend>=0.3.0,<0.4.0.dev0
- rmm ={{ minor_version }}

run:
- python
- libcuvs {{ version }}
- pylibraft {{ version }}
- cuvs {{ version }}
- benchmark
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
{% if cuda_major == "11" %}
- cudatoolkit
Expand All @@ -92,16 +89,16 @@ requirements:
- libcublas
{% endif %}
- glog {{ glog_version }}
- libcuvs {{ version }}
- h5py {{ h5py_version }}
- benchmark
- glog {{ glog_version }}
- matplotlib
- python
- 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 ANN GPU and CPU benchmarks
summary: cuVS GPU and CPU benchmarks
2 changes: 1 addition & 1 deletion conda/recipes/cuvs_bench_cpu/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Copyright (c) 2023, NVIDIA CORPORATION.
# 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
24 changes: 11 additions & 13 deletions conda/recipes/cuvs_bench_cpu/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Copyright (c) 2022-2024, NVIDIA CORPORATION.
# Copyright (c) 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 py_version = environ['CONDA_PY'] %}
{% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %}
{% set date_string = environ['RAPIDS_DATE_STRING'] %}

package:
Expand All @@ -30,8 +29,8 @@ build:
- SCCACHE_BUCKET
- SCCACHE_IDLE_TIMEOUT
- SCCACHE_REGION
- SCCACHE_S3_KEY_PREFIX=libraft-aarch64 # [aarch64]
- SCCACHE_S3_KEY_PREFIX=libraft-linux64 # [linux64]
- SCCACHE_S3_KEY_PREFIX=cuvs-bench-cpu-aarch64 # [aarch64]
- SCCACHE_S3_KEY_PREFIX=cuvs-bench-cpu-linux64 # [linux64]
- SCCACHE_S3_USE_SSL
number: {{ GIT_DESCRIBE_NUMBER }}
string: py{{ py_version }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
Expand All @@ -45,24 +44,23 @@ requirements:
- {{ stdlib("c") }}

host:
- benchmark
- fmt {{ fmt_version }}
- glog {{ glog_version }}
- matplotlib
- nlohmann_json {{ nlohmann_json_version }}
- spdlog {{ spdlog_version }}
- fmt {{ fmt_version }}
- python
- rapids-build-backend>=0.3.0,<0.4.0.dev0
- benchmark
- spdlog {{ spdlog_version }}

run:
- benchmark
- glog {{ glog_version }}
- h5py {{ h5py_version }}
- matplotlib
- python
- pyyaml
- pandas
- benchmark
- pyyaml
- python
about:
home: https://rapids.ai/
license: Apache-2.0
summary: cuVS ANN CPU benchmarks
summary: cuVS CPU benchmarks
1 change: 1 addition & 0 deletions conda/recipes/libcuvs/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ outputs:
- libcusolver
- libcusparse
{% endif %}
- libraft-headers ={{ minor_version }}
about:
home: https://rapids.ai/
license: Apache-2.0
Expand Down
Loading