-
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
Fix bounds errors with Kokkos::sort #4980
Conversation
Can one of the admins verify this patch? |
We have noticed that `Kokkos::sort` sometimes fails in HIP. This adds a test that demonstrates this bug. When I compile Kokkos on the crusher platform at OLCF using the ROCm 5.1.0 module, this test fails. This can be used to determine what is going wrong with sort and provide a regression test for it.
OK to test |
I casted everything to |
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 can verify that the changes fix the issue I was originally having when I submitted #4978.
That said, I noticed that some of the regression tests are failing in the PR checks.
There is a |
Failure (issue with NVIDIA GPG repo key on the Clang+CUDA build) is unrelated. This is ready. |
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 OK to me.
// For integral types the number of bins may be larger than the range | ||
// in which case we can exactly have one unique value per bin | ||
// and then don't need to sort bins. | ||
if (std::is_integral<typename KeyViewType::const_value_type>::value && | ||
static_cast<uint64_t>(range_) <= static_cast<uint64_t>(max_bins__)) { | ||
(static_cast<double>(max) - static_cast<double>(min)) <= |
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.
(static_cast<double>(max) - static_cast<double>(min)) <= | |
(static_cast<double>(max) - min_) <= |
We have noticed that
Kokkos::sort
sometimes fails in HIP. Thisadds a test that demonstrates this bug. When I compile Kokkos
on the crusher platform at OLCF using the ROCm 5.1.0 module, this
test fails. This can be used to determine what is going wrong
with sort and provide a regression test for it.
Note that this PR does not fix anything. Rather, this just
demonstrates the problem reported in #4978. I provide this to
the Kokkos developers so they have a simple way to replicate the
problem in #4978.