Skip to main content
This page shows you how to control the lifecycle of an active sweep from the command line. You can stop wasted compute, preserve in-progress experiments, or temporarily halt exploration without losing state. Use the W&B CLI to pause, resume, stop, and cancel a sweep. Each command affects whether the sweep creates new runs and what happens to runs that are already executing. In each case, provide the sweep ID that W&B generated when you initialized the sweep.

Pause a sweep

Use the wandb sweep --pause command to pause a sweep, so it temporarily stops creating new runs. Runs that are already executing continue to run until completion. Provide the sweep ID.

Resume a sweep

Resume a paused sweep with the wandb sweep --resume command, so it starts creating new runs again according to its search strategy. Provide the sweep ID.

Stop a sweep

Use the wandb sweep --stop command to stop a sweep. A stopped sweep does not create new runs. Runs that are already executing continue to run until completion. Provide the sweep ID.

Cancel a sweep

Use the wandb sweep --cancel command to cancel a sweep, forcibly terminating all active runs and preventing creation of new runs. Runs terminate abruptly, giving the running processes no chance to run user-defined signal handlers. Provide the sweep ID.
For more information about signals and sweep runs, see Signal handling and sweep runs. For a full list of CLI command options, see the wandb sweep CLI Reference Guide.
Deleting a project doesn’t stop active sweeps or their agents. To stop them, cancel or stop the sweep with wandb sweep --cancel or wandb sweep --stop, then stop each agent process.

Sweep and run statuses

A sweep orchestrates multiple runs to explore hyperparameter combinations. The following sections describe how sweep status and run status interact, so you can manage your hyperparameter optimizations effectively, including how the two statuses differ, what happens when you stop an individual run, and which lifecycle command to choose.

Key differences

  • Sweep status controls whether the agent creates new runs. Sweep status can be Running, Paused, Stopped, Cancelled, Finished, Failed, or Crashed.
  • Run status reflects the execution state of individual runs. Run status can be Pending, Running, Finished, Failed, Crashed, or Killed.

Stop an individual run

When you stop a run in a sweep, the sweep agent automatically starts the next run in the sweep. Use this mechanism to skip poorly performing configurations without interrupting the sweep’s overall progress.

Recommendations

The following recommendations help you choose the right lifecycle command for the situation, so you avoid losing useful work or holding onto unwanted compute.
  • Use --pause instead of cancel to temporarily halt exploration without losing running experiments.
  • Monitor individual run statuses to identify systematic failures.
  • Use --stop for graceful termination when you’ve found satisfactory hyperparameters.
  • Reserve --cancel for emergencies when runs consume excessive resources or produce errors.