Best practices to organize hyperparameter searches
Set unique tags with wandb.init(tags='your_tag'). This allows efficient filtering of project runs by selecting the corresponding tag in a Project Page's Runs Table.
Set unique tags with wandb.init(tags='your_tag'). This allows efficient filtering of project runs by selecting the corresponding tag in a Project Page's Runs Table.
If a grid search completes but some W&B Runs need re-execution due to crashes, delete the specific W&B Runs to re-run. Then, select the Resume button on the sweep control page. Start new W&B Sweep agents using the new Sweep ID.
To authenticate W&B, complete the following steps: create a requirements.txt file if using a built-in Amazon SageMaker estimator. For details on authentication and setting up the requirements.txt file, refer to the SageMaker integration guide.
Use the $ macro in the command section of the configuration to pass hyperparameters as boolean flags. This macro automatically includes boolean parameters as flags. If param is True, the command receives --param. If param is False, the flag is omitted.
To publish the sweepid so that any W&B Sweep agent can access it, implement a method for these agents to read and execute the sweepid.
Access hyperparameter names and values from the sweep configuration using wandb.config, which acts like a dictionary.
Set the logging directory for W&B run data by configuring the environment variable WANDB_DIR. For example:
To resume a sweep, pass the sweep_id to the wandb.agent() function.
One effective approach for logging models in a sweep involves creating a model artifact for the sweep. Each version represents a different run from the sweep. Implement it as follows:
To enable code logging for sweeps, add wandb.logcode() after initializing the W&B Run. This action is necessary even when code logging is enabled in the W&B profile settings. For advanced code logging, refer to the docs for wandb.logcode() here.
You can use W&B Sweeps with custom CLI commands if training configuration passes command-line arguments.
When using sweeps with the SLURM scheduling system, run wandb agent --count 1 SWEEP_ID in each scheduled job. This command executes a single training job and then exits, facilitating runtime predictions for resource requests while leveraging the parallelism of hyperparameter searches.
Once a W&B Sweep starts, you cannot change the Sweep configuration. However, you can navigate to any table view, select runs using the checkboxes, and then choose the Create sweep menu option to generate a new Sweep configuration based on previous runs.
To optimize multiple metrics in a single run, use a weighted sum of the individual metrics.
W&B provides an estimated number of Runs generated when creating a W&B Sweep with a discrete search space. This total reflects the cartesian product of the search space.