Skip to content

Commit

Permalink
Merge branch 'branch-25.02' into datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
cjnolet authored Jan 8, 2025
2 parents 7996921 + 2a10353 commit f3c66bd
Show file tree
Hide file tree
Showing 53 changed files with 372 additions and 299 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ concurrency:
jobs:
pr-builder:
needs:
- check-nightly-ci
- changed-files
- checks
- conda-cpp-build
Expand All @@ -29,6 +30,18 @@ jobs:
if: always()
with:
needs: ${{ toJSON(needs) }}
check-nightly-ci:
# Switch to ubuntu-latest once it defaults to a version of Ubuntu that
# provides at least Python 3.11 (see
# https://docs.python.org/3/library/datetime.html#datetime.date.fromisoformat)
runs-on: ubuntu-24.04
env:
RAPIDS_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Check if nightly CI is passing
uses: rapidsai/shared-actions/check_nightly_success/dispatch@main
with:
repo: cuvs
changed-files:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
Expand Down
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ repos:
[.](cmake|cpp|cu|cuh|h|hpp|sh|pxd|py|pyx|rs)$|
CMakeLists[.]txt$|
CMakeLists_standalone[.]txt$|
meta[.]yaml$|
setup[.]cfg$
meta[.]yaml$
exclude: |
(?x)
docs/source/sphinxext/github_link\.py|
Expand Down
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 @@ -7,6 +7,7 @@ channels:
- conda-forge
- nvidia
dependencies:
- breathe>=4.35.0
- c-compiler
- clang
- clang-tools=16.0.6
Expand Down Expand Up @@ -56,6 +57,5 @@ dependencies:
- sphinx>=8.0.0
- sysroot_linux-aarch64==2.17
- pip:
- breathe>=4.35.0
- nvidia-sphinx-theme
name: all_cuda-118_arch-aarch64
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 @@ -7,6 +7,7 @@ channels:
- conda-forge
- nvidia
dependencies:
- breathe>=4.35.0
- c-compiler
- clang
- clang-tools=16.0.6
Expand Down Expand Up @@ -56,6 +57,5 @@ dependencies:
- sphinx>=8.0.0
- sysroot_linux-64==2.17
- pip:
- breathe>=4.35.0
- nvidia-sphinx-theme
name: all_cuda-118_arch-x86_64
2 changes: 1 addition & 1 deletion conda/environments/all_cuda-125_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ channels:
- conda-forge
- nvidia
dependencies:
- breathe>=4.35.0
- c-compiler
- clang
- clang-tools=16.0.6
Expand Down Expand Up @@ -52,6 +53,5 @@ dependencies:
- sphinx>=8.0.0
- sysroot_linux-aarch64==2.17
- pip:
- breathe>=4.35.0
- nvidia-sphinx-theme
name: all_cuda-125_arch-aarch64
2 changes: 1 addition & 1 deletion conda/environments/all_cuda-125_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ channels:
- conda-forge
- nvidia
dependencies:
- breathe>=4.35.0
- c-compiler
- clang
- clang-tools=16.0.6
Expand Down Expand Up @@ -52,6 +53,5 @@ dependencies:
- sphinx>=8.0.0
- sysroot_linux-64==2.17
- pip:
- breathe>=4.35.0
- nvidia-sphinx-theme
name: all_cuda-125_arch-x86_64
11 changes: 6 additions & 5 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -486,13 +486,14 @@ if(BUILD_SHARED_LIBS)
"$<$<COMPILE_LANGUAGE:CUDA>:${CUVS_CUDA_FLAGS}>"
)
target_link_libraries(
cuvs_objs PUBLIC raft::raft rmm::rmm rmm::rmm_logger ${CUVS_CTK_MATH_DEPENDENCIES}
$<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_CXX>
PRIVATE rmm::rmm_logger_impl
cuvs_objs
PUBLIC raft::raft rmm::rmm rmm::rmm_logger ${CUVS_CTK_MATH_DEPENDENCIES}
$<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_CXX>
PRIVATE rmm::rmm_logger_impl raft::raft_logger_impl
)

add_library(cuvs SHARED $<FILTER:$<TARGET_OBJECTS:cuvs_objs>,EXCLUDE,rmm.*logger>)
add_library(cuvs_static STATIC $<FILTER:$<TARGET_OBJECTS:cuvs_objs>,EXCLUDE,rmm.*logger>)
add_library(cuvs_static STATIC $<FILTER:$<TARGET_OBJECTS:cuvs_objs>,EXCLUDE,rmm.*logger>)

