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: np.dot incorrect for more than 2^30 complex elements #22262
Comments
This also happens for complex64 when doing 2 ** 16 elements. |
Yap, that is a pretty annoying bug in NumPy, thanks for the report! It doesn't +matter here (the bug is clearly in NumPy), but to report your blas information, I would suggest using:
@MatteoRaso are you sure about the 2**16 observation, it really doesn't make sense to me that this could be related. Maybe it just failed for you due to random fluctuations? I.e. make sure to inspect If there is something odd about 2**16, please report your blas version! |
The iteration was simply using the wrong value, the larger value might even work sometimes, but then we do another iteration counting the remaining elements twice. Closes numpygh-22262
The iteration was simply using the wrong value, the larger value might even work sometimes, but then we do another iteration counting the remaining elements twice. Closes numpygh-22262
Describe the issue:
np.dot
gives the wrong answer when applied to compute dot products of 1d complex arrays with length greater than 2^30 elements. Notes:top
,np.dot
used multiple threads while(x**2).sum()
used only one.Running on
Ubuntu 18.04.3 LTS
, reproduced on different machines w/ CPUsIntel(R) Xeon(R) CPU E5-2680
andIntel(R) Xeon(R) Gold 5218 CPU
. Probably MKL for multithreaded backend:Reproduce the code example:
Error message:
No response
NumPy/Python version information:
1.21.2 3.9.10 | packaged by conda-forge | (main, Feb 1 2022, 21:24:37)
[GCC 9.4.0]
Context for the issue:
This is a dangerous silent failure.
The text was updated successfully, but these errors were encountered: