-
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 atomic operations bug for Min and Max #6435
Conversation
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.
What about tpls/desul/include/desul/atomics/cuda/cuda_cc7_asm_atomic_op.inc_{forceglobal,generic}
?
Also please confirm that we don't need to update the atomic_fetch_op headers
tpls/desul/include/desul/atomics/cuda/cuda_cc7_asm_atomic_op.inc_isglobal
Show resolved
Hide resolved
tpls/desul/include/desul/atomics/cuda/cuda_cc7_asm_atomic_op.inc_isglobal
Show resolved
Hide resolved
tpls/desul/include/desul/atomics/cuda/cuda_cc7_asm_atomic_op.inc_predicate
Show resolved
Hide resolved
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.
Needs a corresponding desul
pull request.
5a2f48b
to
10c47a5
Compare
Updated atomic_fetch ops too. |
The desul pull reqiuest has been merged.
There are still CI failures in the 32-bit build:
We could ignore that failure by disabling the test for 32bit, adding a FIXME, and move on, of course. There are other tests failing for |
// disable division test for 32bit where we have accuracy issues with | ||
// division atomics still compile it though |
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.
// disable division test for 32bit where we have accuracy issues with | |
// division atomics still compile it though | |
// FIXME_32BIT disable division test for 32bit where we have accuracy issues with | |
// division atomics, still compile it though |
old_val, update) | ||
: true)); | ||
|
||
// disable division test for 32bit where we have accuracy issues with |
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.
// disable division test for 32bit where we have accuracy issues with | |
// FIXME_32BIT disable division test for 32bit where we have accuracy issues with |
@@ -22,8 +22,11 @@ TEST(TEST_CATEGORY, atomic_operations_double) { | |||
const int end = 11; | |||
for (int i = start; i < end; ++i) { | |||
for (int t = 0; t < 8; t++) | |||
ASSERT_TRUE((TestAtomicOperations::AtomicOperationsTestNonIntegralType< | |||
double, TEST_EXECSPACE>(i, end - i + start, t))); | |||
// disable division test for 32bit where we have accuracy issues with |
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.
// disable division test for 32bit where we have accuracy issues with | |
// FIXME_32BIT disable division test for 32bit where we have accuracy issues with |
@@ -22,8 +22,11 @@ TEST(TEST_CATEGORY, atomic_operations_float) { | |||
const int end = 11; | |||
for (int i = start; i < end; ++i) { | |||
for (int t = 0; t < 8; t++) | |||
ASSERT_TRUE((TestAtomicOperations::AtomicOperationsTestNonIntegralType< | |||
double, TEST_EXECSPACE>(i, end - i + start, t))); | |||
// disable division test for 32bit where we have accuracy issues with |
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.
// disable division test for 32bit where we have accuracy issues with | |
// FIXME_32BIT disable division test for 32bit where we have accuracy issues with |
Fine with me if you add some |
|
||
// disable division test for 32bit where we have accuracy issues with | ||
// division atomics still compile it though | ||
if (sizeof(void*) == 8) |
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.
Kokkos/core/unit_test/TestAtomicOperations_complexdouble.hpp:43:8: error: suggest explicit braces to avoid ambiguous 'else' [-Werror=dangling-else]
if (sizeof(void*) == 8)
^
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.
Mainly looked at changes in TestAtomicOperations files. Those look fine to me.
@@ -205,4 +222,4 @@ __DESUL_IMPL_CUDA_ASM_ATOMIC_FETCH_BIN_OP() | |||
#undef __DESUL_IMPL_CUDA_ASM_ATOMIC_FETCH_INC | |||
#undef __DESUL_IMPL_CUDA_ASM_ATOMIC_FETCH_DEC | |||
#undef __DESUL_IMPL_CUDA_ASM_ATOMIC_FETCH_AND | |||
|
|||
#undef __DESUL_IMPL_CUDA_ASM_ATOMIC_FETCH_BIN_OP |
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.
Why is this added? Was it just missing before?
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.
yeah
This will fix atomic operations reported on slack, where atomic_min/max would give the wrong answer for a mix of negative/positive values. That was tracked down to a bug in the PTX for the atomic operations inside Desul, and not caught on our side due to test deficiencies.