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

Update per_v_transform_reduce_incoming|outgoing_e to support edge masking #4085

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a36eb62
update tests to include edge masking
seunghwak Jan 6, 2024
8bdc17e
remove unnecessary multiply by 1.0
seunghwak Jan 7, 2024
9751332
update to support edge masking
seunghwak Jan 10, 2024
a2e99fb
Merge branch 'branch-24.02' of https://github.com/rapidsai/cugraph in…
seunghwak Jan 10, 2024
a3adff9
Merge branch 'branch-24.02' of https://github.com/rapidsai/cugraph in…
seunghwak Jan 18, 2024
b646a10
Merge branch 'branch-24.02' of https://github.com/rapidsai/cugraph in…
seunghwak Jan 20, 2024
4e4b72b
Merge branch 'branch-24.02' of https://github.com/rapidsai/cugraph in…
seunghwak Jan 22, 2024
050b78a
Merge branch 'branch-24.02' of https://github.com/rapidsai/cugraph in…
seunghwak Jan 22, 2024
3782e1b
rename call_e_op_t to transform_reduce_v_froniter_call_e_op_t to avoi…
seunghwak Jan 23, 2024
23874af
fewer checking for edge_partition_e_mask.has_value() if edge masking …
seunghwak Jan 24, 2024
5e611c6
Merge branch 'branch-24.02' of https://github.com/rapidsai/cugraph in…
seunghwak Jan 24, 2024
65104df
copyright year
seunghwak Jan 24, 2024
55927e9
reduce code repetition
seunghwak Jan 24, 2024
58799d9
remove debug printout
seunghwak Jan 24, 2024
a421a76
get large value by reference
seunghwak Jan 24, 2024
a413978
copyright year
seunghwak Jan 24, 2024
304b5c0
Merge branch 'branch-24.02' of https://github.com/rapidsai/cugraph in…
seunghwak Jan 24, 2024
b2308d6
code refactor for re-use for other primitives
seunghwak Jan 24, 2024
d6653db
code cleanup
seunghwak Jan 25, 2024
19db5fc
Merge branch 'branch-24.02' of https://github.com/rapidsai/cugraph in…
seunghwak Jan 25, 2024
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: 2 additions & 2 deletions cpp/src/centrality/eigenvector_centrality_impl.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022-2023, NVIDIA CORPORATION.
* Copyright (c) 2022-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -117,7 +117,7 @@ rmm::device_uvector<weight_t> eigenvector_centrality(
edge_src_centralities.view(),
edge_dst_dummy_property_t{}.view(),
edge_dummy_property_t{}.view(),
[] __device__(vertex_t, vertex_t, auto src_val, auto, auto) { return src_val * 1.0; },
[] __device__(vertex_t, vertex_t, auto src_val, auto, auto) { return src_val; },
weight_t{0},
reduce_op::plus<weight_t>{},
centralities.begin());
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/link_analysis/pagerank_impl.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020-2023, NVIDIA CORPORATION.
* Copyright (c) 2020-2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -288,7 +288,7 @@ centrality_algorithm_metadata_t pagerank(
edge_dst_dummy_property_t{}.view(),
edge_dummy_property_t{}.view(),
[alpha] __device__(vertex_t, vertex_t, auto src_val, auto, auto) {
return src_val * 1.0 * alpha;
return src_val * alpha;
},
unvarying_part,
reduce_op::plus<result_t>{},
Expand Down
60 changes: 60 additions & 0 deletions cpp/src/prims/detail/prim_functors.cuh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Copyright (c) 2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once

#include <cugraph/edge_partition_device_view.cuh>

namespace cugraph {

namespace detail {

template <typename GraphViewType,
typename EdgePartitionSrcValueInputWrapper,
typename EdgePartitionDstValueInputWrapper,
typename EdgePartitionEdgeValueInputWrapper,
typename EdgeOp>
struct call_e_op_t {
edge_partition_device_view_t<typename GraphViewType::vertex_type,
typename GraphViewType::edge_type,
GraphViewType::is_multi_gpu> const& edge_partition{};
EdgePartitionSrcValueInputWrapper const& edge_partition_src_value_input{};
EdgePartitionDstValueInputWrapper const& edge_partition_dst_value_input{};
EdgePartitionEdgeValueInputWrapper const& edge_partition_e_value_input{};
EdgeOp const& e_op{};
typename GraphViewType::vertex_type major{};
typename GraphViewType::vertex_type major_offset{};
typename GraphViewType::vertex_type const* indices{nullptr};
typename GraphViewType::edge_type edge_offset{};

__device__ auto operator()(typename GraphViewType::edge_type i) const
{
auto minor = indices[i];
auto minor_offset = edge_partition.minor_offset_from_minor_nocheck(minor);
auto src = GraphViewType::is_storage_transposed ? minor : major;
auto dst = GraphViewType::is_storage_transposed ? major : minor;
auto src_offset = GraphViewType::is_storage_transposed ? minor_offset : major_offset;
auto dst_offset = GraphViewType::is_storage_transposed ? major_offset : minor_offset;
return e_op(src,
dst,
edge_partition_src_value_input.get(src_offset),
edge_partition_dst_value_input.get(dst_offset),
edge_partition_e_value_input.get(edge_offset + i));
}
};

} // namespace detail

} // namespace cugraph
Loading