fix logic for shuffling results#3619
Conversation
| 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.
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.
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.
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.
seunghwak
left a comment
There was a problem hiding this comment.
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.