Skip to content

Commit

Permalink
Merge branch 'branch-25.02' into remove-unused-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored Dec 31, 2024
2 parents f9ffb6f + 55c5a7f commit 75facc7
Show file tree
Hide file tree
Showing 52 changed files with 156 additions and 120 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
6 changes: 4 additions & 2 deletions conda/environments/all_cuda-118_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ channels:
- conda-forge
- nvidia
dependencies:
- breathe
- breathe>=4.35.0
- c-compiler
- clang
- clang-tools=16.0.6
Expand Down Expand Up @@ -44,7 +44,6 @@ dependencies:
- nvcc_linux-aarch64=11.8
- openblas
- pre-commit
- pydata-sphinx-theme
- pylibraft==25.2.*,>=0.0.0a0
- pytest-cov
- pytest==7.*
Expand All @@ -55,5 +54,8 @@ dependencies:
- scikit-learn
- sphinx-copybutton
- sphinx-markdown-tables
- sphinx>=8.0.0
- sysroot_linux-aarch64==2.17
- pip:
- nvidia-sphinx-theme
name: all_cuda-118_arch-aarch64
6 changes: 4 additions & 2 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ channels:
- conda-forge
- nvidia
dependencies:
- breathe
- breathe>=4.35.0
- c-compiler
- clang
- clang-tools=16.0.6
Expand Down Expand Up @@ -44,7 +44,6 @@ dependencies:
- nvcc_linux-64=11.8
- openblas
- pre-commit
- pydata-sphinx-theme
- pylibraft==25.2.*,>=0.0.0a0
- pytest-cov
- pytest==7.*
Expand All @@ -55,5 +54,8 @@ dependencies:
- scikit-learn
- sphinx-copybutton
- sphinx-markdown-tables
- sphinx>=8.0.0
- sysroot_linux-64==2.17
- pip:
- nvidia-sphinx-theme
name: all_cuda-118_arch-x86_64
6 changes: 4 additions & 2 deletions conda/environments/all_cuda-125_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ channels:
- conda-forge
- nvidia
dependencies:
- breathe
- breathe>=4.35.0
- c-compiler
- clang
- clang-tools=16.0.6
Expand Down Expand Up @@ -40,7 +40,6 @@ dependencies:
- numpydoc
- openblas
- pre-commit
- pydata-sphinx-theme
- pylibraft==25.2.*,>=0.0.0a0
- pytest-cov
- pytest==7.*
Expand All @@ -51,5 +50,8 @@ dependencies:
- scikit-learn
- sphinx-copybutton
- sphinx-markdown-tables
- sphinx>=8.0.0
- sysroot_linux-aarch64==2.17
- pip:
- nvidia-sphinx-theme
name: all_cuda-125_arch-aarch64
6 changes: 4 additions & 2 deletions conda/environments/all_cuda-125_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ channels:
- conda-forge
- nvidia
dependencies:
- breathe
- breathe>=4.35.0
- c-compiler
- clang
- clang-tools=16.0.6
Expand Down Expand Up @@ -40,7 +40,6 @@ dependencies:
- numpydoc
- openblas
- pre-commit
- pydata-sphinx-theme
- pylibraft==25.2.*,>=0.0.0a0
- pytest-cov
- pytest==7.*
Expand All @@ -51,5 +50,8 @@ dependencies:
- scikit-learn
- sphinx-copybutton
- sphinx-markdown-tables
- sphinx>=8.0.0
- sysroot_linux-64==2.17
- pip:
- 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
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
3 changes: 3 additions & 0 deletions cpp/include/cuvs/neighbors/cagra.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#pragma once

