-
Notifications
You must be signed in to change notification settings - Fork 465
Many test failures when compiled with -march=haswell -ftree-vectorize
#732
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
Aggressive compiler optimization and/or the usage of a highly optimized BLAS is known sources for failures in the stringent LAPACK tests. See for example the LAPACK test summary shown in OpenMathLib/OpenBLAS#3609. The failures do not necessarily mean that something is fundamentally wrong.
The failures related to |
Description
Tested on
master
, compiling LAPACK withbrings about many test failures:
There are three categories of failures here:
CGEEV
is called to provide eigenvectors, it will give the exact same eigenvalues (no numerical tolerance) as when it does not provide eigenvectors.Applying the patch to GCC, tests go down to:
Increasing the tolerance for 2) using
we get
The third one is more complex to analyze. The way I understand it is that gfortran has some freedom in how to apply FMA's to expressions such as
a*b+c*d
(ie.fma(a,b,c*d)
orfma(c,d,a*b)
) and these give slightly different results.The loop bounds for computing and not computing eigenvectors for various loops are different, hence it is often the case that a loop with eigenvectors is vectorized, and without isn't, or for different loop iterations, and the vectorized use of FMA isn't identical to the unvectorized use of FMA. And with complex numbers of course there are even more permutations possible. Adding parentheses forces the compiler to use one variety.
Applying this patch:
makes the test failures go to 0.
But it looks quite fragile, in that it takes trial and error to see which expressions need braces.
Would it be ok instead to replace test 5, e.g.
lapack/TESTING/EIG/cdrvev.f
Lines 799 to 805 in 28f7e83
by a test that uses tolerances, like the one used below, or would that go against some specifications?
lapack/TESTING/EIG/cchkhs.f
Line 87 in 28f7e83
lapack/TESTING/EIG/cchkhs.f
Lines 825 to 835 in 28f7e83
Checklist
The text was updated successfully, but these errors were encountered: