MDAnalysis / mdanalysis

MDAnalysis is a Python library to analyze molecular dynamics simulations.
https://mdanalysis.org
Other
1.26k stars 641 forks source link

TST, MAINT: test_thread_limit_apply failure with NumPy 2.1.0.dev #4570

Open tylerjereddy opened 2 months ago

tylerjereddy commented 2 months ago

Using branch from gh-4482 locally on x86-64 Linux alongside NumPy main branch:

python -m pytest MDAnalysisTests/transformations/test_base.py::test_thread_limit_apply

______________________________________________________________________________________________________ test_thread_limit_apply _______________________________________________________________________________________________________

u = <Universe with 3341 atoms>

    def test_thread_limit_apply(u):
        default_thread_info = threadpool_info()
        default_num_thread_limit_list = [thread_info['num_threads']
                                         for thread_info in default_thread_info]

        new_trans = CustomTransformation(max_threads=2)
        _ = new_trans(u.trajectory.ts)
        for thread_info in new_trans.runtime_info:
>           assert thread_info['num_threads'] == 2
E           assert 1 == 2

MDAnalysisTests/transformations/test_base.py:98: AssertionError

I don't have any specific advice on this one yet, queried upstream at: https://github.com/numpy/numpy/issues/26318

tylerjereddy commented 2 months ago

Sounds like it'll be fixed upstream in either NumPy or threadpoolctl, though the discussion is too complex to figure out who will ultimately solve it just yet.

IAlibay commented 2 months ago

@tylerjereddy do you know if this is still an issue? I'm fixing our tests against nightly wheels here https://github.com/MDAnalysis/mdanalysis/actions/runs/8870195702/job/24351713441?pr=4502#step:9:127 and can't seem to be able to reproduce the test failure.

tylerjereddy commented 2 months ago

I think the threadpoolctl fix/release isn't out yet per this table: https://github.com/numpy/numpy/issues/26191

Maybe the NumPy bump to use OpenBLAS 0.3.27 in main and 2.0.0rc2 somehow fixed it. Anyway, if you want to close this I don't mind. Could always reopen if someone actually observes it again.

IAlibay commented 2 months ago

Thanks for the update @tylerjereddy - I'd say let's leave it open. At least on my end I'm not 100% sure the nightly CI is working exactly as expected, I'll try a local build to see if I can reproduce.