Skip to content
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

Tolerance updated in RegressionTest in test/HD/sod/testme.py #258

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dutta-alankar
Copy link
Contributor

@dutta-alankar dutta-alankar commented Aug 30, 2024

The default tolerance=0 for Regression test is causing the following error. I guess this is because floating point numbers cannot be exactly compared.

Here is the error message on running ./testme.py -all (in the directory test/HD/sod) as given in the README.md instruction

Traceback (most recent call last):
  File "/Users/alankard/coding/idefix/test/HD/sod/./testme.py", line 45, in <module>
    testMe(test)
  File "/Users/alankard/coding/idefix/test/HD/sod/./testme.py", line 28, in testMe
    test.nonRegressionTest(filename=name)
  File "/Users/alankard/coding/idefix/pytools/idfx_test.py", line 321, in nonRegressionTest
    assert error <= tolerance, bcolors.FAIL+"Error (%e) above tolerance (%e)"%(error,tolerance)+bcolors.ENDC
AssertionError: Error (7.303939e-16) above tolerance (0.000000e+00)

@glesur
Copy link
Contributor

glesur commented Sep 10, 2024

The zero tolerance for this test is by design, and it passes the CI on the tested architecture (admittedly disabling some optimisations for nvcc). Which configuration did you test?

@dutta-alankar
Copy link
Contributor Author

dutta-alankar commented Sep 10, 2024

I was trying this on my M3 MacBook Pro. I guess the exact match of floating point operations is possible only for same architecture machines?

@glesur
Copy link
Contributor

glesur commented Sep 16, 2024

This error is most probably because LLVM enable fmad instruction on Apple Mx processors, hence it breaks the precision test. These tests should pass with absolute precision when fmad instructions are disabled (that's how CI/CD are performed). So the first question is: how can one disable fmad optimisations in Apple LLVM? (I can't test because I don't have a mac with an Mx processor).

I'm reluctant at changing the precision of these tests, as these have been life savers in the past.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants