Skip to content

Commit 448b624

Browse files
authored
Log UMAP arrays at trace verbosity level. (#6274)
Reduce the UMAP logging verbosity. Avoids printing potentially large arrays.
1 parent f60b5f0 commit 448b624

3 files changed

Lines changed: 13 additions & 13 deletions

File tree

cpp/src/umap/fuzzy_simpl_set/naive.cuh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -313,13 +313,13 @@ void launcher(int n,
313313

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

316+
CUML_LOG_DEBUG("Smooth kNN Distances");
316317
// check for logging in order to avoid the potentially costly `arr2Str` call!
317-
if (ML::default_logger().should_log(ML::level_enum::debug)) {
318-
CUML_LOG_DEBUG("Smooth kNN Distances");
318+
if (ML::default_logger().should_log(ML::level_enum::trace)) {
319319
auto str = raft::arr2Str(sigmas.data(), 25, "sigmas", stream);
320-
CUML_LOG_DEBUG("%s", str.c_str());
320+
CUML_LOG_TRACE("%s", str.c_str());
321321
str = raft::arr2Str(rhos.data(), 25, "rhos", stream);
322-
CUML_LOG_DEBUG("%s", str.c_str());
322+
CUML_LOG_TRACE("%s", str.c_str());
323323
}
324324

325325
RAFT_CUDA_TRY(cudaPeekAtLastError());
@@ -342,11 +342,11 @@ void launcher(int n,
342342
n_neighbors);
343343
RAFT_CUDA_TRY(cudaPeekAtLastError());
344344

345-
if (ML::default_logger().should_log(ML::level_enum::debug)) {
346-
CUML_LOG_DEBUG("Compute Membership Strength");
345+
CUML_LOG_DEBUG("Compute Membership Strength");
346+
if (ML::default_logger().should_log(ML::level_enum::trace)) {
347347
std::stringstream ss;
348348
ss << in;
349-
CUML_LOG_DEBUG(ss.str().c_str());
349+
CUML_LOG_TRACE(ss.str().c_str());
350350
}
351351

352352
/**

cpp/src/umap/simpl_set_embed/algo.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,10 @@ void launcher(
341341

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

344-
if (ML::default_logger().should_log(ML::level_enum::debug)) {
344+
if (ML::default_logger().should_log(ML::level_enum::trace)) {
345345
std::stringstream ss;
346346
ss << raft::arr2Str(epochs_per_sample.data(), out.nnz, "epochs_per_sample", stream);
347-
CUML_LOG_DEBUG(ss.str().c_str());
347+
CUML_LOG_TRACE(ss.str().c_str());
348348
}
349349

350350
optimize_layout<TPB_X, T>(embedding,

cpp/src/umap/supervised.cuh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,15 +301,15 @@ void perform_general_intersection(const raft::handle_t& handle,
301301
handle, y_inputs, y_inputs, knn_graph, params->target_n_neighbors, params, stream);
302302
RAFT_CUDA_TRY(cudaPeekAtLastError());
303303

304-
if (ML::default_logger().should_log(ML::level_enum::debug)) {
305-
CUML_LOG_DEBUG("Target kNN Graph");
304+
CUML_LOG_DEBUG("Target kNN Graph");
305+
if (ML::default_logger().should_log(ML::level_enum::trace)) {
306306
std::stringstream ss1, ss2;
307307
ss1 << raft::arr2Str(
308308
y_knn_indices.data(), rgraph_coo->n_rows * params->target_n_neighbors, "knn_indices", stream);
309-
CUML_LOG_DEBUG("%s", ss1.str().c_str());
309+
CUML_LOG_TRACE("%s", ss1.str().c_str());
310310
ss2 << raft::arr2Str(
311311
y_knn_dists.data(), rgraph_coo->n_rows * params->target_n_neighbors, "knn_dists", stream);
312-
CUML_LOG_DEBUG("%s", ss2.str().c_str());
312+
CUML_LOG_TRACE("%s", ss2.str().c_str());
313313
}
314314

315315
/**

0 commit comments

Comments
 (0)