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

Removing code that explicitly compares equality of rmm memory resources #2047

Merged
merged 14 commits into from
Dec 9, 2023
Prev Previous commit
CLeaning up more issues from pool guard
  • Loading branch information
cjnolet committed Dec 9, 2023
commit 36f42b81cb000ae58eb47621847b8bdc0055ba9b
1 change: 1 addition & 0 deletions cpp/include/raft/matrix/detail/select_k-inl.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ void select_k(raft::resources const& handle,
common::nvtx::range<common::nvtx::domain::raft> fun_scope(
"matrix::select_k(batch_size = %zu, len = %zu, k = %d)", batch_size, len, k);

if (mr == nullptr) { mr = rmm::mr::get_current_device_resource(); }
auto stream = raft::resource::get_cuda_stream(handle);
auto algo = choose_select_k_algorithm(batch_size, len, k);

Expand Down
2 changes: 2 additions & 0 deletions cpp/include/raft/matrix/detail/select_radix.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -835,6 +835,8 @@ void radix_topk(const T* in,
static_assert(calc_num_passes<T, BitsPerPass>() > 1);
constexpr int num_buckets = calc_num_buckets<BitsPerPass>();

if (mr == nullptr) { mr = rmm::mr::get_current_device_resource(); }

auto kernel = radix_kernel<T, IdxT, BitsPerPass, BlockSize, false>;
const size_t max_chunk_size =
calc_chunk_size<T, IdxT, BlockSize>(batch_size, len, sm_cnt, kernel, false);
Expand Down
2 changes: 2 additions & 0 deletions cpp/include/raft/matrix/detail/select_warpsort.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,8 @@ void select_k_(int num_of_block,
rmm::cuda_stream_view stream,
rmm::mr::device_memory_resource* mr = nullptr)
{
if (mr == nullptr) { mr = rmm::mr::get_current_device_resource(); }

rmm::device_uvector<T> tmp_val(num_of_block * k * batch_size, stream, mr);
rmm::device_uvector<IdxT> tmp_idx(num_of_block * k * batch_size, stream, mr);

Expand Down