Manage sweeps ↗
noOriginal Documentation
Documentation Index#
Fetch the complete documentation index at: https://docs.wandb.ai/llms.txt Use this file to discover all available pages before exploring further.
Pause, resume, and cancel a W&B Sweep with the CLI.
Use the W&B CLI to pause, resume, and cancel a sweep. The CLI’s sweep command uses flags such as --pause and --resume to control the sweep’s ability to create new W&B runs, with different effects on existing runs:
--pause: When you pause a sweep, the agent creates no new runs until you resume the sweep. Existing runs continue to execute normally.--resume: When you resume a sweep, the agent continues creating new runs according to the search strategy.--stop: When you stop a sweep, the agent stops creating new runs. Existing runs continue to completion.--cancel: When you cancel a sweep, the agent immediately kills all currently executing runs and stops creating new runs.
Use the following guidance to pause, resume, and cancel a sweep. In each case, provide the sweep ID that was generated when you initialized a sweep.
Pause a sweep#
Pause a sweep so it temporarily stops creating new runs. Runs that are already executing will continue to run until completion. Use the wandb sweep --pause command to pause a sweep. Provide the sweep ID that you want to pause.
wandb sweep --pause entity/project/sweep_IDResume a sweep#
Resume a paused sweep with the wandb sweep --resume command. The sweep will start creating new runs again according to its search strategy. Provide the sweep ID that you want to resume:
wandb sweep --resume entity/project/sweep_IDStop a sweep#
Finish a sweep to stop creating new runs while letting currently executing runs finish gracefully. Use the wandb sweep --stop command:
wandb sweep --stop entity/project/sweep_IDW&B does not terminate active sweeps or agents when you delete a project.
Cancel a sweep#
Cancel a sweep to immediately kill all running runs and stop creating new runs. This is the only sweep command that forcibly terminates existing runs. Use the wandb sweep --cancel command to cancel a sweep. Provide the sweep ID that you want to cancel.
wandb sweep --cancel entity/project/sweep_IDFor a full list of CLI command options, see the wandb sweep CLI Reference Guide.
W&B does not terminate active sweeps or agents when you delete a project.
Understanding sweep and run statuses#
A sweep orchestrates multiple runs to explore hyperparameter combinations. Understanding how sweep status and run status interact is crucial for effectively managing your hyperparameter optimization.
Key differences#
- Sweep status controls whether new runs are created (Running, Paused, Stopped, Cancelled, Finished, Failed, Crashed)
- Run status reflects the execution state of individual runs (Pending, Running, Finished, Failed, Crashed, Killed)
Stop an individual run#
When you stop a run in a sweep, the sweep agent automatically kicks off the next run in the sweep. This allows you to skip poorly performing configurations without interrupting the sweep’s overall progress.
Best practices#
- Use
--pauseinstead of cancel when you want to temporarily halt exploration without losing running experiments - Monitor individual run statuses to identify systematic failures
- Use
--stopfor graceful termination when you’ve found satisfactory hyperparameters - Reserve
--cancelfor emergencies when runs are consuming excessive resources or producing errors