Skip to content

Commit b28a75e

Browse files
committed
Merge branch 'branch-25.04' into shellcheck
2 parents 8ca6c9c + 1e8c014 commit b28a75e

File tree

79 files changed

+3853
-1888
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+3853
-1888
lines changed

.github/workflows/pr.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ jobs:
5656
uses: rapidsai/shared-actions/check_nightly_success/dispatch@main
5757
with:
5858
repo: cugraph
59+
# TODO: remove this once upstream issues in RAFT are resolved on 11.4.
60+
# The limit was temporarily increased to unblock work.
61+
max_days_without_success: 30
5962
changed-files:
6063
secrets: inherit
6164
needs: telemetry-setup

ci/test_python.sh

-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ export LD_PRELOAD="${CONDA_PREFIX}/lib/libgomp.so.1"
4242
# RAPIDS_DATASET_ROOT_DIR is used by test scripts
4343
RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)"
4444
export RAPIDS_DATASET_ROOT_DIR
45-
pushd "${RAPIDS_DATASET_ROOT_DIR}"
46-
./get_test_data.sh --benchmark
47-
popd
4845

4946
EXITCODE=0
5047
trap "EXITCODE=1" ERR

cpp/include/cugraph/detail/shuffle_wrappers.hpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#pragma once
1717

1818
#include <raft/core/handle.hpp>
19+
#include <raft/core/host_span.hpp>
1920
#include <raft/random/rng_state.hpp>
2021

2122
#include <rmm/device_uvector.hpp>
@@ -130,7 +131,7 @@ shuffle_int_vertex_pairs_with_values_to_local_gpu_by_edge_partitioning(
130131
std::optional<rmm::device_uvector<edge_type_t>>&& edge_types,
131132
std::optional<rmm::device_uvector<edge_time_t>>&& edge_start_times,
132133
std::optional<rmm::device_uvector<edge_time_t>>&& edge_end_times,
133-
std::vector<vertex_t> const& vertex_partition_range_lasts);
134+
raft::host_span<vertex_t const> vertex_partition_range_lasts);
134135

135136
/**
136137
* @ingroup shuffle_wrappers_cpp
@@ -174,7 +175,7 @@ template <typename vertex_t>
174175
rmm::device_uvector<vertex_t> shuffle_int_vertices_to_local_gpu_by_vertex_partitioning(
175176
raft::handle_t const& handle,
176177
rmm::device_uvector<vertex_t>&& vertices,
177-
std::vector<vertex_t> const& vertex_partition_range_lasts);
178+
raft::host_span<vertex_t const> vertex_partition_range_lasts);
178179

179180
/**
180181
* @ingroup shuffle_wrappers_cpp
@@ -197,7 +198,7 @@ shuffle_int_vertex_value_pairs_to_local_gpu_by_vertex_partitioning(
197198
raft::handle_t const& handle,
198199
rmm::device_uvector<vertex_t>&& vertices,
199200
rmm::device_uvector<value_t>&& values,
200-
std::vector<vertex_t> const& vertex_partition_range_lasts);
201+
raft::host_span<vertex_t const> vertex_partition_range_lasts);
201202

202203
/**
203204
* @ingroup shuffle_wrappers_cpp

cpp/include/cugraph/graph_functions.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ void unrenumber_int_vertices(raft::handle_t const& handle,
245245
vertex_t* vertices /* [INOUT] */,
246246
size_t num_vertices,
247247
vertex_t const* renumber_map_labels,
248-
std::vector<vertex_t> const& vertex_partition_range_lasts,
248+
raft::host_span<vertex_t const> vertex_partition_range_lasts,
249249
bool do_expensive_check = false);
250250

251251
/**
@@ -285,7 +285,7 @@ std::enable_if_t<multi_gpu, void> unrenumber_local_int_edges(
285285
std::vector<vertex_t*> const& edgelist_dsts /* [INOUT] */,
286286
std::vector<size_t> const& edgelist_edge_counts,
287287
vertex_t const* renumber_map_labels,
288-
std::vector<vertex_t> const& vertex_partition_range_lasts,
288+
raft::host_span<vertex_t const> vertex_partition_range_lasts,
289289
std::optional<std::vector<std::vector<size_t>>> const& edgelist_intra_partition_segment_offsets,
290290
bool do_expensive_check = false);
291291

cpp/include/cugraph/graph_view.hpp

+17-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020-2024, NVIDIA CORPORATION.
2+
* Copyright (c) 2020-2025, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -112,15 +112,16 @@ class partition_t {
112112
}
113113
}
114114

