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

Add generic edge properties object #4767

Draft
wants to merge 2 commits into
base: branch-24.12
Choose a base branch
from

Conversation

ChuckHastings
Copy link
Collaborator

Adding features to support type-erased edge properties within cugraph.

Temporal graph support would require adding 2 additional edge properties. This would result in 4x compile time and code size for functions that manipulate edge properties during the graph creation process.

This PR adds some new features to cugraph to reduce this compile time and provide the basis for adding the temporal edge properties to the graph in an efficient manner:

  • device_vector_t - an analog to a cudf series... this is a type-erased structure for storing a vector that allows us to interpret it upon use rather than needing to templatize the types
  • type_dispatcher - adapted from cudf to allow us to do dynamic type dispatching
  • edge_properties_t - a single object that contains a collection of device_vector_t objects allowing us to pass the edge properties in a single unit between functions that need to operate on the

@ChuckHastings ChuckHastings self-assigned this Nov 15, 2024
@ChuckHastings ChuckHastings added this to the 24.12 milestone Nov 15, 2024
@ChuckHastings ChuckHastings added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Nov 15, 2024
cugraph_data_type_id_t t,
size_t size)
{
return (t == BOOL) ? rmm::device_buffer(cugraph::packed_bool_size(size) * data_type_size(t),
Copy link
Contributor

Choose a reason for hiding this comment

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

cugraph::packed_bool_size(size) * data_type_size(t), should data_type_size(t) here be sizeof(uint32_t)?

/**
* Class wrapping a type-erased device vector.
* */
class device_vector_t {
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 not sure device_vector is a right name for type erased edge property vector. device_vector reminds me of thrust::device_vector or rmm::device_uvector. They are not type-erased vectors.

We may need a better name. My suggestions: edge_property_buffer or property_buffer or cugraph::device_buffer. rmm::device_buffer does not assume a specific type and may be more appropriate for type erased data types. Or we may use column (adopt column from cudf::column). In cuDF C++, they use cudf::column to store cuDF series. We may say edge_property_column or property_column or cugraph::device_column or just cugraph::column. In this case, we may rename the above allocate_buffer function to allocate_column_buffer as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like we need more discussion about this naming.

T const* begin() const
{
return reinterpret_cast<T const*>(data_.data());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

We may add cbegin() and cend() as well.

@ChuckHastings ChuckHastings removed this from the 24.12 milestone Nov 18, 2024
@ChuckHastings ChuckHastings added the DO NOT MERGE Hold off on merging; see PR for details label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMake cuGraph DO NOT MERGE Hold off on merging; see PR for details improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants