-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
BUG: fix possible overlap issues with avx enabled #12398
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
Conversation
Fix the overlap check for vectors larger than 16 bytes. Only an issue when avx is enabled at compile time.
Looks straight forward to me. |
LGTM. |
Let's get this in then. Thanks Julian. |
+1 please merge , i will test it on my distro regards |
@juliantaylor what commit from #11113 does that? i am a bit lost about that point |
It seems #11113 is for compile time. |
@mattip you mean like : if (__builtin_cpu_supports("avx512dq") like that? |
yes, but more like
in the loop selector function for the appropriate ufuncs |
no that PR is runtime not compile time the dispatching happens at ufunc initialization time same as it is already done for integers. |
@juliantaylor This breaks testing on my machine. The error is during test collection and is completely uninformative, but here it is
Reverting this commit fixes the problem. I have no idea as to why this would compile but cause failures.
I'm sorry I didn't see this earlier. No one else seems to be having problems, so I assume it is something specific to my machine/environment. Note that if I knock out the failing assert the tests run, but there are a lot of errors. How can I debug this? |
I'm guessing one of the parameters is off. |
If I undefine |
If I remove |
@charris , how are you running the tests? I can help to try to replicate the issue import numpy |
Confirmed with gcc 8.2.1 20180502
|
@VictorRodriguez Any luck? |
@charris , almost , I remove this from the patch : |
@charris i post 2 commits: one to revert the change other try to fix the issue |
Yeah, 2) is not an option for a fix. I'm inclining towards 1), but by undefining the AVX macros up top until this is figured out. I suspect Julian is on vacation, so we will have to figure this out for ourselves. |
hm I applied the vector size code to code was not actually adapted to larger vector sizes... |
While I once again screwed this up badly we should think about how we deal with this type of code in future. |
@juliantaylor No need to beat yourself up over it, we'll get things fixed up and move on. Even if we leave AVX to the compiler, we will still need to deal with overlap issues, correct? I am certainly not opposed to the compiler approach, IIRC there has so far been no convincing evidence that explicit code gives an advantage. But there is a time to fix issue. Would simply undefining the AVX macros be a quick fix so I can get a release candidate out for initial testing? Or would that still leave overlap issues to be dealt with? |
#12555 fix the bug for me , thanks |
This uptream patch fix error reported in numpy/numpy#12398 (comment) numpy/linalg/tests/test_linalg.py:296: in _stride_comb_iter assert_(np.all(xi == x)) AssertionError Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
Fix the overlap check for vectors larger than 16 bytes. Only an issue
when avx is enabled at compile time.
The actual fix is in the first few hunks, whether we want to use the macro in the rest of the code is debatable as it introduces a dependency between the macros being used and the code, unlikely be a practical issue though.