-
-
Notifications
You must be signed in to change notification settings - Fork 22
Non-deterministic behavior calculating opnorm(A)
#539
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
Comments
Can't reproduce on
I always get the same results. Possibly a different RNG seed, or skylake vs ivybridge? The results should be deterministic: this is a well-conditioned operation. Is the bug present on A' instead of A? Are the other singular values correct? Maybe fill an issue with OpenBLAS? |
Could threading be the cause of the non-determinism? |
Answering the questions:
Additional observations:
Again, the old version succeeds:
|
Try BLAS.set_num_threads |
Bingo! Thanks Antoine.
By the way, on
How should I proceed? (setting num_threads=1 in my startup-config would be a cheap work-around). |
0.6.3 shipped with a very old version of openblas. 0.6.4 will at least ship with 0.3.0, and master is on 0.3.1. So, if you can still reproduce on 0.6.4 (should ship next week) or master, I would report upstream. Otherwise close this. |
Probably the same issue: OpenMathLib/OpenBLAS#1666 |
@jebej Unlikely, the offending commit in that issue was 12 days ago. @ViralBShah the bug is present on master, not on 0.6, so it's probably worth it to open an issue in OpenBLAS. @KlausC The good thing is you've managed to reduce it to a matrix failing, so you can just write it to a file and post it on a bug report in OpenBLAS. |
@antoine-levitt IIUC that commit made it into OpenBLAS 0.3.1, which made it in Julia on July 1st. |
I think we should revert the 0.3.1 upgrade. See JuliaLang/julia#28002. This is a quite serious bug that could affect anything that uses threaded BLAS which is a lot. |
Or add the OpenMathLib/OpenBLAS@5f2a3c0 patch perhaps? |
Yes. We could also do that. Are we aware of any fixes we need from 0.3.1? It might be a bit simpler not to introduce a patch and just wait for 0.3.2. |
There are no known 0.3.1 fixes that we need, to the best of my knowledge. |
The upstream patch is not merged yet. Given that we want 0.7-beta2 out soon, reverting seems better, and then moving to 0.3.2 before the final 0.7 release seems lesser work. |
Hmm, OpenMathLib/OpenBLAS#1667 seems merged. There is a comment saying (OpenMathLib/OpenBLAS#1673 (comment))
but I don't know how big that speedup is. |
After openblas 0.3.0 has been re-established, the bug cannot be reproduced on my configuration. The used version is found in |
Fixed by JuliaLang/julia#28002 |
The following experiment shows, that the maximal singular value calculated for a dense matrix is not calculated reliably in some cases. There is a relative standard deviation of
3e-4
in this example. Same as forsvd(AE).S[1]
is observed forsvdvals(AE)[1]
andopnorm(AE)
.The behaviour seems to be correct for smaller matrices (e.g. (500,500) worked as expected), while it was reproducible for larger matrices.
As far as I saw, the calculations are done in the external
openblas
dependency.The text was updated successfully, but these errors were encountered: