You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: Optimized sweeps of parameterized tests #3537
Many HPC performance tests feature a rich set of parameters. Consider, for example, test such as OSU, HPL or NCCL, which can be executed at different message sizes or problem sizes.
To gain insight it is useful to execute parameter sweeps and analyze the multidimensional result space, for example by plotting the performance vs size, or group values by parameters.
ReFrame's parameterization system allows for clean abstraction of test variants.
However, during large parameter sweeps, the current workflow generates a separate job per parameter combination.
This can be inefficient when the tests are executed frequently and the parameter space is large (the scheduler overhead is often larger than the test itself). Hence, it would be beneficial to have a mechanism to execute sequentially parameterized tests in a single job allocation.
Example use case:
a linear algebra test (e.g. DGEMM, HPL, or DGEMM with cuBLAS) on different system sizes and plot the performance vs. input size.
repeat a GPU test for different precisions for comparision
run OSU or NCCL bandwidth tests and analyze bandwidth vs. message size
A possible enhancement would be to allow test developers to indicate which parameters are safe to bundle together into a single scheduler allocation.
Hi @stefan-wolfsheimer, your feature request is valid, though not so straightforward to implement. Every test variant for a parameter is a completely independent fully-blown reframe test and the runtime doesn't differentiate between standard and parameterized tests.
I don't know what would be the ideal solution at the moment (a new test type? add the ability to run tests inside an existing job allocation?), but it's worth considering.
I am interested in implementing this feature, but I would first like feedback on the scope and general approach. I am not deeply familiar with ReFrame’s internals yet, so this is my initial understanding.
Motivation
I am interested in this feature for two main reasons:
reducing ReFrame and scheduler submission, queueing, and polling overhead, as well as allocation startup, prologue, and epilogue overhead, when running many short tests;
running related tests, including --repeat N, on the same nodes for more consistent performance comparisons.
Proposed implementation
Following ReFrame’s test pipeline, tests in a bundle would proceed normally through the setup and compile phases.
The run phase would be deferred:
Generate each test’s normal rfm_job.sh, but do not submit it.
Once all tests in the bundle are prepared, generate and submit a bundle job.
After the bundle finishes, continue each test through its normal sanity, performance, and cleanup phases.
The normal pipeline steps would remain the same. Only submission during the run phase would be deferred and handled at the bundle level.
Bundle modes
Sequential allocation
Submit one wrapper job that requests an allocation and runs each prepared script sequentially:
This “greatly improves overall performance” according to the Slurm documentation and runs tests independently on different resources, preventing one test from disrupting the entire bundle.
Polling and status
Polling would move to the ReFrame bundle job. For sequential execution, the wrapper may also need to record each member’s exit code and save to a file so that ReFrame can preserve its existing per-test job.exitcode behavior.
Interface
The interface proposed in the original request may be sufficient, with a string enum selecting how bundled variants are executed:
The bundle option would only affect the run phase. Each parameter combination would remain an independent test variant with its own stage directory, job script, output, validation, and report entry. The option would control how those prepared variants are submitted and executed.
Initial scope
Initially, expose the bundle option without validating whether the prepared jobs can share the selected execution mode. Users would be responsible for ensuring that bundled tests can run together.
Open questions
How should users specify that programming environments can be bundled together?
How should users select the bundle mode for --repeat N?
Would appreciate feedback on this. I was trying to implement this using the current tools that are exposed in ReFrame's public API, 1 Class submits a SLURM job array, but I realized I was ended up re-implementing a lot of stuff like self.skip_if and self.env_vars.
I agree this is something we need in the framework and thanks for picking up the discussion.
The current problem is that the runtime knows nothing about the parameterization; it only sees test cases (which is the instantiated test variant with the matched partition/environment combination). A way is needed to group the tests that result from parameterization. We could maybe have a new RegressionTestBundle that will implement the pipeline stages and interface with the runtime. The bundle could be sequential, submit one test after the other for non-Slurm backends, or could be using job arrays. The bundled tests could do other optimizations too, such as share the stage directory and the resources, and avoid unnecessary copies.
I want also this issue to be seen in relation to #3653, which currently uses parameterization to do the distribution across nodes, but maybe the bundling there is a bit different; you need to bundle per node rather than per test.
Also, but that's likely a secondary issue at the moment, we should probably not change the behaviour of the parameter() builtin but rather introduce a new one parameter_bundled() that will implement this behaviour.
Let's continue thinking more on this and explore the different design options, before we settle down.
The bundle could be sequential, submit one test after the other for non-Slurm backends, or could be using job arrays.
I thought I had something about this before, but I was thinking these should be composable. For example
Slurm job array
├── array task 0: run TestA sequentially N times
├── array task 1: run TestB sequentially N times
└── array task 2: run TestC sequentially N times
This may be out of scope initially because it could be difficult to implement. Experimenting with the implementation should
help determine which compositions are practical.
Couple of other things that I also think that are up for discussion
Retry interface
My proposed approach would hopefully make scheduling retries easier. Instead of submitting the entire bundle job for a retry, the runtime can just resubmit the individual job. I think also when a user uses -n it runs that specific test instead of the bundle.
UI interface
Not really my strong suite, but some ideas would be to display something like the following, kind of like fixtures/deps
I'm adding this the 5.0 milestone as we will start working more towards various optimizations for test execution. But this should not be just treated alone, we need to see the whole picture.
Activity
vkarak commentedon Aug 24, 2025
Hi @stefan-wolfsheimer, your feature request is valid, though not so straightforward to implement. Every test variant for a parameter is a completely independent fully-blown reframe test and the runtime doesn't differentiate between standard and parameterized tests.
I don't know what would be the ideal solution at the moment (a new test type? add the ability to run tests inside an existing job allocation?), but it's worth considering.
pranav-sivaraman commentedon Sep 2, 2026
I am interested in implementing this feature, but I would first like feedback on the scope and general approach. I am not deeply familiar with ReFrame’s internals yet, so this is my initial understanding.
Motivation
I am interested in this feature for two main reasons:
--repeat N, on the same nodes for more consistent performance comparisons.Proposed implementation
Following ReFrame’s test pipeline, tests in a bundle would proceed normally through the setup and compile phases.
The run phase would be deferred:
rfm_job.sh, but do not submit it.The normal pipeline steps would remain the same. Only submission during the run phase would be deferred and handled at the bundle level.
Bundle modes
Sequential allocation
Submit one wrapper job that requests an allocation and runs each prepared script sequentially:
test_hashes=( "TEST_A_HASH" "TEST_B_HASH" "TEST_C_HASH" ) for test_hash in "${test_hashes[@]}"; do ( cd "${RFM_STAGEDIR}/${test_hash}" || exit 1 ./rfm_job.sh >rfm_job.out 2>rfm_job.err ) doneThis follows ReFrame’s existing
run()logic, which changes to the test’s stage directory before preparing and submitting its job.This would run all tests in the same allocation. Each
rfm_job.shwould remain a standalone job script that could be submitted separately.Job array
Job-array execution would be similar, but would select one prepared test using the array index instead of a loop:
test_hashes=( "TEST_A_HASH" "TEST_B_HASH" "TEST_C_HASH" ) test_hash="${test_hashes[${SLURM_ARRAY_TASK_ID}]}" ( cd "${RFM_STAGEDIR}/${test_hash}" || exit 1 ./rfm_job.sh >rfm_job.out 2>rfm_job.err )This “greatly improves overall performance” according to the Slurm documentation and runs tests independently on different resources, preventing one test from disrupting the entire bundle.
Polling and status
Polling would move to the ReFrame bundle job. For sequential execution, the wrapper may also need to record each member’s exit code and save to a file so that ReFrame can preserve its existing per-test
job.exitcodebehavior.Interface
The interface proposed in the original request may be sufficient, with a string enum selecting how bundled variants are executed:
Possible modes would initially be:
bundle='sequential'bundle='array'The
bundleoption would only affect the run phase. Each parameter combination would remain an independent test variant with its own stage directory, job script, output, validation, and report entry. The option would control how those prepared variants are submitted and executed.Initial scope
Initially, expose the bundle option without validating whether the prepared jobs can share the selected execution mode. Users would be responsible for ensuring that bundled tests can run together.
Open questions
--repeat N?Would appreciate feedback on this. I was trying to implement this using the current tools that are exposed in ReFrame's public API, 1 Class submits a SLURM job array, but I realized I was ended up re-implementing a lot of stuff like
self.skip_ifandself.env_vars.vkarak commentedon Sep 2, 2026
I agree this is something we need in the framework and thanks for picking up the discussion.
The current problem is that the runtime knows nothing about the parameterization; it only sees test cases (which is the instantiated test variant with the matched partition/environment combination). A way is needed to group the tests that result from parameterization. We could maybe have a new
RegressionTestBundlethat will implement the pipeline stages and interface with the runtime. The bundle could be sequential, submit one test after the other for non-Slurm backends, or could be using job arrays. The bundled tests could do other optimizations too, such as share the stage directory and the resources, and avoid unnecessary copies.I want also this issue to be seen in relation to #3653, which currently uses parameterization to do the distribution across nodes, but maybe the bundling there is a bit different; you need to bundle per node rather than per test.
Also, but that's likely a secondary issue at the moment, we should probably not change the behaviour of the
parameter()builtin but rather introduce a new oneparameter_bundled()that will implement this behaviour.Let's continue thinking more on this and explore the different design options, before we settle down.
CC: @victorusu
pranav-sivaraman commentedon Sep 3, 2026
I thought I had something about this before, but I was thinking these should be composable. For example
The opposite composition could also be expressed:
This may be out of scope initially because it could be difficult to implement. Experimenting with the implementation should
help determine which compositions are practical.
Couple of other things that I also think that are up for discussion
Retry interface
My proposed approach would hopefully make scheduling retries easier. Instead of submitting the entire bundle job for a retry, the runtime can just resubmit the individual job. I think also when a user uses
-nit runs that specific test instead of the bundle.UI interface
Not really my strong suite, but some ideas would be to display something like the following, kind of like fixtures/deps
RegressionTestBundle
vkarak commentedon Nov 30, 2026
I'm adding this the 5.0 milestone as we will start working more towards various optimizations for test execution. But this should not be just treated alone, we need to see the whole picture.