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

Raft Handle Updates to cuGraph #1894

Merged
Merged
Show file tree
Hide file tree
Changes from 11 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# cuGraph 22.02.00 (Date TBD)

Please see https://github.com/rapidsai/cugraph/releases/tag/v22.02.00a for the latest changes to this development branch.

# cuGraph 21.12.00 (Date TBD)

Please see https://github.com/rapidsai/cugraph/releases/tag/v21.12.00a for the latest changes to this development branch.
Expand Down
12 changes: 6 additions & 6 deletions conda/environments/cugraph_dev_cuda11.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ channels:
- conda-forge
dependencies:
- cudatoolkit=11.0
- cudf=21.12.*
- libcudf=21.12.*
- rmm=21.12.*
- librmm=21.12.*
- cudf=22.02.*
- libcudf=22.02.*
- rmm=22.02.*
- librmm=22.02.*
- dask>=2021.09.1
- distributed>=2021.09.1
- dask-cuda=21.12.*
- dask-cudf=21.12.*
- dask-cuda=22.02.*
- dask-cudf=22.02.*
- nccl>=2.9.9
- ucx-py=0.23.*
- ucx-proc=*=gpu
Expand Down
12 changes: 6 additions & 6 deletions conda/environments/cugraph_dev_cuda11.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ channels:
- conda-forge
dependencies:
- cudatoolkit=11.2
- cudf=21.12.*
- libcudf=21.12.*
- rmm=21.12.*
- librmm=21.12.*
- cudf=22.02.*
- libcudf=22.02.*
- rmm=22.02.*
- librmm=22.02.*
- dask>=2021.09.1
- distributed>=2021.09.1
- dask-cuda=21.12.*
- dask-cudf=21.12.*
- dask-cuda=22.02.*
- dask-cudf=22.02.*
- nccl>=2.9.9
- ucx-py=0.23.*
- ucx-proc=*=gpu
Expand Down
12 changes: 6 additions & 6 deletions conda/environments/cugraph_dev_cuda11.4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ channels:
- conda-forge
dependencies:
- cudatoolkit=11.4
- cudf=21.12.*
- libcudf=21.12.*
- rmm=21.12.*
- librmm=21.12.*
- cudf=22.02.*
- libcudf=22.02.*
- rmm=22.02.*
- librmm=22.02.*
- dask>=2021.09.1
- distributed>=2021.09.1
- dask-cuda=21.12.*
- dask-cudf=21.12.*
- dask-cuda=22.02.*
- dask-cudf=22.02.*
- nccl>=2.9.9
- ucx-py=0.23.*
- ucx-proc=*=gpu
Expand Down
1 change: 1 addition & 0 deletions conda/recipes/pylibcugraph/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ requirements:
- ucx-py 0.23
- ucx-proc=*=gpu
- cudatoolkit {{ cuda_version }}.*
- rmm {{ minor_version }}.*
run:
- python x.x
- libcugraph={{ version }}
Expand Down
4 changes: 2 additions & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#=============================================================================

cmake_minimum_required(VERSION 3.20.1 FATAL_ERROR)
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-21.12/RAPIDS.cmake
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-22.02/RAPIDS.cmake
${CMAKE_BINARY_DIR}/RAPIDS.cmake)
include(${CMAKE_BINARY_DIR}/RAPIDS.cmake)

Expand All @@ -27,7 +27,7 @@ include(rapids-find)

rapids_cuda_init_architectures(CUGRAPH)

project(CUGRAPH VERSION 21.12.00 LANGUAGES C CXX CUDA)
project(CUGRAPH VERSION 22.02.00 LANGUAGES C CXX CUDA)

if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND
CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 11.0)
Expand Down
4 changes: 2 additions & 2 deletions cpp/cmake/thirdparty/get_raft.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ set(CUGRAPH_BRANCH_VERSION_raft "${CUGRAPH_VERSION_MAJOR}.${CUGRAPH_VERSION_MINO
# To use a different RAFT locally, set the CMake variable
# RPM_raft_SOURCE=/path/to/local/raft
find_and_configure_raft(VERSION ${CUGRAPH_MIN_VERSION_raft}
FORK rapidsai
PINNED_TAG branch-${CUGRAPH_BRANCH_VERSION_raft}
FORK divyegala
PINNED_TAG imp-21.10-handle_stream
Copy link
Contributor

Choose a reason for hiding this comment

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

I am waiting for this PR to pull raft from the main repo to approve this.

)
2 changes: 1 addition & 1 deletion cpp/doxygen/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -2075,7 +2075,7 @@ SKIP_FUNCTION_MACROS = YES
# the path). If a tag file is not located in the directory in which doxygen is
# run, you must also specify the path to the tagfile here.

TAGFILES = rmm.tag=https://docs.rapids.ai/api/librmm/21.12
TAGFILES = rmm.tag=https://docs.rapids.ai/api/librmm/22.02

# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
# tag file that is based on the input files it reads. See section "Linking to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ void copy_v_transform_reduce_key_aggregated_out_nbr(
handle.get_stream());
}

