Skip to content

Feature request: Optimized sweeps of parameterized tests #3537

Description

@stefan-wolfsheimer

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.

For example, the code

message_sizes = parameter([128, 256, 512], bundle=True)
precision = parameter(['Single', 'Double', 'Half'], bundle=True)

could generate a job with two dimensional loop over all combinations instead of 9 independent jobs.

We’d appreciate your consideration and look forward to your thoughts.

Activity

  1. added theissue type on Aug 24, 2025
  2. vkarak commented on Aug 24, 2025

    @vkarak
    Contributor

    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.

  3. pranav-sivaraman commented on Sep 2, 2026

    @pranav-sivaraman

    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:

    1. Generate each test’s normal rfm_job.sh, but do not submit it.
    2. Once all tests in the bundle are prepared, generate and submit a bundle job.
    3. 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:

    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
        )
    done

    This 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.sh would 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.exitcode behavior.

    Interface

    The interface proposed in the original request may be sufficient, with a string enum selecting how bundled variants are executed:

    message_size = parameter(
        [128, 256, 512],
        bundle='sequential'
    )
    
    precision = parameter(
        ['Single', 'Double', 'Half'],
        bundle='sequential'
    )

    Possible modes would initially be:

    • bundle='sequential'
    • bundle='array'

    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.

  4. vkarak commented on Sep 2, 2026

    @vkarak
    Contributor

    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.

    CC: @victorusu

  5. pranav-sivaraman commented on Sep 3, 2026

    @pranav-sivaraman

    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
    

    The opposite composition could also be expressed:

      Sequential execution
      ├── repeat 1: submit job array [TestA, TestB, TestC]
      ├── repeat 2: submit job array [TestA, TestB, TestC]
      └── repeat N: submit job array [TestA, TestB, TestC]
    

    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

    RegressionTestBundle

    • TestA
    • TestB
    • TestC
  6. added this to the ReFrame 5.0 milestone on Nov 30, 2026
  7. vkarak commented on Nov 30, 2026

    @vkarak
    Contributor

    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.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions