Skip to content

add test for numpy - #276

Merged
casparvl merged 7 commits into
EESSI:mainfrom
smoors:numpy
Aug 13, 2025
Merged

casparvl merged 7 commits into
EESSI:mainfrom
smoors:numpy

Conversation

@smoors

@smoors smoors commented Jul 11, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

@casparvl casparvl left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm wondering a bit what our policy should be regarding running multiple iterations. We do the same for OSU, of course, but there it tends to be really fast. This test seems to take quite a substantial amount of time. I'm wondering if we should have the test be 'responsible' for doing multiple iterations, thus producing a more reproducible number, of whether we should ask ReFrame to do reruns --reruns N. The downside of the latter is that it'll create multiple ReFrame reports, show up as separate points in the dashboard, (which then show a lot of variation) etc. It's probably nicer to get a single performance number that is (reasonably) reliable. Also, the test probably knows what a natural variation is, and how many iterations would be needed to 'average' that out.

I guess I'm coming to the conclusion it should be set in the test :) But good to think about and make sure we make the same assumption everywhere.

I guess my next question would be: do we really need 20 here to get to a reasonably stable number? I'm running on 16 cores, and it takes 10-15 minutes it seems. Most of the time is spent by eigendec (54s or so). Yes, there is value in having the test produce accurate numbers. But, there's also value in having a test that is quick to run - chances are it will be run more often.

E.g. I'd like to have some numpy test that is tagged with the CI tag, and thus has to run with O(minutes). One option would be to reduce iterations. If we do 4 iterations for each, and one for eigendec, I think it'll be <5 minutes and thus qualify for the CI tag. Alternatively, we do somewhat more iterations, but make the test to be run an argument. You can then easily make a parameter running over all supported tests, and simply add the CI tag for all parameter values except eigendec.

@casparvl

Copy link
Copy Markdown
Collaborator

To back my review up with some numbers, I ran the tests three times:

[       OK ] (1/1) EESSI_NumPy %scale=1_8_node %module_name=SciPy-bundle/2023.11-gfbf-2023b /6677ad66 @snellius:rome+default
P: dot: 2.98 s (r:0, l:None, u:None)
P: svd: 7.4 s (r:0, l:None, u:None)
P: cholesky: 3.92 s (r:0, l:None, u:None)
P: eigendec: 54.13 s (r:0, l:None, u:None)
P: inv: 4.38 s (r:0, l:None, u:None)
[----------] all spawned checks have finished

[----------] start processing checks
[ RUN      ] EESSI_NumPy %scale=1_8_node %module_name=SciPy-bundle/2023.11-gfbf-2023b /6677ad66 @snellius:rome+default
[       OK ] (1/1) EESSI_NumPy %scale=1_8_node %module_name=SciPy-bundle/2023.11-gfbf-2023b /6677ad66 @snellius:rome+default
P: dot: 3.02 s (r:0, l:None, u:None)
P: svd: 7.49 s (r:0, l:None, u:None)
P: cholesky: 3.92 s (r:0, l:None, u:None)
P: eigendec: 54.33 s (r:0, l:None, u:None)
P: inv: 4.38 s (r:0, l:None, u:None)
[----------] all spawned checks have finished

[----------] start processing checks
[ RUN      ] EESSI_NumPy %scale=1_8_node %module_name=SciPy-bundle/2023.11-gfbf-2023b /6677ad66 @snellius:rome+default
[       OK ] (1/1) EESSI_NumPy %scale=1_8_node %module_name=SciPy-bundle/2023.11-gfbf-2023b /6677ad66 @snellius:rome+default
P: dot: 3.02 s (r:0, l:None, u:None)
P: svd: 7.42 s (r:0, l:None, u:None)
P: cholesky: 3.89 s (r:0, l:None, u:None)
P: eigendec: 54.47 s (r:0, l:None, u:None)
P: inv: 4.34 s (r:0, l:None, u:None)

variation is dot is +/- 0.02s, which is 0.67%. for SVD, it's about 0.04, also 0.7%, for cholesky, it's 0.015, which is 0.5%, , for eigendec it's +/- 0.18, which is 0.3%, and for inv, it's 0.02, which is 0.67%. For Gaussian distributed random variation, the standard error of the mean scales with the square root of the number of measurement points, so that's sqrt(20) ~ 4.5 for dot, and sqrt(10) ~3.2 for eigendec. That means that, even with N=1 the standard deviation is of the order of 2-3%. With N=4, it'd be 1-1.5%.

So, I think the approach of four iters for each, and only one for eigendec is reasonable. My bet is that other variations (e.g. do you get a top-of-rack node, or bottom-of-rack node, are other jobs asking more memory bandwidth or generating more heat, etc) have way more influence than can be averaged out by repeated measurements within the same allocation.

@smoors

smoors commented Jul 30, 2025

Copy link
Copy Markdown
Collaborator Author

@casparvl thanks for all the good suggestions, implemented in 0749140

@casparvl casparvl left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, I have one (small) final change to request: now that the runtime is substantially shorter, can you make sure the test gets the CI tag? (I can't recall the exact keyword, but we have something like benchmark_name_CI)

Anyway, tests are all succesful:

[  PASSED  ] Ran 42/42 test case(s) from 21 check(s) (0 failure(s), 0 skipped, 0 aborted)

(3 modules, at all scales, on two CPU partitions)

@smoors

smoors commented Aug 1, 2025

Copy link
Copy Markdown
Collaborator Author

@casparvl added the CI tag

if you don't mind i also added an extra class attribute is_ci_test as it's a bit silly in this case to have to define both bench_name and bench_ci to some random string.

@casparvl casparvl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

reframe -c eessi/testsuite/tests/apps/numpy/ --system=snellius:rome --run -t CI
...
[  PASSED  ] Ran 21/21 test case(s) from 21 check(s) (0 failure(s), 0 skipped, 0 aborted)
[==========] Finished on Wed Aug 13 15:02:37 2025+0200
Log file(s) saved in '/gpfs/home4/casparl/EESSI/reframe_runs/logs/reframe_20250813_145518.log'

Works great, thanks a lot!

@casparvl
casparvl merged commit 2fc7a43 into EESSI:main Aug 13, 2025
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 this pull request may close these issues.

2 participants