Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log UMAP arrays at trace verbosity level. #6274

Open
wants to merge 6 commits into
base: branch-25.02
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 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 All @@ -342,11 +342,11 @@ void launcher(int n,
n_neighbors);
RAFT_CUDA_TRY(cudaPeekAtLastError());

if (ML::default_logger().should_log(ML::level_enum::debug)) {
CUML_LOG_DEBUG("Compute Membership Strength");
if (ML::default_logger().should_log(ML::level_enum::trace)) {
CUML_LOG_TRACE("Compute Membership Strength");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep these at DEBUG level but put any actual arrays at trace level.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in c6b6e36 .

std::stringstream ss;
ss << in;
CUML_LOG_DEBUG(ss.str().c_str());
CUML_LOG_TRACE(ss.str().c_str());
}

/**
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/umap/simpl_set_embed/algo.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,10 @@ 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());
CUML_LOG_TRACE(ss.str().c_str());
}

optimize_layout<TPB_X, T>(embedding,
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
Loading