Skip to main content

Documentation Index

Fetch the complete documentation index at: https://wb-21fd5541-docs-2661.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Try in Colab

This page describes how to create a hyperparameter tuning job (sweeps) with W&B Launch, so you can automate hyperparameter exploration on the same infrastructure that runs your other launch jobs. With sweeps on launch, a sweep scheduler is pushed to a Launch Queue with the specified hyperparameters to sweep over. The sweep scheduler starts as it is picked up by the agent, launching sweep runs onto the same queue with chosen hyperparameters. This continues until the sweep finishes or is stopped. You can use the default W&B Sweep scheduling engine or implement your own custom scheduler:
  1. Standard sweep scheduler: Use the default W&B Sweep scheduling engine that controls W&B Sweeps. The familiar bayes, grid, and random methods are available.
  2. Custom sweep scheduler: Configure the sweep scheduler to run as a job. This option enables full customization. The following section shows an example of how to extend the standard sweep scheduler to include more logging.
This guide assumes that W&B Launch has been previously configured. If W&B Launch isn’t configured, see the how to get started section of the launch documentation.
We recommend you create a sweep on launch using the basic method if you’re a first-time user of sweeps on launch. Use a custom sweeps on launch scheduler when the standard W&B scheduling engine doesn’t meet your needs.

Create a sweep with a W&B standard scheduler

This section describes how to create W&B Sweeps with Launch using the standard scheduling engine. You can create a sweep interactively with the W&B App or programmatically with the W&B CLI. For advanced configurations of Launch sweeps, including the ability to customize the scheduler, use the CLI.
Before you create a sweep with W&B Launch, ensure that you first create a job to sweep over. See the Create a Job page for more information.
Create a sweep interactively with the W&B App.
  1. Navigate to your W&B project on the W&B App.
  2. Select the sweeps icon in the project sidebar (broom image).
  3. Select the Create Sweep button.
  4. Click the Configure Launch button.
  5. From the Job dropdown menu, select the name of your job and the job version you want to create a sweep from.
  6. From the Queue dropdown menu, select a queue to run the sweep on.
  7. From the Job Priority dropdown, specify the priority of your launch job. A launch job’s priority is set to “Medium” if the launch queue doesn’t support prioritization.
  8. Optional: Configure override args for the run or sweep scheduler. For example, using the scheduler overrides, configure the number of concurrent runs the scheduler manages using num_workers.
  9. Optional: From the Destination Project dropdown menu, select a project to save the sweep to.
  10. Click Save.
  11. Select Launch Sweep.
Launch sweep configuration

Create a custom sweep scheduler

This section describes how to create a custom sweep scheduler when the standard scheduling engine doesn’t meet your needs. You can create a custom sweep scheduler either with the W&B scheduler or a custom scheduler.
Using scheduler jobs requires wandb CLI version >= 0.15.4
Create a launch sweep using the W&B sweep scheduling logic as a job.
  1. Identify the W&B scheduler job in the public wandb/sweep-jobs project, or use the job name: 'wandb/sweep-jobs/job-wandb-sweep-scheduler:latest'.
  2. Construct a configuration yaml with an additional scheduler block that includes a job key pointing to this name, as shown in the following example.
  3. Use the wandb launch-sweep command with the new config.
Example config:
# launch-sweep-config.yaml  
description: Launch sweep config using a scheduler job
scheduler:
  job: wandb/sweep-jobs/job-wandb-sweep-scheduler:latest
  num_workers: 8  # allows 8 concurrent sweep runs

# training/tuning job that the sweep runs will execute
job: wandb/sweep-jobs/job-fashion-MNIST-train:latest
method: grid
parameters:
  learning_rate:
    min: 0.0001
    max: 0.1
Examples of custom sweep scheduler jobs are available in the wandb/launch-jobs repo under jobs/sweep_schedulers. This guide shows how to use the publicly available W&B Scheduler Job, and demonstrates a process for creating custom sweep scheduler jobs.

Resume sweeps on launch

This section describes how to resume a launch-sweep from a previously launched sweep, which is useful when you want to continue exploring with updated scheduler settings or on a different queue. Although you can’t change hyperparameters and the training job, you can change scheduler-specific parameters and the queue it is pushed to.
If the initial sweep used a training job with an alias like latest, resuming can lead to different results if the latest job version has changed since the last run.
  1. Identify the sweep name/ID for a previously run launch sweep. The sweep ID is an eight-character string (for example, hhd16935) that you can find in your project on the W&B App.
  2. If you change the scheduler parameters, construct an updated config file.
  3. In your terminal, execute the following command. Replace content wrapped in [ and ] with your information:
wandb launch-sweep [OPTIONAL-CONFIG-YAML] --resume_id [SWEEP-ID] --queue [QUEUE-NAME]