Skip to main content
GitHub source Create, update, or manage a hyperparameter sweep. Provide a YAML config file to create a sweep. Define the search strategy, parameters, and metric to optimize in the config. Register the sweep with the W&B server and print the sweep ID and a command to start an agent. Provide a sweep ID (or full path entity/project/sweep_id) with a state flag (--stop, --cancel, --pause, or --resume) to manage an existing sweep. The sweep ID is a unique identifier for the sweep, generated by W&B when the sweep is created. You can find the sweep ID in the W&B App or in the output of the wandb sweep command when you create a new sweep. Examples: Create a sweep using the configuration defined in sweep_config.yaml. Use the current user’s default entity and project.
wandb sweep sweep_config.yaml
Create a sweep and store the results under the “team-awesome” entity and “foobar-project” project.
wandb sweep -p foobar-project -e team-awesome sweep_config.yaml
Update sweep abcd1234 with a new configuration from sweep_config.yaml. This is useful for changing the parameters or search strategy of an active sweep.
wandb sweep --update abcd1234 sweep_config.yaml
Stop sweep abcd1234 under the “team-awesome” entity and “foobar-project” project.
wandb sweep --stop team-awesome/foobar-project/abcd1234
Cancel sweep abcd1234 in the current user’s default entity and project.
wandb sweep --cancel abcd1234
Pause sweep abcd1234 in the current user’s default entity and project. Later, resume the sweep.
wandb sweep --pause abcd1234
wandb sweep --resume abcd1234
Create a sweep with a local controller that uses the configuration in sweep_config.yaml.
wandb sweep --controller sweep_config.yaml
Create a new sweep and include two previously completed runs (run ID abcd1234 and run ID efgh5678) so their results are incorporated into the sweep’s hyperparameter search.
wandb sweep -R abcd1234 -R efgh5678 sweep_config.yaml

Usage

wandb sweep [OPTIONS] CONFIG_YAML_OR_SWEEP_ID

Options

project

Set the project for sweep runs. Use ‘Uncategorized’ if not set.
FlagDefaultType
-p, --projectNoneSTRING

entity

Set the entity for sweep. Use the current user’s default entity if not set.
FlagDefaultType
-e, --entityNoneSTRING

controller

Start a local sweep controller after creating the sweep.
FlagDefaultType
--controllerFalseBOOL

verbose

Display verbose output.
FlagDefaultType
--verboseFalseBOOL

name

Set a display name for the sweep. Use the sweep ID if not specified.
FlagDefaultType
--nameNoneSTRING

program

Override the training program specified in the sweep config.
FlagDefaultType
--programNoneSTRING

settings

Set sweep settings
FlagDefaultType
--settingsNoneSTRING

update

Update an existing sweep configuration. Pass the sweep ID.
FlagDefaultType
--updateNoneSTRING

stop

Stop a sweep. Let active runs finish but do not start new runs.
FlagDefaultType
--stopFalseBOOL

cancel

Cancel a sweep. Kill active runs and stop starting new ones.
FlagDefaultType
--cancelFalseBOOL

pause

Pause a sweep. Temporarily stop starting new runs.
FlagDefaultType
--pauseFalseBOOL

resume

Resume a paused sweep.
FlagDefaultType
--resumeFalseBOOL

prior_runs

Attach an existing run to this sweep by ID. Specify multiple times to attach multiple runs.
FlagDefaultType
-R, --prior_runNoneSTRING

help

Show this message and exit.
FlagDefaultType
--helpFalseBOOL

CLI Help

Usage: sweep [OPTIONS] CONFIG_YAML_OR_SWEEP_ID

  Create, update, or manage a hyperparameter sweep.

  Provide a YAML config file to create a sweep. Define the search strategy,
  parameters, and metric to optimize in the config. Register the sweep with
  the W&B server and print the sweep ID and a command to start an agent.

  Provide a sweep ID (or full path `entity/project/sweep_id`) with a state
  flag (`--stop`, `--cancel`, `--pause`, or `--resume`) to manage an existing
  sweep.

  The sweep ID is a unique identifier for the sweep, generated by W&B when the
  sweep is created. You can find the sweep ID in the W&B App or in the output
  of the `wandb sweep` command when you create a new sweep.

  Examples:

  Create a sweep using the configuration defined in `sweep_config.yaml`. Use
  the current user's default entity and project.

  ```bash wandb sweep sweep_config.yaml ```

  Create a sweep and store the results under the "team-awesome" entity and
  "foobar-project" project.

  ```bash wandb sweep -p foobar-project -e team-awesome sweep_config.yaml ```

  Update sweep `abcd1234` with a new configuration from `sweep_config.yaml`.
  This is useful for changing the parameters or search strategy of an active
  sweep.

  ```bash wandb sweep --update abcd1234 sweep_config.yaml ```

  Stop sweep `abcd1234` under the "team-awesome" entity and "foobar-project"
  project.

  ```bash wandb sweep --stop team-awesome/foobar-project/abcd1234 ```

  Cancel sweep `abcd1234` in the current user's default entity and project.

  ```bash wandb sweep --cancel abcd1234 ```

  Pause sweep `abcd1234` in the current user's default entity and project.
  Later, resume the sweep.

  ```bash wandb sweep --pause abcd1234 wandb sweep --resume abcd1234 ```

  Create a sweep with a local controller that uses the configuration in
  `sweep_config.yaml`.

  ```bash wandb sweep --controller sweep_config.yaml ```

  Create a new sweep and include two previously completed runs (run ID
  `abcd1234` and run ID `efgh5678`) so their results are incorporated into the
  sweep's hyperparameter search.

  ```bash wandb sweep -R abcd1234 -R efgh5678 sweep_config.yaml ```

Options:
  -p, --project TEXT    Set the project for sweep runs. Use 'Uncategorized' if
                        not set.
  -e, --entity TEXT     Set the entity for sweep. Use the current user's
                        default entity if not set.
  --controller          Start a local sweep controller after creating the
                        sweep.
  --verbose             Display verbose output.
  --name TEXT           Set a display name for the sweep. Use the sweep ID if
                        not specified.
  --program TEXT        Override the training program specified in the sweep
                        config.
  --update TEXT         Update an existing sweep configuration. Pass the sweep
                        ID.
  --stop                Stop a sweep. Let active runs finish but do not start
                        new runs.
  --cancel              Cancel a sweep. Kill active runs and stop starting new
                        ones.
  --pause               Pause a sweep. Temporarily stop starting new runs.
  --resume              Resume a paused sweep.
  -R, --prior_run TEXT  Attach an existing run to this sweep by ID. Specify
                        multiple times to attach multiple runs.
  --help                Show this message and exit.