Skip to content

Commit

Permalink
Only log arrays at trace level.
Browse files Browse the repository at this point in the history
  • Loading branch information
csadorf committed Jan 29, 2025
1 parent 2ef5454 commit c6b6e36
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cpp/src/umap/fuzzy_simpl_set/naive.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,9 @@ void launcher(int n,

raft::sparse::COO<value_t> in(stream, n * n_neighbors, n, n);

CUML_LOG_DEBUG("Smooth kNN Distances");
// check for logging in order to avoid the potentially costly `arr2Str` call!
if (ML::default_logger().should_log(ML::level_enum::trace)) {
CUML_LOG_TRACE("Smooth kNN Distances");
auto str = raft::arr2Str(sigmas.data(), 25, "sigmas", stream);
CUML_LOG_TRACE("%s", str.c_str());
str = raft::arr2Str(rhos.data(), 25, "rhos", stream);
Expand All @@ -342,8 +342,8 @@ void launcher(int n,
n_neighbors);
RAFT_CUDA_TRY(cudaPeekAtLastError());

CUML_LOG_DEBUG("Compute Membership Strength");
if (ML::default_logger().should_log(ML::level_enum::trace)) {
CUML_LOG_TRACE("Compute Membership Strength");
std::stringstream ss;
ss << in;
CUML_LOG_TRACE(ss.str().c_str());
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/umap/supervised.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ void perform_general_intersection(const raft::handle_t& handle,
handle, y_inputs, y_inputs, knn_graph, params->target_n_neighbors, params, stream);
RAFT_CUDA_TRY(cudaPeekAtLastError());

CUML_LOG_DEBUG("Target kNN Graph");
if (ML::default_logger().should_log(ML::level_enum::trace)) {
CUML_LOG_TRACE("Target kNN Graph");
std::stringstream ss1, ss2;
ss1 << raft::arr2Str(
y_knn_indices.data(), rgraph_coo->n_rows * params->target_n_neighbors, "knn_indices", stream);
Expand Down

0 comments on commit c6b6e36

Please sign in to comment.