diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index e176f802bf..0e9dfa04d0 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -602,6 +602,8 @@ if(BUILD_CUML_CPP_LIBRARY) # These are always private: list(APPEND _cuml_cpp_private_libs raft::raft + rmm::rmm_logger_impl + raft::raft_logger_impl $ $<$:CUDA::cufft${_ctk_fft_static_suffix}> ${TREELITE_LIBS} @@ -629,7 +631,6 @@ if(BUILD_CUML_CPP_LIBRARY) PUBLIC rmm::rmm rmm::rmm_logger ${CUVS_LIB} ${_cuml_cpp_public_libs} PRIVATE ${_cuml_cpp_private_libs} - rmm::rmm_logger_impl ) # If we export the libdmlc symbols, they can lead to weird crashes with other diff --git a/cpp/bench/sg/kmeans.cu b/cpp/bench/sg/kmeans.cu index e974163599..f6524b245a 100644 --- a/cpp/bench/sg/kmeans.cu +++ b/cpp/bench/sg/kmeans.cu @@ -92,7 +92,7 @@ std::vector getInputs() p.kmeans.init = ML::kmeans::KMeansParams::InitMethod(0); p.kmeans.max_iter = 300; p.kmeans.tol = 1e-4; - p.kmeans.verbosity = RAFT_LEVEL_INFO; + p.kmeans.verbosity = raft::level_enum::info; p.kmeans.metric = cuvs::distance::DistanceType::L2Expanded; p.kmeans.rng_state = raft::random::RngState(p.blobs.seed); p.kmeans.inertia_check = true; diff --git a/cpp/test/CMakeLists.txt b/cpp/test/CMakeLists.txt index e61a32cc3b..0576217965 100644 --- a/cpp/test/CMakeLists.txt +++ b/cpp/test/CMakeLists.txt @@ -57,8 +57,9 @@ function(ConfigureTest) $<$:CUDA::cufft${_ctk_static_suffix_cufft}> rmm::rmm rmm::rmm_logger - rmm::rmm_logger_impl raft::raft + raft::raft_logger + test_logger_impls GTest::gtest GTest::gtest_main GTest::gmock @@ -107,6 +108,8 @@ function(ConfigureTest) endfunction() +add_library(test_logger_impls OBJECT) +target_link_libraries(test_logger_impls PRIVATE rmm::rmm_logger_impl raft::raft_logger_impl) ############################################################################## # - build ml_test executable ------------------------------------------------- diff --git a/python/cuml/cuml/cluster/kmeans.pyx b/python/cuml/cuml/cluster/kmeans.pyx index 8d4d9ffe99..6be09f6912 100644 --- a/python/cuml/cuml/cluster/kmeans.pyx +++ b/python/cuml/cuml/cluster/kmeans.pyx @@ -36,6 +36,10 @@ IF GPUBUILD == 1: from cuml.metrics.distance_type cimport DistanceType from cuml.cluster.kmeans_utils cimport params as KMeansParams from cuml.cluster.kmeans_utils cimport KMeansPlusPlus, Random, Array + from cuml.cluster cimport kmeans_utils + + # Avoid potential future conflicts with cuml's level enum + ctypedef kmeans_utils.level_enum raft_level_enum from cuml.internals.array import CumlArray from cuml.common.array_descriptor import CumlArrayDescriptor @@ -205,7 +209,7 @@ class KMeans(UniversalBase, params.init = self._params_init params.max_iter = self.max_iter params.tol = self.tol - params.verbosity = self.verbose + params.verbosity = (self.verbose) params.rng_state.seed = self.random_state params.metric = DistanceType.L2Expanded # distance metric as squared L2: @todo - support other metrics # noqa: E501 params.batch_samples = self.max_samples_per_batch diff --git a/python/cuml/cuml/cluster/kmeans_utils.pxd b/python/cuml/cuml/cluster/kmeans_utils.pxd index c4c10c4b74..841ea2d3dc 100644 --- a/python/cuml/cuml/cluster/kmeans_utils.pxd +++ b/python/cuml/cuml/cluster/kmeans_utils.pxd @@ -24,6 +24,18 @@ cdef extern from "cuml/cluster/kmeans.hpp" namespace \ "cuvs::cluster::kmeans::params": enum InitMethod: KMeansPlusPlus, Random, Array + +cdef extern from "raft/core/logger.hpp" namespace "raft": + cdef enum class level_enum: + trace + debug + info + warn + error + critical + off + n_levels + cdef extern from "cuvs/cluster/kmeans.hpp" namespace \ "cuvs::cluster::kmeans": cdef struct params: @@ -31,7 +43,7 @@ cdef extern from "cuvs/cluster/kmeans.hpp" namespace \ InitMethod init int max_iter, double tol, - int verbosity, + level_enum verbosity, RngState rng_state, DistanceType metric, int n_init,