-
Notifications
You must be signed in to change notification settings - Fork 310
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
Fix bug in MG Neighborhood sampling #4827
base: branch-25.02
Are you sure you want to change the base?
Fix bug in MG Neighborhood sampling #4827
Conversation
@@ -948,11 +948,13 @@ struct neighbor_sampling_functor : public cugraph::c_api::abstract_functor { | |||
std::exclusive_scan( | |||
recvcounts.begin(), recvcounts.end(), displacements.begin(), size_t{0}); | |||
|
|||
(*label_to_comm_rank) | |||
.resize(displacements.back() + recvcounts.back(), handle_.get_stream()); | |||
rmm::device_uvector<label_t> tmp_label_to_comm_rank( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just use label_to_comm_rank.resize(...)
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is an optional which is initialized to std::nullopt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label_to_comm_rank =
rmm::device_uvector<label_t>(displacements.back() + recvcounts.back(), handle_.get_stream());
is sufficient (no need to create a temporary and move).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the above comment, looks good to me.
This PR fixes a bug when computing the global start vertex labels