-
Notifications
You must be signed in to change notification settings - Fork 407
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
algorithms: Add bhalf rand support #4653
Conversation
retest this please |
@@ -424,6 +432,12 @@ struct test_random_scalar { | |||
} | |||
#endif | |||
|
|||
#if defined(KOKKOS_BHALF_T_IS_FLOAT) && !KOKKOS_BHALF_T_IS_FLOAT | |||
if (std::is_same<Scalar, Kokkos::Experimental::bhalf_t>::value) { | |||
variance_factor = 15.01; |
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.
Where does this number come from?
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.
Based on the test failure output with a smaller variance factor, this is approximately the smallest variance factor I found that allows the tests to pass.
mean_eps_expect = 0.019; | ||
variance_eps_expect = 1.0; | ||
covariance_eps_expect = 2.8e4; |
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.
How did you determine these numbers?
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.
Same as above.
@crtrott Is there a way to calculate the expected variance factor and epsilons based on the scalar precision? |
retest this please |
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.
Looks good besides the magic numbers
Waiting to hear back on #4653 (comment)
Retest this please |
There is certainly a way to calculate where these numbers come from, but its likely pretty complicated because the semi randomness of roundof errors plays a role here, which for half and bhalf are not enough orders of magnitude away from the actual random generator randomness. Unfortunately I doubt its a fully uncorrelated distribution which makes this all iffy. I don't have time to work the math out at least. |
Would you like the unit-tests removed? We need this PR for kokkos/kokkos-kernels#1251. |
Retest this please |
The OpenMPTarget failure is unrelated to this issue. Seems like the OpenMPTarget CI is having issues. |
@crtrott: Ready to merge? |
Supersedes #4652.
Related to #4372.