-
Notifications
You must be signed in to change notification settings - Fork 304
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 logic for shuffling results #3619
fix logic for shuffling results #3619
Conversation
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.
Looks good to me.
auto d_tx_value_counts = cugraph::groupby_and_count( | ||
labels->begin(), | ||
labels->end(), | ||
thrust::make_zip_iterator(majors.begin(), | ||
minors.begin(), | ||
weights->begin(), | ||
edge_ids->begin(), | ||
edge_types->begin(), | ||
hops->begin()), | ||
shuffle_to_output_comm_rank_t<label_t>{std::get<0>(*label_to_output_comm_rank), | ||
std::get<1>(*label_to_output_comm_rank)}, | ||
comm_size, | ||
mem_frugal_threshold, | ||
handle.get_stream()); | ||
|
||
std::vector<size_t> h_tx_value_counts(d_tx_value_counts.size()); | ||
raft::update_host(h_tx_value_counts.data(), | ||
d_tx_value_counts.data(), | ||
d_tx_value_counts.size(), | ||
handle.get_stream()); | ||
|
||
handle.sync_stream(); |
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.
We can call cugraph::groupby_and_count
only once if we use an index array and then use thrust::gather
or thrust::permutation_iterator
to rearrange majors minors weights edge_ids edge_types hops
before exponential if/else block
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.
Or isn't it possible to make the body of each if-else cases as a template function. If I am not mistaken, the only differences between the cases is the iterators we are zipping using thrust::make_zip_iterator(...)
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.
the only differences between the cases is the iterators we are zipping using thrust::make_zip_iterator(...) - that's correct.
It can be merged as it and can be changed at later point as Chuck might be away.
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.
We may consider refactoring this code to reduce code duplication in the next release.
/merge |
@alexbarghi-nv found a bug in sampling during python testing. The process of shuffling sampled edges for output formatting was corrupting the label associated with each sampled edge. This PR fixes this bug.