[RNG][rocRAND] Update rocRAND backend #376
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR updates the rocRAND backend's distribution functions which used to be unimplemented.
The following distribution functions have been implemented for the
philoandmrggenerators, for both API (Buffer and USM):gaussian<float, oneapi::mkl::rng::gaussian_method::icdf>gaussian<double, oneapi::mkl::rng::gaussian_method::icdf>lognormal<float, oneapi::mkl::rng::lognormal_method::icdf>lognormal<double, oneapi::mkl::rng::lognormal_method::icdf>poisson<std::int32_t, poisson_method::gaussian_icdf_based>poisson<std::uint32_t, poisson_method::gaussian_icdf_based>While updating these functions, a race condition has also been fixed, which makes the
gaussiandistribution functions pass again. The reason for the race condition was due to the asynchronoushost_taskwhich launched asynchronouss rocRAND computation. The stream created for that computation was not synchronized.Similar issues raised on cuBLAS: #175 (comment)
Furthermore, the copy constructor has also been implemented and a
seed_and anoffset_member has been introduced to thephilo_implandmrg_implto be able to track and set the sameseed, and also align theoffsetof the engines if the* otheralready generated values.Finally, the constructor for
philoandmrg, and the functionskip_aheadwhich takes astd::initializer_listare still marked as unimplemented due to rocRAND not supportingstd::initializer_list.Also, the
bernoullidistribution function is still marked as unimplemented due to rocRAND not supporting this distribution method.Checklist
All Submissions
example_rng_uniform_usm.log.txt
test_main_rng_ct.log.txt
test_main_rng_rt.log.txt