#include <cuvs/core/c_api.h>
#include <cuvs/distance/distance.h>
#include <dlpack/dlpack.h>
#include <stdbool.h>
#include <stdint.h>
Expand Down Expand Up @@ -87,6 +88,8 @@ typedef struct cuvsCagraCompressionParams* cuvsCagraCompressionParams_t;
*
*/
struct cuvsCagraIndexParams {
/** Distance type. */
cuvsDistanceType metric;
/** Degree of input graph for pruning. */
size_t intermediate_graph_degree;
/** Degree of output graph. */
Expand Down
12 changes: 5 additions & 7 deletions cpp/src/cluster/detail/kmeans.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <raft/core/device_mdarray.hpp>
#include <raft/core/host_mdarray.hpp>
#include <raft/core/kvp.hpp>
#include <raft/core/logger-ext.hpp>
#include <raft/core/logger.hpp>
#include <raft/core/mdarray.hpp>
#include <raft/core/operators.hpp>
#include <raft/core/resource/cuda_stream.hpp>
Expand Down Expand Up @@ -56,8 +56,6 @@

namespace cuvs::cluster::kmeans::detail {

// TODO(cjnolet): RAFT_NAME needs to be removed and the raft::logger fixed to not require it
static const std::string RAFT_NAME = "raft";
static const std::string CUVS_NAME = "cuvs";

// =========================================================
Expand Down Expand Up @@ -373,7 +371,7 @@ void kmeans_fit_main(raft::resources const& handle,
rmm::device_uvector<char>& workspace)
{
raft::common::nvtx::range<cuvs::common::nvtx::domain::cuvs> fun_scope("kmeans_fit_main");
raft::logger::get(RAFT_NAME).set_level(params.verbosity);
raft::default_logger().set_level(params.verbosity);
cudaStream_t stream = raft::resource::get_cuda_stream(handle);
auto n_samples = X.extent(0);
auto n_features = X.extent(1);
Expand Down Expand Up @@ -879,7 +877,7 @@ void kmeans_fit(raft::resources const& handle,
pams.n_clusters);
}

raft::logger::get(RAFT_NAME).set_level(pams.verbosity);
raft::default_logger().set_level(pams.verbosity);

// Allocate memory
rmm::device_uvector<char> workspace(0, stream);
Expand Down Expand Up @@ -1025,7 +1023,7 @@ void kmeans_predict(raft::resources const& handle,
RAFT_EXPECTS(centroids.extent(1) == n_features,
"invalid parameter (centroids.extent(1) != n_features)");

raft::logger::get(RAFT_NAME).set_level(pams.verbosity);
raft::default_logger().set_level(pams.verbosity);
auto metric = pams.metric;

// Allocate memory
Expand Down Expand Up @@ -1218,7 +1216,7 @@ void kmeans_transform(raft::resources const& handle,
raft::device_matrix_view<DataT> X_new)
{
raft::common::nvtx::range<cuvs::common::nvtx::domain::cuvs> fun_scope("kmeans_transform");
raft::logger::get(RAFT_NAME).set_level(pams.verbosity);
raft::default_logger().set_level(pams.verbosity);
cudaStream_t stream = raft::resource::get_cuda_stream(handle);
auto n_samples = X.extent(0);
auto n_features = X.extent(1);
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/cluster/detail/kmeans_auto_find_k.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <raft/core/device_mdspan.hpp>
#include <raft/core/error.hpp>
#include <raft/core/host_mdarray.hpp>
#include <raft/core/logger-ext.hpp>
#include <raft/core/logger.hpp>
#include <raft/core/resource/cuda_stream.hpp>
#include <raft/core/resources.hpp>
#include <raft/stats/dispersion.cuh>
Expand Down Expand Up @@ -230,4 +230,4 @@ void find_k(raft::resources const& handle,
n_iter);
}
}
} // namespace cuvs::cluster::kmeans::detail
} // namespace cuvs::cluster::kmeans::detail
4 changes: 2 additions & 2 deletions cpp/src/cluster/detail/kmeans_balanced.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@

#include <cuvs/distance/distance.hpp>
#include <raft/core/cudart_utils.hpp>
#include <raft/core/logger-ext.hpp>
#include <raft/core/logger-macros.hpp>
#include <raft/core/logger.hpp>
#include <raft/core/operators.hpp>
#include <raft/core/resource/cuda_stream.hpp>
#include <raft/core/resource/device_memory_resource.hpp>
Expand Down Expand Up @@ -59,7 +60,6 @@

namespace cuvs::cluster::kmeans::detail {

static const std::string RAFT_NAME = "raft";
constexpr static inline float kAdjustCentersWeight = 7.0f;

/**
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/cluster/detail/kmeans_common.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <raft/core/device_mdarray.hpp>
#include <raft/core/device_mdspan.hpp>
#include <raft/core/kvp.hpp>
#include <raft/core/logger-ext.hpp>
#include <raft/core/logger.hpp>
#include <raft/core/mdarray.hpp>
#include <raft/core/operators.hpp>
#include <raft/core/resource/cuda_stream.hpp>
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/distance/detail/sparse/coo_spmv_kernel.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#pragma once

#include <raft/core/detail/macros.hpp>

#include <cub/block/block_load.cuh>
#include <cub/block/block_radix_sort.cuh>
#include <cub/block/block_store.cuh>
Expand Down
Loading

0 comments on commit 75facc7

Please sign in to comment.