-
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
Random vertex sampling utility function for C++ tests #3347
Random vertex sampling utility function for C++ tests #3347
Conversation
…g_test_random_vertex_set
…g_test_random_vertex_set
…g_test_random_vertex_set
…g_test_random_vertex_set
…g_test_random_vertex_set
…elect random vertex subset
size_t sample_size, | ||
bool with_replacement, | ||
bool sort_samples) | ||
{ |
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 perhaps use
rmm::device_uvector<vertex_t> select_random_vertices( |
sort_samples
parameter to that function and perhaps using this implementation? Seems like the functionality should be the same.
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.
Oh, yes, you're right. I forgot about the function.
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.
Done.
…g_test_random_vertex_set
…me a random vertex generation function returns a fixed known vertices
…g_test_random_vertex_set
if (min_buffer_size <= select_count / comm_size) { | ||
auto new_sizes = std::vector<size_t>(comm_size, min_buffer_size); | ||
auto num_deficits = select_count - min_buffer_size * comm_size; | ||
for (int i = 0; i < comm_size; ++i) { | ||
auto delta = std::min(num_deficits, buffer_sizes[i] - min_buffer_size); | ||
new_sizes[i] += delta; | ||
num_deficits -= delta; | ||
} | ||
this_gpu_select_count = new_sizes[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.
I wonder when would this be necessary?
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.
Say we need to select 798 vertices out of 800 vertices.
And after shuffling 800 vertices, GPU0 has 380 vertices and GPU 1 has 420 vertices.
We can't select 798/2=399 vertices in GPU0, so we need to select 380 in GPU0 and 418 in GPU1.
/merge |
Code clean-up and use a common vertex sampling function throughout C++ tests.
Additional bug fixes
aa25afb
290751f