-
Notifications
You must be signed in to change notification settings - Fork 311
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
Erdos-Renyi generator had bad logic in thrust calls #4362
Erdos-Renyi generator had bad logic in thrust calls #4362
Conversation
|
||
rmm::device_uvector<size_t> indices_v(count, handle.get_stream()); | ||
auto generate_random_value = cuda::proclaim_return_type<float>([seed] __device__(size_t index) { | ||
thrust::default_random_engine rng(seed); |
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 might be out side the scope of this bug fix PR, but should we better use raft::random::RngState
? Using two different random number generation mechanism does not sound ideal.
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.
Created an issue to address this.
/merge |
static_cast<vertex_t>(dst)); | ||
})); | ||
|
||
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.
Is it OK to leave out handle.sync_stream() here, as there is one after the kernel call in cpp/tests/generators/erdos_renyi_test.cpp?
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. The sync_stream
call here was never necessary. Any asynchronous work that is active on this stream will continue to be active when we leave this function call.
The
random_iterator
, a thrust transform iterator that was used for counting and filtering returns the probability, but theycopy_if
call was assuming it was returning the index.Modified the logic and then consolidated the
copy_if
andtransform
into a single call with an output iterator.Closes #4359