Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
33 changes: 17 additions & 16 deletions cpp/src/solver/cd.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2018-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -213,8 +213,9 @@ int cdFit(const raft::handle_t& handle,
rmm::device_uvector<ConvState<math_t>> convStateBuf(1, stream);
auto convStateLoc = convStateBuf.data();

rmm::device_scalar<math_t> cublas_alpha(1.0, stream);
rmm::device_scalar<math_t> cublas_beta(0.0, stream);
// Passed to gemv in host pointer mode, so cuBLAS reads them during the call.
math_t const cublas_alpha = 1.0;
math_t const cublas_beta = 0.0;
Comment thread
betatim marked this conversation as resolved.

int n_iter = 0;
while (n_iter < epochs) {
Expand All @@ -238,19 +239,19 @@ int cdFit(const raft::handle_t& handle,
handle, n_rows, coef_loc, input_col_loc, 1, residual.data(), 1, stream);

// coef[ci] = dot(X[:, ci], residual[:])
raft::linalg::gemv<math_t, true>(handle,
false,
1,
n_rows,
cublas_alpha.data(),
input_col_loc,
1,
residual.data(),
1,
cublas_beta.data(),
coef_loc,
1,
stream);
raft::linalg::gemv<math_t, false>(handle,
false,
1,
n_rows,
&cublas_alpha,
input_col_loc,
1,
residual.data(),
1,
&cublas_beta,
coef_loc,
1,
stream);

// Calculate the new coefficient that minimizes f along coordinate line ci
// coef[ci] = SoftTreshold(dot(X[:, ci], residual[:]), l1_alpha) / dot(X[:, ci], X[:, ci]))
Expand Down
11 changes: 7 additions & 4 deletions cpp/src/tsne/fft_tsne.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,13 @@ std::pair<value_t, value_t> min_max(const value_t* Y, const value_idx n, cudaStr
rmm::device_scalar<value_t> min_d(stream);
rmm::device_scalar<value_t> max_d(stream);

value_t val = std::numeric_limits<value_t>::max();
min_d.set_value_async(val, stream);
val = std::numeric_limits<value_t>::lowest();
max_d.set_value_async(val, stream);
// Each copy needs its own host source, alive and unmodified until the stream
// is synchronized below, because rmm may defer reading it until the stream
// reaches the copy.
value_t const min_init = std::numeric_limits<value_t>::max();
value_t const max_init = std::numeric_limits<value_t>::lowest();
min_d.set_value_async(min_init, stream);
max_d.set_value_async(max_init, stream);

auto nthreads = 256;
auto nblocks = raft::ceildiv(n, (value_idx)nthreads);
Expand Down
5 changes: 3 additions & 2 deletions cpp/src/umap/simpl_set_embed/algo.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -174,7 +174,8 @@ bool check_outliers(const int* rows, int m, nnz_t nnz, int threshold, cudaStream
dim3 blk(TPB_X, 1, 1);
compute_degrees_kernel<<<grid_nnz, blk, 0, stream>>>(rows, nnz, graph_degree_head.data());

rmm::device_scalar<bool> has_outlier_d(0, stream); // initialize to 0
rmm::device_scalar<bool> has_outlier_d(stream);
raft::linalg::zero(has_outlier_d.data(), 1, stream);

Comment thread
jcrist marked this conversation as resolved.
dim3 grid_head_n(raft::ceildiv(static_cast<nnz_t>(m), static_cast<nnz_t>(TPB_X)), 1, 1);
check_threshold_kernel<<<grid_head_n, blk, 0, stream>>>(
Expand Down
Loading