-
Notifications
You must be signed in to change notification settings - Fork 300
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
Neighborhood sampling C API implementation #2156
Neighborhood sampling C API implementation #2156
Conversation
cpp/src/detail/shuffle_wrappers.cu
Outdated
rmm::device_uvector<vertex_t>& d_vertices, | ||
rmm::device_uvector<value_t>& d_values, | ||
rmm::device_uvector<value_t>& d_local_values, | ||
vertex_t local_vertex_first) |
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.
This looks same to the code added in PR #2150 and the same comment applies here.
cpp/src/c_api/array.hpp
Outdated
std::unique_ptr<std::byte[]> data_; | ||
size_t size_; | ||
size_t num_bytes_; | ||
// NOTE: size must be first here because the device buffer is released |
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.
I don't understand this comment, and could you elaborate this comment? It seems like there is more context to this.
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.
Comment was copied from above. In the type_erased_device_buffer we do a release from the rmm::device_uvector
which changes the size of the vector to 0. It is important in that case that we copy the size before we call release.
Should delete this comment, std::vector doesn't support release, we do a copy instead.
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.
Gotcha, I can see that from the code of cugraph_type_erased_device_array_t
. No idea why this is necessary (because it is not...)for cugraph_type_erased_host_array_t
reading the code. Better delete the comment to avoid confusion.
cpp/src/c_api/hits.cpp
Outdated
do_expensive_check_); | ||
|
||
cugraph::detail::collect_vertex_values_to_local<vertex_t, weight_t, multi_gpu>( | ||
handle_, guess_vertices, guess_values, hubs, graph_view.get_local_vertex_first()); |
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.
Yes. I mentioned this in the slack thread.
…pling_capi_implementation
… when results don't partition evenly, add adjacenct_difference, since shuffle wants counts not offsets
@@ -332,8 +335,12 @@ uniform_nbr_sample_impl( | |||
|
|||
if constexpr (graph_view_t::is_multi_gpu) { | |||
size_t num_starting_vs = d_in.size(); | |||
#if 0 |
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.
Is this meant to be removed?
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.
Yes. I will remove it.
|
||
// resize accumulators: | ||
// FIXME: Need to call collective operations from all threads | ||
// if (in_sz > 0) { |
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.
So, is this a remaining bug to be fixed later?
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.
Nope. I will delete the FIXME, I fixed that problem in order to get the unit tests to pass.
d_in, | ||
d_ranks, | ||
gpu_t{}); | ||
//} |
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.
Better delete?
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.
I will clean up some of the commented out bits in the code. Part of my work to get things running.
d_ranks, | ||
gpu_t{}); | ||
//} | ||
|
||
//} |
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.
Better delete?
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.
Cleaned up in next push
C_CUDA_TRY(cudaGetDeviceCount(&num_gpus_per_node)); | ||
C_CUDA_TRY(cudaSetDevice(comm_rank % num_gpus_per_node)); | ||
|
||
#if 0 |
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.
Should we keep this?
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.
Deleted in next push
ret_code != CUGRAPH_SUCCESS, | ||
"cugraph_uniform_neighbor_sample expected to fail in SG test"); | ||
|
||
#if 0 |
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.
Should we keep this?
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.
I'm hoping to add support for SG in the next release. This should be the code to do the test once SG is working (although it will need to be debugged). I can delete it and recreate it from the MG version next release if we want to keep this clean, although I'm inclined to keep it for now.
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.
Sure, no problem.
Codecov Report
@@ Coverage Diff @@
## branch-22.04 #2156 +/- ##
================================================
+ Coverage 73.95% 73.99% +0.04%
================================================
Files 157 157
Lines 10496 10496
================================================
+ Hits 7762 7767 +5
+ Misses 2734 2729 -5
Continue to review full report at Codecov.
|
@gpucibot merge |
Closes #2108 when merged. Requires both #2088 and #2156 to be merged before, the former because this uses MGGraph, and the later because of the C implementation of neighborhood sampling. Authors: - https://github.com/betochimas - Joseph Nke (https://github.com/jnke2016) - Rick Ratzel (https://github.com/rlratzel) Approvers: - Don Acosta (https://github.com/acostadon) - Rick Ratzel (https://github.com/rlratzel) - Joseph Nke (https://github.com/jnke2016) - Chuck Hastings (https://github.com/ChuckHastings) - Jordan Jacobelli (https://github.com/Ethyling) URL: #2118
Provide the implementation for the C API for neighborhood sampling.
Currently needs some debugging.
merge after 2150