Skip to content

TST: interpolate: mark rbf chunking tests as slow #16138

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

Merged
merged 1 commit into from
May 10, 2022

Conversation

ev-br
Copy link
Member

@ev-br ev-br commented May 7, 2022

Reference issue

closes gh-16136

What does this implement/fix?

Mark RBFInterpolator chunking tests as slow, because:

$ python dev.py -t scipy.interpolate.tests.test_rbfinterp -- --durations=10
ninja: Entering directory `build'
[2/2] Generating scipy/generate-config with a custom command
Build OK
Installing, see meson-install.log...
Installation OK
Running tests for scipy version:1.9.0.dev0+1994.c166a9b, installed at:/home/br/repos/scipy/scipy/build-install/lib/python3.8/site-packages/scipy
=========================================================================================== test session starts ===========================================================================================
platform linux -- Python 3.8.10, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/br/repos/scipy/scipy, configfile: pytest.ini
collected 185 items                                                                                                                                                                                       

scipy/interpolate/tests/test_rbfinterp.py ......................................................................................................................................................... [ 82%]
................................                                                                                                                                                                    [100%]

========================================================================================== slowest 10 durations ===========================================================================================
20.90s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::TestRBFInterpolatorNeighborsInf::test_chunking
10.48s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::TestRBFInterpolatorNeighbors20::test_chunking
2.11s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::TestRBFInterpolatorNeighborsNone::test_chunking
0.48s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::TestRBFInterpolatorNeighborsInf::test_smoothing_misfit[thin_plate_spline]
0.47s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::TestRBFInterpolatorNeighborsInf::test_smoothing_misfit[linear]
0.36s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::test_conditionally_positive_definite[cubic]
0.35s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::test_conditionally_positive_definite[quintic]
0.35s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::test_conditionally_positive_definite[thin_plate_spline]
0.35s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::test_conditionally_positive_definite[gaussian]
0.35s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::test_conditionally_positive_definite[linear]
========================================================================================== 185 passed in 40.77s ===========================================================================================

@ev-br
Copy link
Member Author

ev-br commented May 7, 2022

@segasai maybe you could think of a way to excercise the chunking functionality in a smaller/shorter test instead?

@ev-br ev-br added scipy.interpolate maintenance Items related to regular maintenance tasks labels May 7, 2022
@rgommers
Copy link
Member

@ev-br given the comment on gh-16136, does setting OPENBLAS_NUM_THREADS=1 help, and if so how many threads does your machine default to to give results like you reported above?

@ev-br
Copy link
Member Author

ev-br commented May 10, 2022

It does seem to be sensitive to the OpenBLAS defaults; the default seems to be oversubscribing indeed (8 processes seen in htop); setting OPENBLAS_NUM_THREADS to 1 does limit the number of threads and lowers the test time; but no, even with a single thread it is still not very reasonable (33 sec is better than 41 sec but still). Not sure what it would be on other linalg implementations (unlikely to be more reasonable).

Openblas does its default:

$ python dev.py -t scipy.interpolate.tests.test_rbfinterp -- --durations=10
ninja: Entering directory `build'
[2/2] Generating scipy/generate-config with a custom command
Build OK
Installing, see meson-install.log...
Installation OK
Running tests for scipy version:1.9.0.dev0+2002.168046f, installed at:/home/br/repos/scipy/scipy/build-install/lib/python3.8/site-packages/scipy
=========================================================================================== test session starts ===========================================================================================
platform linux -- Python 3.8.10, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/br/repos/scipy/scipy, configfile: pytest.ini
collected 185 items                                                                                                                                                                                       

scipy/interpolate/tests/test_rbfinterp.py ......................................................................................................................................................... [ 82%]
................................                                                                                                                                                                    [100%]

========================================================================================== slowest 10 durations ===========================================================================================
20.51s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::TestRBFInterpolatorNeighborsInf::test_chunking
10.23s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::TestRBFInterpolatorNeighbors20::test_chunking
2.20s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::TestRBFInterpolatorNeighborsNone::test_chunking
0.59s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::TestRBFInterpolatorNeighborsInf::test_smoothing_misfit[linear]
0.35s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::test_conditionally_positive_definite[cubic]
0.35s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::test_conditionally_positive_definite[quintic]
0.35s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::test_conditionally_positive_definite[thin_plate_spline]
0.35s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::test_conditionally_positive_definite[gaussian]
0.35s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::test_conditionally_positive_definite[multiquadric]
0.35s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::test_conditionally_positive_definite[linear]
========================================================================================== 185 passed in 41.07s ===========================================================================================

Setting OPENBLAS_NUM_THREADS:

$ export OPENBLAS_NUM_THREADS=1; python dev.py -t scipy.interpolate.tests.test_rbfinterp -- --durations=10
ninja: Entering directory `build'
[2/2] Generating scipy/generate-config with a custom command
Build OK
Installing, see meson-install.log...
Installation OK
Running tests for scipy version:1.9.0.dev0+2002.168046f, installed at:/home/br/repos/scipy/scipy/build-install/lib/python3.8/site-packages/scipy
=========================================================================================== test session starts ===========================================================================================
platform linux -- Python 3.8.10, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/br/repos/scipy/scipy, configfile: pytest.ini
collected 185 items                                                                                                                                                                                       

scipy/interpolate/tests/test_rbfinterp.py ......................................................................................................................................................... [ 82%]
................................                                                                                                                                                                    [100%]

========================================================================================== slowest 10 durations ===========================================================================================
19.10s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::TestRBFInterpolatorNeighborsInf::test_chunking
8.73s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::TestRBFInterpolatorNeighbors20::test_chunking
1.41s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::TestRBFInterpolatorNeighborsNone::test_chunking
0.39s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::test_conditionally_positive_definite[quintic]
0.37s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::test_conditionally_positive_definite[multiquadric]
0.36s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::test_conditionally_positive_definite[thin_plate_spline]
0.36s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::test_conditionally_positive_definite[cubic]
0.36s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::test_conditionally_positive_definite[inverse_quadratic]
0.35s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::test_conditionally_positive_definite[linear]
0.35s call     build-install/lib/python3.8/site-packages/scipy/interpolate/tests/test_rbfinterp.py::test_conditionally_positive_definite[inverse_multiquadric]
========================================================================================== 185 passed in 33.34s ===========================================================================================```

Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm yes that's way too slow, not sure how that was missed in previous PR reviews. In it goes, thanks @ev-br

@rgommers rgommers merged commit fb7a093 into scipy:main May 10, 2022
@rgommers rgommers added this to the 1.9.0 milestone May 10, 2022
@ev-br
Copy link
Member Author

ev-br commented May 10, 2022

not sure how that was missed in previous PR reviews.

That was me as well :-). Not sure how to systematically check it other than running --durations=N manually of each PR. Would be happy to hear suggestions.

@rgommers
Copy link
Member

For big new feature PRs I do indeed check manually.

@tupui
Copy link
Member

tupui commented May 10, 2022

Now we can have job summaries with actions: https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/. Maybe we could add such things (also thinking about benchmarks) as summary.

@ev-br
Copy link
Member Author

ev-br commented May 10, 2022

For big new feature PRs I do indeed check manually.

Point taken, thanks for confirming the workflow.

Re job summaries: would be great if it could show stats about what changed in the PR specifically (total CI time etc are available).

@tupui
Copy link
Member

tupui commented May 10, 2022

Re job summaries: would be great if it could show stats about what changed in the PR specifically (total CI time etc are available).

In the end it's a matter of computing what we want and saving this to an env variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Items related to regular maintenance tasks scipy.interpolate
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Slow tests in test_rbfinterp
3 participants