Skip to content

Parameter Sweeps

Raphtor edited this page May 17, 2019 · 1 revision

So you know how to run a workflow. However, sometimes its necessary to run multiple versions of the workflow at the same time with different parameters. One example of a case for this is a parameter sweep for optimization. Another example is splitting up a large dataset into smaller pieces for rapid parallel processing. Finally, it might also be necessary to optimize over a set of hyperparameters. SABER supports all of these use cases through parameter sweeps.

Parameter sweeps can easily be added to a workflow by creating a yaml file. It is easiest to see the format of this yaml file by using examples.

Example 1. Blocking

This example sweeps the values xmin and xmax from 0 to 10000 by steps of 100.

x:
    range:
        start: 0
        stop: 10000
        step: 100
    parameters:
        min: xmin
        max: xmax
    steps:
        - step_1
        - step_2

x : The name of the swept variable. This is completely arbitrary, and does not have to be related to the variables used in the CWL workflow.

range : This defines the range of the variable. It starts at start and increments by step until it reaches stop.

parameters : These are the parameters that are actually going to be passed to the workflow. min is the parameter that corresponds to the smallest value of the block, and max is the parameter that corresponds to the maximum value of the block. The two are related by min + step = max

steps : These are the steps that are affected in the workflow. Note that these names should match the ones defined in the workflow CWL.

Example 2. Single parameter sweep

This example is very similar to the one above, but it sweeps over a single parameter.

x:
    range:
        start: 0
        stop: 10000
        step: 100
    parameters:
        abs: x
    steps:
        - step_1
        - step_2

The only difference is the abs key for the parameter x. This signifies that it should take the direct value from the range.

Example 3. Multiple independent parameters

This example sweeps multiple variables, some of which are independent.

epsilon:
    range:
        start: 0
        stop: 1
        step: 0.1
    parameters:
        abs: ep
    steps:
        - step_1
        - step_2
x:
    range:
        start: 0
        stop: 10000
        step: 10
    parameters:
        min: xmin
        max: xmax
    steps:
        - step_3
        - step_4
y:
    range:
        start: 0
        stop: 10000
        step: 10
    parameters:
        min: ymin
        max: ymax
    steps:
        - step_3
        - step_4
z:
    range:
        start: 0
        stop: 10000
        step: 10
    parameters:
        min: zmin
        max: zmax
    steps:
        - step_3
        - step_4