-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate edge weights from graph objects and update primitives to sup…
…port general edge properties. (#2843) This PR separates edge weights from `graph_t` and `graph_view_t`. Now edge weights are stored in `edge_property_t` like any other edge properties (e.g. edge IDs & types). Two major benefits are 1) For algorithms working on unweighted graphs, we don't need to explicitly instantiate for weight_t = float and weight_t = double cases. This saves compile time & reduces the binary size. 2) Primitives can work with different edge properties (weights, IDs, types, and so on) using a single mechanism instead of using one mechanism for edge weights and another mechanism for other edge properties (e.g. edge IDs & types). This PR changes many files (due to the changes in the `graph_t` and `graph_view_t` classes) but most changes are repetitive. To highlight major changes, 1) ``` template <typename vertex_t, typename edge_t, typename weight_t, bool store_transposed, bool multi_gpu> class graph_(view_)t { ... } => template <typename vertex_t, typename edge_t, bool store_transposed, bool multi_gpu> class graph_(view_)t { ... } ``` 2) `create_graph_from_edgelist` will return ``` std::tuple< graph_t<vertex_t, edge_t, store_transposed, multi_gpu>, std::optional< edge_property_t<graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu>, weight_t>>, std::optional<edge_property_t<graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu>, thrust::tuple<edge_t, edge_type_t>>>, std::optional<rmm::device_uvector<vertex_t>>> ``` instead of ``` std::tuple< graph_t<vertex_t, edge_t, weight_t, store_transposed, multi_gpu>, std::optional<edge_property_t<graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu>, thrust::tuple<edge_t, edge_type_t>>>, std::optional<rmm::device_uvector<vertex_t>>> ``` i.e. edge weights will be returned in a separate object. 3) Algorithms working on weighted graphs (or both unweighted & weighted graphs) will take the additional input argument: `edge_property_view_t<edge_t, weight_t const*>` or `std::optional<edge_property_view_t<edge_t, weight_t const*>>` 4) Primitives `e_op`'s input parameters were previously `(vertex_t src, vertex_t dst, weight_t w, source_property, destination_property)` or `(vertex_t src, vertex_t dst, source_property, destination_property)`. Now it will be `(vertex_t src, vertex_t dst, source_property, destination property, edge property)` Primitives with `e_op` will take an additional `edge_property_view_t` type input parameter (which can be edge_dummy_property_t{}.view() if no edge properties are used). 5) Edge weights are added in the C++ side (before type erasing) of the C API `cugraph_graph_t`. ``` struct cugraph_graph_t { ... void* edge_weights_; // this is added. ... } ``` This doesn't require any changes in the C side of the C API, so I assume this won't disrupt the pylibcugraph and python layers (once cython.cu file is removed). Authors: - Seunghwa Kang (https://github.com/seunghwak) Approvers: - Chuck Hastings (https://github.com/ChuckHastings) - Naim (https://github.com/naimnv) URL: #2843
- Loading branch information
Showing
241 changed files
with
6,890 additions
and
8,230 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
358 changes: 19 additions & 339 deletions
358
cpp/include/cugraph/detail/decompress_edge_partition.cuh
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.