Skip to content

TST, CI: test_partial_fit is failing in Linux CI (with NumPy 2.5.0) #117

Description

@tylerjereddy

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 dependabot bump of one of our actions versions (#116).

It is reproducible for me on x86_64 Linux 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 NumPy 2.4.6 allows the test case to pass again.

A sample traceback from running locally on x86_64 Linux is shown below the fold. The relative tolerance violation is actually rather large at 1.46476215 -- I would not be comfortable adjusting the rtol to be that loose.

Details
>       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

Some things that might be helpful to do here:

  • one could git bisect against NumPy to determine the root cause of the introduction of this test failure--is it an upstream bug?
  • one could check if i.e., it is the OpenBLAS version associated with NumPy that is the issue, or NumPy source proper
  • once the root cause is determined, propose a course of action--is it a bug on our side or upstream? is it an interaction with our library directly or with sklearn, etc.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions