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

Test failure on MacOS Sequoia in numexpr/numpy comparison #458

Open
vnmanoharan opened this issue Feb 1, 2025 · 1 comment · May be fixed by #459
Open

Test failure on MacOS Sequoia in numexpr/numpy comparison #458

vnmanoharan opened this issue Feb 1, 2025 · 1 comment · May be fixed by #459

Comments

@vnmanoharan
Copy link
Contributor

Seeing a failure in holopy/scattering/tests/test_lens.py::TestLens::test_integrand_prefactor_same_with_numexpr_as_without() on the latest develop branch under MacOS 15.2 (Sequoia) with numpy 1.20.3, numexpr 2.10.0. This failure doesn't occur in our macos-latest CI test runner, which uses MacOS 14.7, so it seems to be related to some change in the update to MacOS 15.

_______ TestLens.test_integrand_prefactor_same_with_numexpr_as_without _______

[gw0] darwin -- Python 3.9.21

self = <holopy.scattering.tests.test_lens.TestLens testMethod=test_integrand_prefactor_same_with_numexpr_as_without>

    @pytest.mark.skipif(not lens.NUMEXPR_INSTALLED,
                        reason = "numexpr package required")
    def test_integrand_prefactor_same_with_numexpr_as_without(self):
        np.random.seed(1649)
        krho, phi, kz = np.random.randn(3, 101)
    
        prefactor_numexpr = LENSMIE._integrand_prefactor(krho, phi, kz)
        prefactor_numpy = LENSMIE_NO_NE._integrand_prefactor(krho, phi, kz)
        if ne.get_vml_version() is None:
>           assert_equal(prefactor_numexpr, prefactor_numpy)
E           AssertionError: 
E           Arrays are not equal
E           
E           Mismatched elements: 7133 / 1010000 (0.706%)
E           Max absolute difference: 3.0304372e-20
E           Max relative difference: 4.57318647e-16
E            x: array([[[5.257655e-10-3.105010e-14j, 5.257655e-10-1.243220e-15j,
E                    5.257655e-10-5.002021e-14j, ..., 5.257655e-10+5.604645e-14j,
E                    5.257655e-10+1.937360e-14j, 5.257655e-10-1.434728e-14j],...
E            y: array([[[5.257655e-10-3.105010e-14j, 5.257655e-10-1.243220e-15j,
E                    5.257655e-10-5.002021e-14j, ..., 5.257655e-10+5.604645e-14j,
E                    5.257655e-10+1.937360e-14j, 5.257655e-10-1.434728e-14j],...

holopy/scattering/tests/test_lens.py:188: AssertionError
========================== short test summary info ===========================
FAILED holopy/scattering/tests/test_lens.py::TestLens::test_integrand_prefactor_same_with_numexpr_as_without - AssertionError: 
=========== 1 failed, 649 passed, 12 skipped, 2 xfailed in 23.62s ============
@vnmanoharan
Copy link
Contributor Author

Probably need to increase tolerance for the test. We previously increased tolerance for systems using the Intel MKL. Other platforms may be using accelerated math libraries as well, which will cause test failures if numexpr or numpy (but not both) use them by default; for example, numpy can be built using Apple's Accelerate framework.

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 a pull request may close this issue.

1 participant