Skip to content
Closed
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
9 changes: 4 additions & 5 deletions cpp/src/neighbors/detail/nn_descent.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -2751,8 +2751,6 @@ void GNND<Data_t, Index_t>::build(Data_t* data,
raft::copy(res, d_list_sizes_old_.view(), graph_.h_list_sizes_old.view());
raft::resource::sync_stream(res);

std::thread update_and_sample_thread(update_and_sample, it);

RAFT_LOG_DEBUG("# GNND iteration: %lu / %lu", it + 1, build_config_.max_iterations);

// Reuse dists_buffer_ to save GPU memory. graph_buffer_ cannot be reused, because it
Expand Down Expand Up @@ -2786,7 +2784,8 @@ void GNND<Data_t, Index_t>::build(Data_t* data,
THROW("NN_DESCENT cannot be run for __CUDA_ARCH__ < 700");
}

update_and_sample_thread.join();
// Overlaps with the device work enqueued above, which uses disjoint buffers.
update_and_sample(it > 0);

if (update_counter_ == -1) { break; }
raft::copy(res, graph_host_buffer_.view(), graph_buffer_.view());
Expand Down Expand Up @@ -2897,7 +2896,6 @@ void GNND<Data_t, Index_t>::build(
raft::copy(res, d_list_sizes_old_.view(), graph_.h_list_sizes_old.view());
raft::resource::sync_stream(res);

std::thread update_and_sample_thread(update_and_sample, it);
RAFT_LOG_DEBUG("# GNND iteration: %lu / %lu", it + 1, build_config_.max_iterations);

static_assert(DEGREE_ON_DEVICE * sizeof(*(dists_buffer_.data_handle())) >=
Expand All @@ -2914,7 +2912,8 @@ void GNND<Data_t, Index_t>::build(
stream);

local_join(stream, dataset, dist_epilogue);
update_and_sample_thread.join();
// Overlaps with the device work enqueued above, which uses disjoint buffers.
update_and_sample(it > 0);
if (update_counter_ == -1) { break; }
raft::copy(res, graph_host_buffer_.view(), graph_buffer_.view());
raft::copy(res, dists_host_buffer_.view(), dists_buffer_.view());
Expand Down
Loading