target_compile_options(
cuvs INTERFACE $<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>:--expt-extended-lambda
Expand Down Expand Up @@ -704,7 +705,7 @@ target_compile_definitions(cuvs::cuvs INTERFACE $<$<BOOL:${CUVS_NVTX}>:NVTX_ENAB
target_link_libraries(
cuvs_c
PUBLIC cuvs::cuvs ${CUVS_CTK_MATH_DEPENDENCIES}
PRIVATE raft::raft rmm::rmm_logger_impl
PRIVATE raft::raft rmm::rmm_logger_impl raft::raft_logger_impl
)

# ensure CUDA symbols aren't relocated to the middle of the debug build binaries
Expand Down
21 changes: 15 additions & 6 deletions cpp/bench/ann/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,11 @@ function(ConfigureAnnBench)
PRIVATE ${ConfigureAnnBench_LINKS}
nlohmann_json::nlohmann_json
Threads::Threads
$<TARGET_NAME_IF_EXISTS:raft::raft_logger>
$<$<BOOL:${GPU_BUILD}>:CUDA::cudart_static>
$<TARGET_NAME_IF_EXISTS:OpenMP::OpenMP_CXX>
$<TARGET_NAME_IF_EXISTS:conda_env>
$<TARGET_NAME_IF_EXISTS:cuvs_bench_rmm_logger>
$<TARGET_NAME_IF_EXISTS:cuvs_bench_logger>
)

set_target_properties(
Expand Down Expand Up @@ -175,9 +176,11 @@ function(ConfigureAnnBench)
add_dependencies(CUVS_ANN_BENCH_ALL ${BENCH_NAME})
endfunction()

if(CUVS_FAISS_ENABLE_GPU)
add_library(cuvs_bench_rmm_logger OBJECT)
target_link_libraries(cuvs_bench_rmm_logger PRIVATE rmm::rmm_logger_impl)
if(CUVS_FAISS_ENABLE_GPU OR CUVS_ANN_BENCH_SINGLE_EXE)
add_library(cuvs_bench_logger OBJECT)
target_link_libraries(
cuvs_bench_logger PRIVATE rmm::rmm_logger_impl $<TARGET_NAME_IF_EXISTS:raft::raft_logger>
)
endif()

# ##################################################################################################
Expand Down Expand Up @@ -303,8 +306,14 @@ if(CUVS_ANN_BENCH_SINGLE_EXE)

target_link_libraries(
ANN_BENCH
PRIVATE raft::raft nlohmann_json::nlohmann_json benchmark::benchmark dl fmt::fmt-header-only
spdlog::spdlog_header_only $<$<TARGET_EXISTS:CUDA::nvtx3>:CUDA::nvtx3> rmm::rmm_logger_impl
PRIVATE raft::raft
nlohmann_json::nlohmann_json
benchmark::benchmark
dl
fmt::fmt-header-only
spdlog::spdlog_header_only
$<$<TARGET_EXISTS:CUDA::nvtx3>:CUDA::nvtx3>
cuvs_bench_logger
)
set_target_properties(
ANN_BENCH
Expand Down
31 changes: 11 additions & 20 deletions cpp/bench/ann/src/common/benchmark.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,18 +597,16 @@ inline auto parse_string_flag(const char* arg, const char* pat, std::string& res

inline auto run_main(int argc, char** argv) -> int
{
bool force_overwrite = false;
bool build_mode = false;
bool search_mode = false;
bool no_lap_sync = false;
std::string data_prefix = "data";
std::string index_prefix = "index";
std::string new_override_kv = "";
std::string mode = "latency";
std::string threads_arg_txt = "";
std::vector<int> threads = {1, -1}; // min_thread, max_thread
std::string log_level_str = "";
[[maybe_unused]] int raft_log_level = 0; // raft::logger::get(RAFT_NAME).get_level();
bool force_overwrite = false;
bool build_mode = false;
bool search_mode = false;
bool no_lap_sync = false;
std::string data_prefix = "data";
std::string index_prefix = "index";
std::string new_override_kv = "";
std::string mode = "latency";
std::string threads_arg_txt = "";
std::vector<int> threads = {1, -1}; // min_thread, max_thread
kv_series override_kv{};

char arg0_default[] = "benchmark"; // NOLINT
Expand Down Expand Up @@ -639,12 +637,7 @@ inline auto run_main(int argc, char** argv) -> int
parse_string_flag(argv[i], "--index_prefix", index_prefix) ||
parse_string_flag(argv[i], "--mode", mode) ||
parse_string_flag(argv[i], "--override_kv", new_override_kv) ||
parse_string_flag(argv[i], "--threads", threads_arg_txt) ||
parse_string_flag(argv[i], "--raft_log_level", log_level_str)) {
if (!log_level_str.empty()) {
raft_log_level = std::stoi(log_level_str);
log_level_str = "";
}
parse_string_flag(argv[i], "--threads", threads_arg_txt)) {
if (!threads_arg_txt.empty()) {
auto threads_arg = split(threads_arg_txt, ':');
threads[0] = std::stoi(threads_arg[0]);
Expand Down Expand Up @@ -673,8 +666,6 @@ inline auto run_main(int argc, char** argv) -> int
}
}

// raft::logger::get(RAFT_NAME).set_level(raft_log_level);

Mode metric_objective = Mode::kLatency;
if (mode == "throughput") { metric_objective = Mode::kThroughput; }

Expand Down
2 changes: 1 addition & 1 deletion cpp/cmake/thirdparty/get_raft.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function(find_and_configure_raft)
# Invoke CPM find_package()
#-----------------------------------------------------
rapids_cpm_find(raft ${PKG_VERSION}
GLOBAL_TARGETS raft::raft
GLOBAL_TARGETS raft::raft raft::raft_logger raft::raft_logger_impl
BUILD_EXPORT_SET cuvs-exports
INSTALL_EXPORT_SET cuvs-exports
COMPONENTS ${RAFT_COMPONENTS}
Expand Down
3 changes: 2 additions & 1 deletion cpp/include/cuvs/cluster/kmeans.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <cuvs/distance/distance.hpp>
#include <raft/core/device_mdspan.hpp>
#include <raft/core/host_mdspan.hpp>
#include <raft/core/logger.hpp>
#include <raft/core/resources.hpp>
#include <raft/random/rng_state.hpp>

Expand Down Expand Up @@ -85,7 +86,7 @@ struct params : base_params {
/**
* verbosity level.
*/
int verbosity = RAFT_LEVEL_INFO;
raft::level_enum verbosity = raft::level_enum::info;

/**
* Seed to the random number generator.
Expand Down
Loading

0 comments on commit f3c66bd

Please sign in to comment.