Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/branch-24.02' into filename-plot
Browse files Browse the repository at this point in the history
  • Loading branch information
divyegala committed Dec 14, 2023
2 parents 0e9f1cc + 80a48ca commit d19e28c
Show file tree
Hide file tree
Showing 68 changed files with 1,614 additions and 976 deletions.
87 changes: 87 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,90 @@
# raft 23.12.00 (6 Dec 2023)

## 🐛 Bug Fixes

- Update actions/labeler to v4 ([#2037](https://github.com/rapidsai/raft/pull/2037)) [@raydouglass](https://github.com/raydouglass)
- pylibraft only depends on numpy at runtime, not build time. ([#2013](https://github.com/rapidsai/raft/pull/2013)) [@bdice](https://github.com/bdice)
- Fixes to update-version.sh ([#1991](https://github.com/rapidsai/raft/pull/1991)) [@raydouglass](https://github.com/raydouglass)
- Adjusting end-to-end start time so it doesn't include stream creation time ([#1989](https://github.com/rapidsai/raft/pull/1989)) [@cjnolet](https://github.com/cjnolet)
- CAGRA graph optimizer: clamp rev_graph_count ([#1987](https://github.com/rapidsai/raft/pull/1987)) [@tfeher](https://github.com/tfeher)
- Catching conversion errors in data_export instead of fully failing ([#1979](https://github.com/rapidsai/raft/pull/1979)) [@cjnolet](https://github.com/cjnolet)
- Fix syncing mechanism in `raft-ann-bench` C++ search ([#1961](https://github.com/rapidsai/raft/pull/1961)) [@divyegala](https://github.com/divyegala)
- Fixing hnswlib in latency mode ([#1959](https://github.com/rapidsai/raft/pull/1959)) [@cjnolet](https://github.com/cjnolet)
- Fix `ucx-py` alpha version update for `raft-dask` ([#1953](https://github.com/rapidsai/raft/pull/1953)) [@divyegala](https://github.com/divyegala)
- Reduce NN Descent test threshold ([#1946](https://github.com/rapidsai/raft/pull/1946)) [@divyegala](https://github.com/divyegala)
- Fixes to new YAML config `raft-bench-ann` ([#1945](https://github.com/rapidsai/raft/pull/1945)) [@divyegala](https://github.com/divyegala)
- Set RNG seeds in NN Descent to diagnose flaky tests ([#1931](https://github.com/rapidsai/raft/pull/1931)) [@divyegala](https://github.com/divyegala)
- Fix FAISS CPU algorithm names in `raft-ann-bench` ([#1916](https://github.com/rapidsai/raft/pull/1916)) [@divyegala](https://github.com/divyegala)
- Increase iterations in NN Descent tests to avoid flakiness ([#1915](https://github.com/rapidsai/raft/pull/1915)) [@divyegala](https://github.com/divyegala)
- Fix filepath in `raft-ann-bench/split_groundtruth` module ([#1911](https://github.com/rapidsai/raft/pull/1911)) [@divyegala](https://github.com/divyegala)
- Remove dynamic entry-points from raft-ann-bench ([#1910](https://github.com/rapidsai/raft/pull/1910)) [@benfred](https://github.com/benfred)
- Remove unnecessary dataset path check in ANN bench ([#1908](https://github.com/rapidsai/raft/pull/1908)) [@tfeher](https://github.com/tfeher)
- Fixing Googletests and re-enabling in CI ([#1904](https://github.com/rapidsai/raft/pull/1904)) [@cjnolet](https://github.com/cjnolet)
- Fix NN Descent overflows ([#1875](https://github.com/rapidsai/raft/pull/1875)) [@divyegala](https://github.com/divyegala)
- Build fix for CUDA 12.2 ([#1870](https://github.com/rapidsai/raft/pull/1870)) [@benfred](https://github.com/benfred)
- [BUG] Fix a bug in NN descent ([#1869](https://github.com/rapidsai/raft/pull/1869)) [@enp1s0](https://github.com/enp1s0)

## 📖 Documentation

- Brute Force Index documentation fix ([#1944](https://github.com/rapidsai/raft/pull/1944)) [@lowener](https://github.com/lowener)
- Add `wiki_all` dataset config and documentation. ([#1918](https://github.com/rapidsai/raft/pull/1918)) [@cjnolet](https://github.com/cjnolet)
- Updates to raft-ann-bench docs ([#1905](https://github.com/rapidsai/raft/pull/1905)) [@cjnolet](https://github.com/cjnolet)
- End-to-end vector search tutorial in docs ([#1776](https://github.com/rapidsai/raft/pull/1776)) [@cjnolet](https://github.com/cjnolet)

## 🚀 New Features

- Adding `dry-run` option to `raft-ann-bench` ([#1970](https://github.com/rapidsai/raft/pull/1970)) [@cjnolet](https://github.com/cjnolet)
- Add ANN bench scripts to generate ground truth ([#1967](https://github.com/rapidsai/raft/pull/1967)) [@tfeher](https://github.com/tfeher)
- CAGRA build + HNSW search ([#1956](https://github.com/rapidsai/raft/pull/1956)) [@divyegala](https://github.com/divyegala)
- Verify conda-cpp-post-build-checks ([#1935](https://github.com/rapidsai/raft/pull/1935)) [@robertmaynard](https://github.com/robertmaynard)
- Make all cuda kernels have hidden visibility ([#1898](https://github.com/rapidsai/raft/pull/1898)) [@robertmaynard](https://github.com/robertmaynard)
- Update rapids-cmake functions to non-deprecated signatures ([#1884](https://github.com/rapidsai/raft/pull/1884)) [@robertmaynard](https://github.com/robertmaynard)
- [FEA] Helpers for identifying contiguous layouts. ([#1861](https://github.com/rapidsai/raft/pull/1861)) [@trivialfis](https://github.com/trivialfis)
- Add `raft::stats::neighborhood_recall` ([#1860](https://github.com/rapidsai/raft/pull/1860)) [@divyegala](https://github.com/divyegala)
- [FEA] Helpers and CodePacker for IVF-PQ ([#1826](https://github.com/rapidsai/raft/pull/1826)) [@tarang-jain](https://github.com/tarang-jain)

## 🛠️ Improvements

- Pinning fmt and spdlog for raft-ann-bench-cpu ([#2018](https://github.com/rapidsai/raft/pull/2018)) [@cjnolet](https://github.com/cjnolet)
- Build concurrency for nightly and merge triggers ([#2011](https://github.com/rapidsai/raft/pull/2011)) [@bdice](https://github.com/bdice)
- Using `EXPORT_SET` in `rapids_find_package_root` ([#2006](https://github.com/rapidsai/raft/pull/2006)) [@cjnolet](https://github.com/cjnolet)
- Remove static checks for serialization size ([#1997](https://github.com/rapidsai/raft/pull/1997)) [@cjnolet](https://github.com/cjnolet)
- Skipping bad json parse ([#1990](https://github.com/rapidsai/raft/pull/1990)) [@cjnolet](https://github.com/cjnolet)
- Update select-k heuristic ([#1985](https://github.com/rapidsai/raft/pull/1985)) [@benfred](https://github.com/benfred)
- ANN bench: use different offset for each thread ([#1981](https://github.com/rapidsai/raft/pull/1981)) [@tfeher](https://github.com/tfeher)
- Allow `raft-ann-bench/run` to continue after encountering bad YAML configs ([#1980](https://github.com/rapidsai/raft/pull/1980)) [@divyegala](https://github.com/divyegala)
- Add build and search params to `raft-ann-bench.data_export` CSVs ([#1971](https://github.com/rapidsai/raft/pull/1971)) [@divyegala](https://github.com/divyegala)
- Use new `rapids-dask-dependency` metapackage for managing dask versions ([#1968](https://github.com/rapidsai/raft/pull/1968)) [@galipremsagar](https://github.com/galipremsagar)
- Remove unused header ([#1960](https://github.com/rapidsai/raft/pull/1960)) [@wphicks](https://github.com/wphicks)
- Adding pool back in and fixing cagra benchmark params ([#1951](https://github.com/rapidsai/raft/pull/1951)) [@cjnolet](https://github.com/cjnolet)
- Add constraints to `hnswlib` in `raft-bench-ann` ([#1949](https://github.com/rapidsai/raft/pull/1949)) [@divyegala](https://github.com/divyegala)
- Add support for iterating over batches in bfknn ([#1947](https://github.com/rapidsai/raft/pull/1947)) [@benfred](https://github.com/benfred)
- Fix ANN bench latency ([#1940](https://github.com/rapidsai/raft/pull/1940)) [@tfeher](https://github.com/tfeher)
- Add YAML config files to run parameter sweeps for ANN benchmarks ([#1929](https://github.com/rapidsai/raft/pull/1929)) [@divyegala](https://github.com/divyegala)
- Relax ucx pinning ([#1927](https://github.com/rapidsai/raft/pull/1927)) [@vyasr](https://github.com/vyasr)
- Try using contiguous rank to fix cuda_visible_devices ([#1926](https://github.com/rapidsai/raft/pull/1926)) [@VibhuJawa](https://github.com/VibhuJawa)
- Unpin `dask` and `distributed` for `23.12` development ([#1925](https://github.com/rapidsai/raft/pull/1925)) [@galipremsagar](https://github.com/galipremsagar)
- Adding `throughput` and `latency` modes to `raft-ann-bench` ([#1920](https://github.com/rapidsai/raft/pull/1920)) [@cjnolet](https://github.com/cjnolet)
- Providing `aarch64` yaml environment files ([#1914](https://github.com/rapidsai/raft/pull/1914)) [@cjnolet](https://github.com/cjnolet)
- CAGRA ANN bench: parse build options for IVF-PQ build algo ([#1912](https://github.com/rapidsai/raft/pull/1912)) [@tfeher](https://github.com/tfeher)
- Fix python script location in ANN bench description ([#1906](https://github.com/rapidsai/raft/pull/1906)) [@tfeher](https://github.com/tfeher)
- Refactor install/build guide. ([#1899](https://github.com/rapidsai/raft/pull/1899)) [@cjnolet](https://github.com/cjnolet)
- Check return values of raft-ann-bench subprocess calls ([#1897](https://github.com/rapidsai/raft/pull/1897)) [@benfred](https://github.com/benfred)
- ANN bench options to specify CAGRA graph and dataset locations ([#1896](https://github.com/rapidsai/raft/pull/1896)) [@cjnolet](https://github.com/cjnolet)
- Add check-json to pre-commit linters, and fix invalid ann-bench JSON config ([#1894](https://github.com/rapidsai/raft/pull/1894)) [@benfred](https://github.com/benfred)
- Use branch-23.12 workflows. ([#1886](https://github.com/rapidsai/raft/pull/1886)) [@bdice](https://github.com/bdice)
- Setup Consistent Nightly Versions for Pip and Conda ([#1880](https://github.com/rapidsai/raft/pull/1880)) [@divyegala](https://github.com/divyegala)
- Fix and improve one-block radix select ([#1878](https://github.com/rapidsai/raft/pull/1878)) [@yong-wang](https://github.com/yong-wang)
- [FEA] Improvements on bitset class ([#1877](https://github.com/rapidsai/raft/pull/1877)) [@lowener](https://github.com/lowener)
- Branch 23.12 merge 23.10 ([#1873](https://github.com/rapidsai/raft/pull/1873)) [@AyodeAwe](https://github.com/AyodeAwe)
- Branch 23.12 merge 23.10 ([#1868](https://github.com/rapidsai/raft/pull/1868)) [@cjnolet](https://github.com/cjnolet)
- Replace `raft::random` calls to not use deprecated API ([#1867](https://github.com/rapidsai/raft/pull/1867)) [@lowener](https://github.com/lowener)
- raft: Build CUDA 12.0 ARM conda packages. ([#1853](https://github.com/rapidsai/raft/pull/1853)) [@bdice](https://github.com/bdice)
- Documentation for raft ANN benchmark containers. ([#1833](https://github.com/rapidsai/raft/pull/1833)) [@dantegd](https://github.com/dantegd)
- [FEA] Support vector deletion in ANN IVF ([#1831](https://github.com/rapidsai/raft/pull/1831)) [@lowener](https://github.com/lowener)
- Provide a raft::copy overload for mdspan-to-mdspan copies ([#1818](https://github.com/rapidsai/raft/pull/1818)) [@wphicks](https://github.com/wphicks)
- Adding FAISS cpu to `raft-ann-bench` ([#1814](https://github.com/rapidsai/raft/pull/1814)) [@cjnolet](https://github.com/cjnolet)

# raft 23.10.00 (11 Oct 2023)

## 🚨 Breaking Changes
Expand Down
11 changes: 6 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ INSTALL_TARGET=install
BUILD_REPORT_METRICS=""
BUILD_REPORT_INCL_CACHE_STATS=OFF

TEST_TARGETS="CLUSTER_TEST;CORE_TEST;DISTANCE_TEST;LABEL_TEST;LINALG_TEST;MATRIX_TEST;NEIGHBORS_TEST;NEIGHBORS_ANN_CAGRA_TEST;NEIGHBORS_ANN_NN_DESCENT_TEST;NEIGHBORS_ANN_IVF_TEST;RANDOM_TEST;SOLVERS_TEST;SPARSE_TEST;SPARSE_DIST_TEST;SPARSE_NEIGHBORS_TEST;STATS_TEST;UTILS_TEST"
TEST_TARGETS="CLUSTER_TEST;CORE_TEST;DISTANCE_TEST;LABEL_TEST;LINALG_TEST;MATRIX_TEST;NEIGHBORS_TEST;NEIGHBORS_ANN_BRUTE_FORCE_TEST;NEIGHBORS_ANN_CAGRA_TEST;NEIGHBORS_ANN_NN_DESCENT_TEST;NEIGHBORS_ANN_IVF_TEST;RANDOM_TEST;SOLVERS_TEST;SPARSE_TEST;SPARSE_DIST_TEST;SPARSE_NEIGHBORS_TEST;STATS_TEST;UTILS_TEST"
BENCH_TARGETS="CLUSTER_BENCH;CORE_BENCH;NEIGHBORS_BENCH;DISTANCE_BENCH;LINALG_BENCH;MATRIX_BENCH;SPARSE_BENCH;RANDOM_BENCH"

CACHE_ARGS=""
Expand Down Expand Up @@ -323,6 +323,7 @@ if hasArg tests || (( ${NUMARGS} == 0 )); then
if [[ $CMAKE_TARGET == *"CLUSTER_TEST"* || \
$CMAKE_TARGET == *"DISTANCE_TEST"* || \
$CMAKE_TARGET == *"MATRIX_TEST"* || \
$CMAKE_TARGET == *"NEIGHBORS_ANN_BRUTE_FORCE_TEST"* || \
$CMAKE_TARGET == *"NEIGHBORS_ANN_CAGRA_TEST"* || \
$CMAKE_TARGET == *"NEIGHBORS_ANN_IVF_TEST"* || \
$CMAKE_TARGET == *"NEIGHBORS_ANN_NN_DESCENT_TEST"* || \
Expand Down Expand Up @@ -385,6 +386,8 @@ SKBUILD_EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS}"
if [[ "${EXTRA_CMAKE_ARGS}" != *"DFIND_RAFT_CPP"* ]]; then
SKBUILD_EXTRA_CMAKE_ARGS="${SKBUILD_EXTRA_CMAKE_ARGS} -DFIND_RAFT_CPP=ON"
fi
# Replace spaces with semicolons in SKBUILD_EXTRA_CMAKE_ARGS
SKBUILD_EXTRA_CMAKE_ARGS=$(echo ${SKBUILD_EXTRA_CMAKE_ARGS} | sed 's/ /;/g')

# If clean given, run it prior to any other steps
if (( ${CLEAN} == 1 )); then
Expand Down Expand Up @@ -492,15 +495,13 @@ fi

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

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

Expand Down
2 changes: 1 addition & 1 deletion ci/build_wheel_pylibraft.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="-DRAFT_BUILD_WHEELS=ON -DDETECT_CONDA_ENV=OFF -DFIND_RAFT_CPP=OFF"
export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DFIND_RAFT_CPP=OFF"

ci/build_wheel.sh pylibraft python/pylibraft
2 changes: 1 addition & 1 deletion ci/build_wheel_raft_dask.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="-DRAFT_BUILD_WHEELS=ON -DDETECT_CONDA_ENV=OFF -DFIND_RAFT_CPP=OFF"
export SKBUILD_CMAKE_ARGS="-DDETECT_CONDA_ENV=OFF;-DFIND_RAFT_CPP=OFF"

ci/build_wheel.sh raft-dask python/raft-dask
2 changes: 1 addition & 1 deletion conda/environments/all_cuda-118_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dependencies:
- rapids-dask-dependency==24.2.*
- recommonmark
- rmm==24.2.*
- scikit-build>=0.13.1
- scikit-build-core>=0.7.0
- scikit-learn
- scipy
- sphinx-copybutton
Expand Down
2 changes: 1 addition & 1 deletion conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dependencies:
- rapids-dask-dependency==24.2.*
- recommonmark
- rmm==24.2.*
- scikit-build>=0.13.1
- scikit-build-core>=0.7.0
- scikit-learn
- scipy
- sphinx-copybutton
Expand Down
2 changes: 1 addition & 1 deletion conda/environments/all_cuda-120_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies:
- rapids-dask-dependency==24.2.*
- recommonmark
- rmm==24.2.*
- scikit-build>=0.13.1
- scikit-build-core>=0.7.0
- scikit-learn
- scipy
- sphinx-copybutton
Expand Down
2 changes: 1 addition & 1 deletion conda/environments/all_cuda-120_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies:
- rapids-dask-dependency==24.2.*
- recommonmark
- rmm==24.2.*
- scikit-build>=0.13.1
- scikit-build-core>=0.7.0
- scikit-learn
- scipy
- sphinx-copybutton
Expand Down
2 changes: 1 addition & 1 deletion conda/environments/bench_ann_cuda-118_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ dependencies:
- pandas
- pyyaml
- rmm==24.2.*
- scikit-build>=0.13.1
- scikit-build-core>=0.7.0
- sysroot_linux-aarch64==2.17
name: bench_ann_cuda-118_arch-aarch64
2 changes: 1 addition & 1 deletion conda/environments/bench_ann_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ dependencies:
- pandas
- pyyaml
- rmm==24.2.*
- scikit-build>=0.13.1
- scikit-build-core>=0.7.0
- sysroot_linux-64==2.17
name: bench_ann_cuda-118_arch-x86_64
2 changes: 1 addition & 1 deletion conda/environments/bench_ann_cuda-120_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ dependencies:
- pandas
- pyyaml
- rmm==24.2.*
- scikit-build>=0.13.1
- scikit-build-core>=0.7.0
- sysroot_linux-aarch64==2.17
name: bench_ann_cuda-120_arch-aarch64
2 changes: 1 addition & 1 deletion conda/environments/bench_ann_cuda-120_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ dependencies:
- pandas
- pyyaml
- rmm==24.2.*
- scikit-build>=0.13.1
- scikit-build-core>=0.7.0
- sysroot_linux-64==2.17
name: bench_ann_cuda-120_arch-x86_64
2 changes: 1 addition & 1 deletion conda/recipes/pylibraft/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ requirements:
- libraft-headers {{ version }}
- python x.x
- rmm ={{ minor_version }}
- scikit-build >=0.13.1
- scikit-build-core >=0.7.0
- setuptools
run:
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
Expand Down
2 changes: 1 addition & 1 deletion conda/recipes/raft-dask/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ requirements:
- pylibraft {{ version }}
- python x.x
- rmm ={{ minor_version }}
- scikit-build >=0.13.1
- scikit-build-core >=0.7.0
- setuptools
- ucx {{ ucx_version }}
- ucx-proc=*=gpu
Expand Down
45 changes: 33 additions & 12 deletions cpp/bench/ann/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,21 @@ if(RAFT_ANN_BENCH_USE_FAISS)
include(cmake/thirdparty/get_faiss.cmake)
endif()

# ##################################################################################################
# * Enable NVTX if available

# Note: ANN_BENCH wrappers have extra NVTX code not related to raft::nvtx.They track gbench
# benchmark cases and iterations. This is to make limited NVTX available to all algos, not just
# raft.
if(TARGET CUDA::nvtx3)
set(_CMAKE_REQUIRED_INCLUDES_ORIG ${CMAKE_REQUIRED_INCLUDES})
get_target_property(CMAKE_REQUIRED_INCLUDES CUDA::nvtx3 INTERFACE_INCLUDE_DIRECTORIES)
unset(NVTX3_HEADERS_FOUND CACHE)
# Check the headers explicitly to make sure the cpu-only build succeeds
CHECK_INCLUDE_FILE_CXX(nvtx3/nvToolsExt.h NVTX3_HEADERS_FOUND)
set(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_ORIG})
endif()

# ##################################################################################################
# * Configure tests function-------------------------------------------------------------

Expand All @@ -141,8 +156,13 @@ function(ConfigureAnnBench)
add_dependencies(${BENCH_NAME} ANN_BENCH)
else()
add_executable(${BENCH_NAME} ${ConfigureAnnBench_PATH})
target_compile_definitions(${BENCH_NAME} PRIVATE ANN_BENCH_BUILD_MAIN)
target_link_libraries(${BENCH_NAME} PRIVATE benchmark::benchmark)
target_compile_definitions(
${BENCH_NAME} PRIVATE ANN_BENCH_BUILD_MAIN
$<$<BOOL:${NVTX3_HEADERS_FOUND}>:ANN_BENCH_NVTX3_HEADERS_FOUND>
)
target_link_libraries(
${BENCH_NAME} PRIVATE benchmark::benchmark $<$<BOOL:${NVTX3_HEADERS_FOUND}>:CUDA::nvtx3>
)
endif()

target_link_libraries(
Expand Down Expand Up @@ -340,8 +360,16 @@ if(RAFT_ANN_BENCH_SINGLE_EXE)
target_include_directories(ANN_BENCH PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})

target_link_libraries(
ANN_BENCH PRIVATE nlohmann_json::nlohmann_json benchmark_static dl -static-libgcc
-static-libstdc++ CUDA::nvtx3
ANN_BENCH
PRIVATE raft::raft
nlohmann_json::nlohmann_json
benchmark_static
dl
-static-libgcc
fmt::fmt-header-only
spdlog::spdlog_header_only
-static-libstdc++
$<$<BOOL:${NVTX3_HEADERS_FOUND}>:CUDA::nvtx3>
)
set_target_properties(
ANN_BENCH
Expand All @@ -355,17 +383,10 @@ if(RAFT_ANN_BENCH_SINGLE_EXE)
BUILD_RPATH "\$ORIGIN"
INSTALL_RPATH "\$ORIGIN"
)

# Disable NVTX when the nvtx3 headers are missing
set(_CMAKE_REQUIRED_INCLUDES_ORIG ${CMAKE_REQUIRED_INCLUDES})
get_target_property(CMAKE_REQUIRED_INCLUDES ANN_BENCH INCLUDE_DIRECTORIES)
CHECK_INCLUDE_FILE_CXX(nvtx3/nvToolsExt.h NVTX3_HEADERS_FOUND)
set(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_ORIG})
target_compile_definitions(
ANN_BENCH
PRIVATE
$<$<BOOL:${CUDAToolkit_FOUND}>:ANN_BENCH_LINK_CUDART="libcudart.so.${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR}.${CUDAToolkit_VERSION_PATCH}
">
$<$<BOOL:${CUDAToolkit_FOUND}>:ANN_BENCH_LINK_CUDART="libcudart.so.${CUDAToolkit_VERSION_MAJOR}.${CUDAToolkit_VERSION_MINOR}.${CUDAToolkit_VERSION_PATCH}">
$<$<BOOL:${NVTX3_HEADERS_FOUND}>:ANN_BENCH_NVTX3_HEADERS_FOUND>
)

Expand Down
15 changes: 7 additions & 8 deletions cpp/bench/ann/src/common/ann_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "cuda_stub.hpp" // cudaStream_t

#include <memory>
#include <stdexcept>
#include <string>
#include <vector>
Expand Down Expand Up @@ -64,17 +65,10 @@ inline auto parse_memory_type(const std::string& memory_type) -> MemoryType
}
}

class AlgoProperty {
public:
inline AlgoProperty() {}
inline AlgoProperty(MemoryType dataset_memory_type_, MemoryType query_memory_type_)
: dataset_memory_type(dataset_memory_type_), query_memory_type(query_memory_type_)
{
}
struct AlgoProperty {
MemoryType dataset_memory_type;
// neighbors/distances should have same memory type as queries
MemoryType query_memory_type;
virtual ~AlgoProperty() = default;
};

class AnnBase {
Expand Down Expand Up @@ -125,6 +119,11 @@ class ANN : public AnnBase {
// The client code should call set_search_dataset() before searching,
// and should not release dataset before searching is finished.
virtual void set_search_dataset(const T* /*dataset*/, size_t /*nrow*/){};

/**
* Make a shallow copy of the ANN wrapper that shares the resources and ensures thread-safe access
* to them. */
virtual auto copy() -> std::unique_ptr<ANN<T>> = 0;
};

} // namespace raft::bench::ann
Expand Down
Loading

0 comments on commit d19e28c

Please sign in to comment.