115-
std::vector<vertex_t> const& vertex_partition_range_offsets() const
115+
raft::host_span<vertex_t const> vertex_partition_range_offsets() const
116116
{
117-
return vertex_partition_range_offsets_;
117+
return raft::host_span<vertex_t const>(vertex_partition_range_offsets_.data(),
118+
vertex_partition_range_offsets_.size());
118119
}
119120

120-
std::vector<vertex_t> vertex_partition_range_lasts() const
121+
raft::host_span<vertex_t const> vertex_partition_range_lasts() const
121122
{
122-
return std::vector<vertex_t>(vertex_partition_range_offsets_.begin() + 1,
123-
vertex_partition_range_offsets_.end());
123+
return raft::host_span<vertex_t const>(vertex_partition_range_offsets_.data() + 1,
124+
vertex_partition_range_offsets_.size() - 1);
124125
}
125126

126127
std::tuple<vertex_t, vertex_t> local_vertex_partition_range() const
@@ -395,12 +396,12 @@ class graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu, std::enable_if
395396
edge_partition_dcs_nzd_range_bitmaps,
396397
graph_view_meta_t<vertex_t, edge_t, store_transposed, multi_gpu> meta);
397398

398-
std::vector<vertex_t> vertex_partition_range_offsets() const
399+
raft::host_span<vertex_t const> vertex_partition_range_offsets() const
399400
{
400401
return partition_.vertex_partition_range_offsets();
401402
}
402403

403-
std::vector<vertex_t> vertex_partition_range_lasts() const
404+
raft::host_span<vertex_t const> vertex_partition_range_lasts() const
404405
{
405406
return partition_.vertex_partition_range_lasts();
406407
}
@@ -856,15 +857,16 @@ class graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu, std::enable_if
856857
raft::device_span<vertex_t const> indices,
857858
graph_view_meta_t<vertex_t, edge_t, store_transposed, multi_gpu> meta);
858859

859-
std::vector<vertex_t> vertex_partition_range_offsets() const
860+
raft::host_span<vertex_t const> vertex_partition_range_offsets() const
860861
{
861-
return std::vector<vertex_t>{local_vertex_partition_range_first(),
862-
local_vertex_partition_range_last()};
862+
return raft::host_span<vertex_t const>(vertex_partition_range_offsets_.data(),
863+
vertex_partition_range_offsets_.size());
863864
}
864865

865-
std::vector<vertex_t> vertex_partition_range_lasts() const
866+
raft::host_span<vertex_t const> vertex_partition_range_lasts() const
866867
{
867-
return std::vector<vertex_t>{local_vertex_partition_range_last()};
868+
return raft::host_span<vertex_t const>(vertex_partition_range_offsets_.data() + 1,
869+
vertex_partition_range_offsets_.size() - 1);
868870
}
869871

870872
std::tuple<vertex_t, vertex_t> local_vertex_partition_range() const
@@ -1109,6 +1111,8 @@ class graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu, std::enable_if
11091111
}
11101112

11111113
private:
1114+
std::vector<vertex_t> vertex_partition_range_offsets_{}; // size = 1 + 1
1115+
11121116
raft::device_span<edge_t const> offsets_{};
11131117
raft::device_span<vertex_t const> indices_{};
11141118

cpp/include/cugraph/mtmg/vertex_pair_result_view.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, NVIDIA CORPORATION.
2+
* Copyright (c) 2024-2025, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -46,7 +46,7 @@ class vertex_pair_result_view_t
4646
rmm::device_uvector<result_t>>
4747
gather(handle_t const& handle,
4848
raft::device_span<vertex_t const> vertices,
49-
std::vector<vertex_t> const& vertex_partition_range_lasts,
49+
raft::host_span<vertex_t const> vertex_partition_range_lasts,
5050
cugraph::vertex_partition_view_t<vertex_t, multi_gpu> vertex_partition_view,
5151
std::optional<cugraph::mtmg::renumber_map_view_t<vertex_t>>& renumber_map_view);
5252
};

cpp/include/cugraph/mtmg/vertex_result_view.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023-2024, NVIDIA CORPORATION.
2+
* Copyright (c) 2023-2025, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@ class vertex_result_view_t : public detail::device_shared_device_span_t<result_t
4343
rmm::device_uvector<result_t> gather(
4444
handle_t const& handle,
4545
raft::device_span<vertex_t const> vertices,
46-
std::vector<vertex_t> const& vertex_partition_range_lasts,
46+
raft::host_span<vertex_t const> vertex_partition_range_lasts,
4747
cugraph::vertex_partition_view_t<vertex_t, multi_gpu> vertex_partition_view,
4848
std::optional<cugraph::mtmg::renumber_map_view_t<vertex_t>>& renumber_map_view,
4949
result_t default_value = 0);