handle.get_stream_view().synchronize(); // cuco::static_map currently does not take stream
handle.sync_stream(); // cuco::static_map currently does not take stream

kv_map_ptr.reset();

Expand All @@ -284,7 +284,7 @@ void copy_v_transform_reduce_key_aggregated_out_nbr(
thrust::make_tuple(map_keys.begin(), get_dataframe_buffer_begin(map_value_buffer)));
kv_map_ptr->insert(pair_first, pair_first + map_keys.size());
} else {
handle.get_stream_view().synchronize(); // cuco::static_map currently does not take stream
handle.sync_stream(); // cuco::static_map currently does not take stream

kv_map_ptr.reset();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,7 @@ typename GraphViewType::edge_type compute_num_out_nbrs_from_frontier(
auto& col_comm = handle.get_subcomm(cugraph::partition_2d::key_naming_t().col_name());
auto const col_comm_rank = col_comm.get_rank();

rmm::device_uvector<vertex_t> frontier_vertices(local_frontier_sizes[i],
handle.get_stream_view());
rmm::device_uvector<vertex_t> frontier_vertices(local_frontier_sizes[i], handle.get_stream());
device_bcast(col_comm,
local_frontier_vertex_first,
frontier_vertices.data(),
Expand Down Expand Up @@ -1096,7 +1095,7 @@ void update_frontier_v_push_if_out_nbr(
d_tx_buffer_last_boundaries.data(),
d_tx_buffer_last_boundaries.size(),
handle.get_stream());
handle.get_stream_view().synchronize();
handle.sync_stream();
std::vector<size_t> tx_counts(h_tx_buffer_last_boundaries.size());
std::adjacent_difference(
h_tx_buffer_last_boundaries.begin(), h_tx_buffer_last_boundaries.end(), tx_counts.begin());
Expand Down
2 changes: 1 addition & 1 deletion cpp/include/cugraph/prims/vertex_frontier.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ class VertexFrontier {
h_indices.data(), d_indices.data(), d_indices.size(), handle_ptr_->get_stream());
raft::update_host(
h_counts.data(), d_counts.data(), d_counts.size(), handle_ptr_->get_stream());
handle_ptr_->get_stream_view().synchronize();
handle_ptr_->sync_stream();

size_t offset{0};
for (size_t i = 0; i < h_indices.size(); ++i) {
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/c_api/array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ extern "C" cugraph_error_code_t cugraph_type_erased_device_array_create(
size_t n_bytes = n_elems * (::data_type_sz[dtype]);

auto ret_value = new cugraph::c_api::cugraph_type_erased_device_array_t(
n_elems, n_bytes, dtype, raft_handle->get_stream_view());
n_elems, n_bytes, dtype, raft_handle->get_stream());

*array = reinterpret_cast<cugraph_type_erased_device_array_t*>(ret_value);
return CUGRAPH_SUCCESS;
Expand Down
10 changes: 4 additions & 6 deletions cpp/src/community/legacy/ecg.cu
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,10 @@ class EcgLouvain : public cugraph::legacy::Louvain<graph_type> {

void initialize_dendrogram_level(vertex_t num_vertices) override
{
this->dendrogram_->add_level(0, num_vertices, this->handle_.get_stream_view());
this->dendrogram_->add_level(0, num_vertices, this->handle_.get_stream());

get_permutation_vector(num_vertices,
seed_,
this->dendrogram_->current_level_begin(),
this->handle_.get_stream_view());
get_permutation_vector(
num_vertices, seed_, this->dendrogram_->current_level_begin(), this->handle_.get_stream());
}

private:
Expand All @@ -147,7 +145,7 @@ void ecg(raft::handle_t const& handle,
"Invalid input argument: clustering is NULL, should be a device pointer to "
"memory for storing the result");

rmm::device_uvector<weight_t> ecg_weights_v(graph.number_of_edges, handle.get_stream_view());
rmm::device_uvector<weight_t> ecg_weights_v(graph.number_of_edges, handle.get_stream());

thrust::copy(handle.get_thrust_policy(),
graph.edge_data,
Expand Down
14 changes: 7 additions & 7 deletions cpp/src/community/legacy/egonet.cu
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ extract(raft::handle_t const& handle,
vertex_t radius)
{
auto v = csr_view.get_number_of_vertices();
auto user_stream_view = handle.get_stream_view();
auto user_stream_view = handle.get_stream();
rmm::device_vector<size_t> neighbors_offsets(n_subgraphs + 1);
rmm::device_vector<vertex_t> neighbors;

Expand All @@ -77,7 +77,7 @@ extract(raft::handle_t const& handle,
reached.reserve(n_subgraphs);
for (vertex_t i = 0; i < n_subgraphs; i++) {
// Allocations and operations are attached to the worker stream
rmm::device_uvector<vertex_t> local_reach(v, handle.get_internal_stream_view(i));
rmm::device_uvector<vertex_t> local_reach(v, handle.get_next_usable_stream(i));
reached.push_back(std::move(local_reach));
}

Expand All @@ -89,8 +89,8 @@ extract(raft::handle_t const& handle,

for (vertex_t i = 0; i < n_subgraphs; i++) {
// get light handle from worker pool
raft::handle_t light_handle(handle, i);
auto worker_stream_view = light_handle.get_stream_view();
raft::handle_t light_handle(handle.get_next_usable_stream(i));
auto worker_stream_view = light_handle.get_stream();

// BFS with cutoff
// consider adding a device API to BFS (ie. accept source on the device)
Expand Down Expand Up @@ -132,7 +132,7 @@ extract(raft::handle_t const& handle,
}

// wait on every one to identify their neighboors before proceeding to concatenation
handle.wait_on_internal_streams();
handle.sync_stream_pool();

// Construct neighboors offsets (just a scan on neighborhod vector sizes)
h_neighbors_offsets[0] = 0;
Expand All @@ -148,7 +148,7 @@ extract(raft::handle_t const& handle,

// Construct the neighboors list concurrently
for (vertex_t i = 0; i < n_subgraphs; i++) {
auto worker_stream_view = handle.get_internal_stream_view(i);
auto worker_stream_view = handle.get_next_usable_stream(i);
thrust::copy(rmm::exec_policy(worker_stream_view),
reached[i].begin(),
reached[i].end(),
Expand All @@ -160,7 +160,7 @@ extract(raft::handle_t const& handle,
}

// wait on every one before proceeding to grouped extraction
handle.wait_on_internal_streams();
handle.sync_stream_pool();

#ifdef TIMING
hr_timer.stop();
Expand Down
14 changes: 6 additions & 8 deletions cpp/src/community/legacy/leiden.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@ class Leiden : public Louvain<graph_type> {
this->timer_start("update_clustering_constrained");

rmm::device_uvector<vertex_t> next_cluster_v(this->dendrogram_->current_level_size(),
this->handle_.get_stream_view());
rmm::device_uvector<weight_t> delta_Q_v(graph.number_of_edges, this->handle_.get_stream_view());
rmm::device_uvector<vertex_t> cluster_hash_v(graph.number_of_edges,
this->handle_.get_stream_view());
this->handle_.get_stream());
rmm::device_uvector<weight_t> delta_Q_v(graph.number_of_edges, this->handle_.get_stream());
rmm::device_uvector<vertex_t> cluster_hash_v(graph.number_of_edges, this->handle_.get_stream());
rmm::device_uvector<weight_t> old_cluster_sum_v(graph.number_of_vertices,
this->handle_.get_stream_view());
this->handle_.get_stream());

vertex_t const* d_src_indices = this->src_indices_v_.data();
vertex_t const* d_dst_indices = graph.indices;
Expand Down Expand Up @@ -105,7 +104,7 @@ class Leiden : public Louvain<graph_type> {
}
}

this->timer_stop(this->handle_.get_stream_view());
this->timer_stop(this->handle_.get_stream());
return cur_Q;
}

Expand Down Expand Up @@ -134,8 +133,7 @@ class Leiden : public Louvain<graph_type> {
//
// Initialize every cluster to reference each vertex to itself
//
this->dendrogram_->add_level(
0, current_graph.number_of_vertices, this->handle_.get_stream_view());
this->dendrogram_->add_level(0, current_graph.number_of_vertices, this->handle_.get_stream());

thrust::sequence(this->handle_.get_thrust_policy(),
this->dendrogram_->current_level_begin(),
Expand Down
Loading