Closed hmenke closed 10 months ago
Easiest fix is probably to just bump the tolerances over the failing values.
Okay, increasing the tolerance seems to be the only option, because the failure depends on available CPU features. On a machine with AVX512 I was at first not able to reproduce, but then when setting MKL_CBWR
to
export MKL_CBWR="BRANCH=COMPATIBLE,STRICT"
to turn off all vectorization extensions the failures showed up again.
@Wentzell Could this have to do with the possible fast-math issues we were seeing?
We'll look into this soon. I'd like to understand a little better what's happening before bumping up test tolerances, as the user-specified tolerances should typically be satisfied or very nearly satisfied.
Thanks for the pull request, this has been merged and should fix the issue.
Prerequisites
Description
The tests for
imfreq_ops
andimtime_ops
fail the tolerance when run with Intel MKL. (Possibly related to #1?)
``` Running main() from /source/triqs.build/deps/GTest_src/googletest/src/gtest_main.cc [==========] Running 5 tests from 2 test suites. [----------] Global test environment set-up. [----------] 4 tests from imfreq_ops [ RUN ] imfreq_ops.interp_matrix eps = 1.000000e-10, Lambda = 1.000000e+03 Imag freq: l^2 err = 1.831801e-10, L^inf err = 8.042914e-09 /source/triqs.build/deps/cppdlr_src/test/c++/imfreq_ops.cpp:182: Failure Expected: (errlinf) < (100 * eps), actual: 1.0536994972037939e-08 vs 1e-08 /source/triqs.build/deps/cppdlr_src/test/c++/imfreq_ops.cpp:183: Failure Expected: (errl2) < (2 * eps), actual: 2.6854942394814565e-10 vs 2e-10 Imag time: L^2 err = 2.685494e-10, L^inf err = 1.053699e-08 [ FAILED ] imfreq_ops.interp_matrix (406 ms) [ RUN ] imfreq_ops.interp_scalar eps = 1.000000e-10, Lambda = 1.000000e+03 Imag freq: l^2 err = 7.170216e-11, L^inf err = 4.316508e-09 [ OK ] imfreq_ops.interp_scalar (251 ms) [ RUN ] imfreq_ops.interp_matrix_sym_fer eps = 1.000000e-10, Lambda = 1.000000e+03 Imag freq: l^2 err = 5.613459e-12, L^inf err = 5.393007e-10 Imag time: L^2 err = 6.595356e-12, L^inf err = 1.887863e-10 [ OK ] imfreq_ops.interp_matrix_sym_fer (405 ms) [ RUN ] imfreq_ops.interp_matrix_sym_bos eps = 1.000000e-10, Lambda = 1.000000e+03 Imag freq: l^2 err = 1.091396e-11, L^inf err = 1.859275e-09 Imag time: L^2 err = 1.405661e-11, L^inf err = 5.773454e-10 [ OK ] imfreq_ops.interp_matrix_sym_bos (521 ms) [----------] 4 tests from imfreq_ops (1602 ms total) [----------] 1 test from dlr_imfreq [ RUN ] dlr_imfreq.h5_rw [ OK ] dlr_imfreq.h5_rw (166 ms) [----------] 1 test from dlr_imfreq (166 ms total) [----------] Global test environment tear-down [==========] 5 tests from 2 test suites ran. (1769 ms total) [ PASSED ] 4 tests. [ FAILED ] 1 test, listed below: [ FAILED ] imfreq_ops.interp_matrix 1 FAILED TEST ```imfreq_ops
``` Running main() from /source/triqs.build/deps/GTest_src/googletest/src/gtest_main.cc [==========] Running 14 tests from 2 test suites. [----------] Global test environment set-up. [----------] 13 tests from imtime_ops [ RUN ] imtime_ops.interp_matrix eps = 1.000000e-10, Lambda = 1.000000e+03 /source/triqs.build/deps/cppdlr_src/test/c++/imtime_ops.cpp:165: Failure Expected: (errl2) < (eps), actual: 1.6029439334350401e-10 vs 1e-10 Imag time: L^2 err = 1.602944e-10, L^inf err = 8.505687e-10 /source/triqs.build/deps/cppdlr_src/test/c++/imtime_ops.cpp:183: Failure Expected: (errl2) < (eps), actual: 1.6030237139053056e-10 vs 1e-10 Imag freq: l^2 err = 1.603024e-10, L^inf err = 9.658213e-09 [ FAILED ] imtime_ops.interp_matrix (471 ms) [ RUN ] imtime_ops.interp_matrix_complex eps = 1.000000e-10, Lambda = 1.000000e+03 /source/triqs.build/deps/cppdlr_src/test/c++/imtime_ops.cpp:238: Failure Expected: (errl2) < (eps), actual: 1.6029439697593181e-10 vs 1e-10 Imag time: L^2 err = 1.602944e-10, L^inf err = 8.505687e-10 [ FAILED ] imtime_ops.interp_matrix_complex (183 ms) [ RUN ] imtime_ops.interp_scalar eps = 1.000000e-10, Lambda = 1.000000e+03 Imag time: L^2 err = 7.208404e-11, L^inf err = 5.949013e-10 [ OK ] imtime_ops.interp_scalar (136 ms) [ RUN ] imtime_ops.fit_matrix eps = 1.000000e-08, Lambda = 1.000000e+03, noise = 1.000000e-06 Imag time: L^2 err = 7.106571e-08, L^inf err = 8.355243e-07 [ OK ] imtime_ops.fit_matrix (177 ms) [ RUN ] imtime_ops.fit_matrix_cmplx eps = 1.000000e-08, Lambda = 1.000000e+03, noise = 1.000000e-06 Imag time: L^2 err = 1.390657e-06, L^inf err = 1.946862e-06 [ OK ] imtime_ops.fit_matrix_cmplx (215 ms) [ RUN ] imtime_ops.fit_scalar eps = 1.000000e-08, Lambda = 1.000000e+03, noise = 1.000000e-06 Imag time: L^2 err = 5.887686e-08, L^inf err = 9.043894e-07 [ OK ] imtime_ops.fit_scalar (124 ms) [ RUN ] imtime_ops.convolve_scalar_real eps = 1.000000e-12, Lambda = 1.000000e+03 /source/triqs.build/deps/cppdlr_src/test/c++/imtime_ops.cpp:532: Failure Expected: (errlinf) < (10 * eps), actual: 2.2399457288990732e-11 vs 9.9999999999999994e-12 /source/triqs.build/deps/cppdlr_src/test/c++/imtime_ops.cpp:533: Failure Expected: (errtlinf) < (10 * eps), actual: 2.2399554433505386e-11 vs 9.9999999999999994e-12 /source/triqs.build/deps/cppdlr_src/test/c++/imtime_ops.cpp:534: Failure Expected: (errl2) < (eps), actual: 3.1793264351165775e-12 vs 9.9999999999999998e-13 /source/triqs.build/deps/cppdlr_src/test/c++/imtime_ops.cpp:535: Failure Expected: (errtl2) < (eps), actual: 2.961859866378555e-12 vs 9.9999999999999998e-13 Ordinary convolution: L^inf err = 2.239946e-11, L^2 err = 3.179326e-12 Time-ordered convolution: L^inf err = 2.239955e-11, L^2 err = 2.961860e-12 [ FAILED ] imtime_ops.convolve_scalar_real (195 ms) [ RUN ] imtime_ops.convolve_scalar_cmplx eps = 1.000000e-12, Lambda = 1.000000e+03 /source/triqs.build/deps/cppdlr_src/test/c++/imtime_ops.cpp:618: Failure Expected: (errlinf) < (10 * eps), actual: 1.2444125591093425e-11 vs 9.9999999999999994e-12 /source/triqs.build/deps/cppdlr_src/test/c++/imtime_ops.cpp:619: Failure Expected: (errtlinf) < (10 * eps), actual: 1.2444229674501983e-11 vs 9.9999999999999994e-12 /source/triqs.build/deps/cppdlr_src/test/c++/imtime_ops.cpp:620: Failure Expected: (errl2) < (eps), actual: 1.7662826884969586e-12 vs 9.9999999999999998e-13 /source/triqs.build/deps/cppdlr_src/test/c++/imtime_ops.cpp:621: Failure Expected: (errtl2) < (eps), actual: 1.645477951212149e-12 vs 9.9999999999999998e-13 Ordinary convolution: L^inf err = 1.244413e-11, L^2 err = 1.766283e-12 Time-ordered convolution: L^inf err = 1.244423e-11, L^2 err = 1.645478e-12 [ FAILED ] imtime_ops.convolve_scalar_cmplx (182 ms) [ RUN ] imtime_ops.convolve_matrix_real eps = 1.000000e-12, Lambda = 1.000000e+03 /source/triqs.build/deps/cppdlr_src/test/c++/imtime_ops.cpp:708: Failure Expected: (errlinf) < (10 * eps), actual: 2.2399512800141963e-11 vs 9.9999999999999994e-12 /source/triqs.build/deps/cppdlr_src/test/c++/imtime_ops.cpp:709: Failure Expected: (errl2) < (2 * eps), actual: 6.3586095047429759e-12 vs 2e-12 /source/triqs.build/deps/cppdlr_src/test/c++/imtime_ops.cpp:710: Failure Expected: (errtlinf) < (10 * eps), actual: 2.2399443411202924e-11 vs 9.9999999999999994e-12 /source/triqs.build/deps/cppdlr_src/test/c++/imtime_ops.cpp:711: Failure Expected: (errtl2) < (2 * eps), actual: 5.9237008281555781e-12 vs 2e-12 Ordinary convolution: L^inf err = 2.239951e-11, L^2 err = 6.358610e-12 Time-ordered convolution: L^inf err = 2.239944e-11, L^2 err = 5.923701e-12 [ FAILED ] imtime_ops.convolve_matrix_real (282 ms) [ RUN ] imtime_ops.convolve_matrix_cmplx eps = 1.000000e-12, Lambda = 1.000000e+03 /source/triqs.build/deps/cppdlr_src/test/c++/imtime_ops.cpp:798: Failure Expected: (errlinf) < (10 * eps), actual: 1.2444163755009896e-11 vs 9.9999999999999994e-12 /source/triqs.build/deps/cppdlr_src/test/c++/imtime_ops.cpp:800: Failure Expected: (errtlinf) < (10 * eps), actual: 1.2444208857820271e-11 vs 9.9999999999999994e-12 Ordinary convolution: L^inf err = 1.244416e-11, L^2 err = 1.247914e-19 Time-ordered convolution: L^inf err = 1.244421e-11, L^2 err = 1.083039e-19 [ FAILED ] imtime_ops.convolve_matrix_cmplx (157 ms) [ RUN ] imtime_ops.refl_matrix eps = 1.000000e-10, Lambda = 1.000000e+01 Imag time: L^2 err = 2.817828e-11, L^inf err = 5.648537e-11 [ OK ] imtime_ops.refl_matrix (1 ms) [ RUN ] imtime_ops.interp_matrix_sym_fer eps = 1.000000e-10, Lambda = 1.000000e+03 Imag time: L^2 err = 1.434555e-11, L^inf err = 6.711230e-11 Imag freq: l^2 err = 1.434627e-11, L^inf err = 1.712101e-09 [ OK ] imtime_ops.interp_matrix_sym_fer (403 ms) [ RUN ] imtime_ops.interp_matrix_sym_bos eps = 1.000000e-10, Lambda = 1.000000e+03 Imag time: L^2 err = 1.399272e-11, L^inf err = 5.898525e-11 Imag freq: l^2 err = 1.399341e-11, L^inf err = 3.050253e-09 [ OK ] imtime_ops.interp_matrix_sym_bos (279 ms) [----------] 13 tests from imtime_ops (2811 ms total) [----------] 1 test from dlr_imtime [ RUN ] dlr_imtime.h5_rw [ OK ] dlr_imtime.h5_rw (50 ms) [----------] 1 test from dlr_imtime (50 ms total) [----------] Global test environment tear-down [==========] 14 tests from 2 test suites ran. (2861 ms total) [ PASSED ] 8 tests. [ FAILED ] 6 tests, listed below: [ FAILED ] imtime_ops.interp_matrix [ FAILED ] imtime_ops.interp_matrix_complex [ FAILED ] imtime_ops.convolve_scalar_real [ FAILED ] imtime_ops.convolve_scalar_cmplx [ FAILED ] imtime_ops.convolve_matrix_real [ FAILED ] imtime_ops.convolve_matrix_cmplx 6 FAILED TESTS ```imtime_ops
Steps to Reproduce
Expected behavior: Tests pass Actual behavior: Tests fail
Versions
https://github.com/flatironinstitute/cppdlr/commit/861df9396e01e650f84d63df3122a68280695cee
Ubuntu 22.04 jammy
Formatting
Please use markdown in your issue message. A useful summary of commands can be found here.
Additional Information
Any additional information, configuration or data that might be necessary to reproduce the issue.