cpp/src/c_api/bfs.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,11 @@ struct bfs_functor : public abstract_functor {
141141
raft::copy(vertex_ids.data(), number_map->data(), vertex_ids.size(), handle_.get_stream());
142142

143143
if (compute_predecessors_) {
144-
std::vector<vertex_t> vertex_partition_range_lasts =
145-
graph_view.vertex_partition_range_lasts();
146-
147144
unrenumber_int_vertices<vertex_t, multi_gpu>(handle_,
148145
predecessors.data(),
149146
predecessors.size(),
150147
number_map->data(),
151-
vertex_partition_range_lasts,
148+
graph_view.vertex_partition_range_lasts(),
152149
do_expensive_check_);
153150
}
154151

cpp/src/c_api/extract_paths.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021-2024, NVIDIA CORPORATION.
2+
* Copyright (c) 2021-2025, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -126,14 +126,11 @@ struct extract_paths_functor : public abstract_functor {
126126
destinations.data(),
127127
destinations.size());
128128

129-
std::vector<vertex_t> vertex_partition_range_lasts =
130-
graph_view.vertex_partition_range_lasts();
131-
132129
unrenumber_int_vertices<vertex_t, multi_gpu>(handle_,
133130
result.data(),
134131
result.size(),
135132
number_map->data(),
136-
vertex_partition_range_lasts,
133+
graph_view.vertex_partition_range_lasts(),
137134
false);
138135

139136
result_ = new cugraph_extract_paths_result_t{

cpp/src/c_api/negative_sampling.cpp

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, NVIDIA CORPORATION.
2+
* Copyright (c) 2024-2025, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -168,21 +168,21 @@ struct negative_sampling_functor : public cugraph::c_api::abstract_functor {
168168
exact_number_of_samples_,
169169
do_expensive_check_);
170170

171-
std::vector<vertex_t> vertex_partition_lasts = graph_view.vertex_partition_range_lasts();
172-
173-
cugraph::unrenumber_int_vertices<vertex_t, multi_gpu>(handle_,
174-
src.data(),
175-
src.size(),
176-
number_map->data(),
177-
vertex_partition_lasts,
178-
do_expensive_check_);
179-
180-
cugraph::unrenumber_int_vertices<vertex_t, multi_gpu>(handle_,
181-
dst.data(),
182-
dst.size(),
183-
number_map->data(),
184-
vertex_partition_lasts,
185-
do_expensive_check_);
171+
cugraph::unrenumber_int_vertices<vertex_t, multi_gpu>(
172+
handle_,
173+
src.data(),
174+
src.size(),
175+
number_map->data(),
176+
graph_view.vertex_partition_range_lasts(),
177+
do_expensive_check_);
178+
179+
cugraph::unrenumber_int_vertices<vertex_t, multi_gpu>(
180+
handle_,
181+
dst.data(),
182+
dst.size(),
183+
number_map->data(),
184+
graph_view.vertex_partition_range_lasts(),
185+
do_expensive_check_);
186186

187187
result_ = new cugraph::c_api::cugraph_coo_t{
188188
std::make_unique<cugraph::c_api::cugraph_type_erased_device_array_t>(src,

cpp/src/c_api/neighbor_sampling.cpp

+44-44
Original file line numberDiff line numberDiff line change
@@ -234,21 +234,21 @@ struct uniform_neighbor_sampling_functor : public cugraph::c_api::abstract_funct
234234
options_.dedupe_sources_,
235235
do_expensive_check_);
236236

237-
std::vector<vertex_t> vertex_partition_lasts = graph_view.vertex_partition_range_lasts();
238-
239-
cugraph::unrenumber_int_vertices<vertex_t, multi_gpu>(handle_,
240-
src.data(),
241-
src.size(),
242-
number_map->data(),
243-
vertex_partition_lasts,
244-
do_expensive_check_);
245-
246-
cugraph::unrenumber_int_vertices<vertex_t, multi_gpu>(handle_,
247-
dst.data(),
248-
dst.size(),
249-
number_map->data(),
250-
vertex_partition_lasts,
251-
do_expensive_check_);
237+
cugraph::unrenumber_int_vertices<vertex_t, multi_gpu>(
238+
handle_,
239+
src.data(),
240+
src.size(),
241+
number_map->data(),
242+
graph_view.vertex_partition_range_lasts(),
243+
do_expensive_check_);
244+
245+
cugraph::unrenumber_int_vertices<vertex_t, multi_gpu>(
246+
handle_,
247+
dst.data(),
248+
dst.size(),
249+
number_map->data(),
250+
graph_view.vertex_partition_range_lasts(),
251+
do_expensive_check_);
252252

253253
std::optional<rmm::device_uvector<vertex_t>> majors{std::nullopt};
254254
rmm::device_uvector<vertex_t> minors(0, handle_.get_stream());
@@ -585,21 +585,21 @@ struct biased_neighbor_sampling_functor : public cugraph::c_api::abstract_functo
585585
options_.dedupe_sources_,
586586
do_expensive_check_);
587587

588-
std::vector<vertex_t> vertex_partition_lasts = graph_view.vertex_partition_range_lasts();
589-
590-
cugraph::unrenumber_int_vertices<vertex_t, multi_gpu>(handle_,
591-
src.data(),
592-
src.size(),
593-
number_map->data(),
594-
vertex_partition_lasts,
595-
do_expensive_check_);
588+
cugraph::unrenumber_int_vertices<vertex_t, multi_gpu>(
589+
handle_,
590+
src.data(),
591+
src.size(),
592+
number_map->data(),
593+
graph_view.vertex_partition_range_lasts(),
594+
do_expensive_check_);
596595

597-
cugraph::unrenumber_int_vertices<vertex_t, multi_gpu>(handle_,
598-
dst.data(),
599-
dst.size(),
600-
number_map->data(),
601-
vertex_partition_lasts,
602-
do_expensive_check_);
596+
cugraph::unrenumber_int_vertices<vertex_t, multi_gpu>(
597+
handle_,
598+
dst.data(),
599+
dst.size(),
600+
number_map->data(),
601+
graph_view.vertex_partition_range_lasts(),
602+
do_expensive_check_);
603603

604604
std::optional<rmm::device_uvector<vertex_t>> majors{std::nullopt};
605605
rmm::device_uvector<vertex_t> minors(0, handle_.get_stream());
@@ -1092,21 +1092,21 @@ struct neighbor_sampling_functor : public cugraph::c_api::abstract_functor {
10921092
}
10931093
}
10941094

1095-
std::vector<vertex_t> vertex_partition_lasts = graph_view.vertex_partition_range_lasts();
1096-
1097-
cugraph::unrenumber_int_vertices<vertex_t, multi_gpu>(handle_,
1098-
src.data(),
1099-
src.size(),
1100-
number_map->data(),
1101-
vertex_partition_lasts,
1102-
do_expensive_check_);
1103-
1104-
cugraph::unrenumber_int_vertices<vertex_t, multi_gpu>(handle_,
1105-
dst.data(),
1106-
dst.size(),
1107-
number_map->data(),
1108-
vertex_partition_lasts,
1109-
do_expensive_check_);
1095+
cugraph::unrenumber_int_vertices<vertex_t, multi_gpu>(
1096+
handle_,
1097+
src.data(),
1098+
src.size(),
1099+
number_map->data(),
1100+
graph_view.vertex_partition_range_lasts(),
1101+
do_expensive_check_);
1102+
1103+
cugraph::unrenumber_int_vertices<vertex_t, multi_gpu>(
1104+
handle_,
1105+
dst.data(),
1106+
dst.size(),
1107+
number_map->data(),
1108+
graph_view.vertex_partition_range_lasts(),
1109+
do_expensive_check_);
11101110

11111111
std::optional<rmm::device_uvector<vertex_t>> majors{std::nullopt};
11121112
rmm::device_uvector<vertex_t> minors(0, handle_.get_stream());

cpp/src/c_api/sssp.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022-2024, NVIDIA CORPORATION.
2+
* Copyright (c) 2022-2025, NVIDIA CORPORATION.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -125,14 +125,11 @@ struct sssp_functor : public abstract_functor {
125125
raft::copy(vertex_ids.data(), number_map->data(), vertex_ids.size(), handle_.get_stream());
126126

127127
if (compute_predecessors_) {
128-
std::vector<vertex_t> vertex_partition_range_lasts =
129-
graph_view.vertex_partition_range_lasts();
130-
131128
unrenumber_int_vertices<vertex_t, multi_gpu>(handle_,
132129
predecessors.data(),
133130
predecessors.size(),
134131
number_map->data(),
135-
vertex_partition_range_lasts,
132+
graph_view.vertex_partition_range_lasts(),
136133
do_expensive_check_);
137134
}
138135

0 commit comments

Comments
 (0)