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

Define and Implement C API for biased sampling #4535

Merged

Conversation

ChuckHastings
Copy link
Collaborator

@ChuckHastings ChuckHastings commented Jul 12, 2024

Defined and implements C API for biased sampling.

API includes a parameter for handling edge bias input that is not the weight of the edge. However, there is currently no mechanism to create the cugraph_edge_property_view_t * value that would need to be passed in. There are some proposed functions to support that included in property.h, but they are inside an #ifdef 0 block so that they won't be compiled.

@ChuckHastings ChuckHastings added improvement Improvement / enhancement to an existing function DO NOT MERGE Hold off on merging; see PR for details non-breaking Non-breaking change and removed cuGraph labels Jul 12, 2024
@ChuckHastings ChuckHastings self-assigned this Jul 12, 2024
@ChuckHastings ChuckHastings removed the DO NOT MERGE Hold off on merging; see PR for details label Jul 16, 2024
@ChuckHastings ChuckHastings marked this pull request as ready for review July 16, 2024 20:01
@ChuckHastings ChuckHastings requested review from a team as code owners July 16, 2024 20:01
const cugraph_graph_t * graph,
const cugraph_lookup_container_t* lookup_container,
const cugraph_type_erased_device_array_t* edge_ids,
const cugraph_type_erased_device_array_t* properties,
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if edge IDs are provided only for a subset of edges? Will those edges have undefined values? Should we ask for default values?

And no need for an update function? (e.g. update bias values only for a small subset of edges).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Reasonable ideas. I'll look at defining update functions and a mechanism for a default value. I'll add it to both vertex and edge functions.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just fyi. In the C++ primitives level, we have fill_edge_property_value (which sets edge property values for the entire set of edges, we may add a function that works on a subset of the edges in the future) and update_edge_property function that works either on a subset of the edges or the entire set of edges. Following this may make implementing the API easier.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I pushed an update that adds these functions. Plan is to implement them at some point in the future.

@ChuckHastings ChuckHastings requested a review from a team as a code owner July 17, 2024 19:14
@ChuckHastings ChuckHastings changed the title Define C API for biased sampling Define and Implement C API for biased sampling Jul 17, 2024
Copy link
Member

@alexbarghi-nv alexbarghi-nv left a comment

Choose a reason for hiding this comment

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

👍

@alexbarghi-nv
Copy link
Member

/merge

@rapids-bot rapids-bot bot merged commit 79a2b2a into rapidsai:branch-24.08 Jul 18, 2024
132 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMake cuGraph improvement Improvement / enhancement to an existing function non-breaking Non-breaking change python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants