-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
BUG: Fix underflow error in AVX512 implementation of ufunc exp/f64 #18933
Conversation
@seberg, CI(use_wheel (pull_request)) ufunc tests complaining about: > assert_array_equal(res_num.astype("O"), res_obj)
E AssertionError:
E Arrays are not equal
E
E Mismatched elements: 1 / 1 (100%)
E Max absolute difference: 2.7755575615628914e-17
E Max relative difference: 1.1489924412333298e-16
E x: array([-0.2415644752704905], dtype=object)
E y: array([-0.24156447527049046], dtype=object)
MyFloat = <class 'numpy.core.tests.test_ufunc.TestUfuncGenericLoops.test_unary_PyUFunc_O_O_method_full.<locals>.MyFloat'>
num_arr = array([0.78539816])
obj_arr = array([0.7853981633974483], dtype=object)
res_num = array([-0.24156448])
res_obj = array([-0.24156447527049046], dtype=object)
self = <numpy.core.tests.test_ufunc.TestUfuncGenericLoops object at 0x7f897731c950>
ufunc = <ufunc 'log'>
val = 0.7853981633974483 why we don't use numpy/numpy/core/tests/test_ufunc.py Lines 177 to 178 in 6ad4650
|
Yes, that seems too strong a requirement. |
@mattip, Should I replace it with |
close/open for another round. |
LGTM. Go ahead and fix the failing test so everything starts working again. |
Oh, you changed the test to almost-equal. I had problems elsewhere and changed it to 0-D, but this is just as well. EDIT: Sorry, that was unclear. That was in a work-in-progress, lets go with this! :) (I think I may have changed 0-stride vs. contiguous-stride for 0-D, which probably can change whether the SIMD loop is used sometimes?) |
Thanks for the quick fix, Sayed! |
That probably what happened, but avoid using |
@@ -776,7 +776,7 @@ AVX512F_exp_DOUBLE(npy_double * op, | |||
nearzero_mask = _mm512_kxor(nearzero_mask, nan_mask); | |||
overflow_mask = _mm512_kor(overflow_mask, | |||
_mm512_kxor(xmax_mask, inf_mask)); | |||
underflow_mask = _mm512_kor(underflow_mask, xmax_mask); | |||
underflow_mask = _mm512_kor(underflow_mask, xmin_mask); |
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.
oh yikes! /me hides in shame.
Thanks @seiko2plus for fixing this.
closes #18932, related to #18920, #18916.