Skip to content

Commit

Permalink
Log UMAP arrays at trace verbosity level.
Browse files Browse the repository at this point in the history
  • Loading branch information
csadorf committed Jan 29, 2025
1 parent 9b13d90 commit 6cccf26
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions cpp/src/umap/fuzzy_simpl_set/naive.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,12 @@ void launcher(int n,
raft::sparse::COO<value_t> in(stream, n * n_neighbors, n, n);

// check for logging in order to avoid the potentially costly `arr2Str` call!
if (ML::default_logger().should_log(ML::level_enum::debug)) {
CUML_LOG_DEBUG("Smooth kNN Distances");
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_DEBUG("%s", str.c_str());
CUML_LOG_TRACE("%s", str.c_str());
str = raft::arr2Str(rhos.data(), 25, "rhos", stream);
CUML_LOG_DEBUG("%s", str.c_str());
CUML_LOG_TRACE("%s", str.c_str());
}

RAFT_CUDA_TRY(cudaPeekAtLastError());
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/umap/simpl_set_embed/algo.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ void launcher(

make_epochs_per_sample(out.vals(), out.nnz, n_epochs, epochs_per_sample.data(), stream);

if (ML::default_logger().should_log(ML::level_enum::debug)) {
if (ML::default_logger().should_log(ML::level_enum::trace)) {
std::stringstream ss;
ss << raft::arr2Str(epochs_per_sample.data(), out.nnz, "epochs_per_sample", stream);
CUML_LOG_DEBUG(ss.str().c_str());
Expand Down
8 changes: 4 additions & 4 deletions cpp/src/umap/supervised.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -301,15 +301,15 @@ 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());

if (ML::default_logger().should_log(ML::level_enum::debug)) {
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);
CUML_LOG_DEBUG("%s", ss1.str().c_str());
CUML_LOG_TRACE("%s", ss1.str().c_str());
ss2 << raft::arr2Str(
y_knn_dists.data(), rgraph_coo->n_rows * params->target_n_neighbors, "knn_dists", stream);
CUML_LOG_DEBUG("%s", ss2.str().c_str());
CUML_LOG_TRACE("%s", ss2.str().c_str());
}

/**
Expand Down

0 comments on commit 6cccf26

Please sign in to comment.