> assert_allclose(
getattr(pf_model, attr), getattr(ff_model, attr), rtol=1e-5, atol=1e-3
)
E AssertionError:
E Not equal to tolerance rtol=1e-05, atol=0.001
E
E Mismatched elements: 1 / 100 (1%)
E Mismatch at index:
E [1, 3, 1]: 0.0003323436399264836 (ACTUAL), -0.0007150832738717083 (DESIRED)
E Max absolute difference among violations: 0.00104743
E Max relative difference among violations: 1.46476215
E ACTUAL: array([[[-1.215602e-01, -1.612826e-01],
E [-6.078257e-02, -8.063879e-02],
E [-4.978902e-06, 4.978902e-06],...
E DESIRED: array([[[-1.215602e-01, -1.612826e-01],
E [-6.078257e-02, -8.063879e-02],
E [-4.978902e-06, 4.978902e-06],...
src/gfdl/tests/test_model.py:581: AssertionError
Here is a sample log of the test failure: https://github.com/lanl/GFDL/actions/runs/28083278183/job/83143018162?pr=116. The PR where that occurs is clearly unrelated, since it is just a
dependabotbump of one of our actions versions (#116).It is reproducible for me on
x86_64Linux locally via this incantation:python -m pytest "src/gfdl/tests/test_model.py::test_partial_fit[EnsembleGFDLClassifier-None-coeffs_-None-range-log_softmax-2-hidden_layer_sizes1]"The error is only reproducible with NumPy
2.5.0, which was released 3 days ago (https://github.com/numpy/numpy/releases/tag/v2.5.0). Downgrading to NumPy2.4.6allows the test case to pass again.A sample traceback from running locally on
x86_64Linux is shown below the fold. The relative tolerance violation is actually rather large at1.46476215-- I would not be comfortable adjusting thertolto be that loose.Details
Some things that might be helpful to do here:
git bisectagainst NumPy to determine the root cause of the introduction of this test failure--is it an upstream bug?OpenBLASversion associated with NumPy that is the issue, or NumPy source propersklearn, etc.