Weights and Biases#
The Weights and Biases (WandB) integration automatically sets the relevant environment variables that WandB relies on in the run execution environment.
WandB Logger must be configured in Composer
Note that the run name for the WandB run will default to the
name of the MCLI run,
name is passed into Composer’s WandBLogger, in which case that will take precedence.
First Time Setup: WandB API Key#
This integration requires providing your WandB API key to the MosaicML platform. Generate an WandB API Key at this link, then create an environment variable secret:
mcli create secret env WANDB_API_KEY=<YOUR WANDB API KEY>
This command creates a secret which will mount your API key in the run execution environment as the variable
For more details on how this works, see the Environment Secrets Page.
Using Weights and Biases in a Run#
To use WandB experimenting tracking in a run, include the WandB integration in the YAML:
integrations: - integration_type: wandb # The Weights and Biases project name project: my_project # The username or organization the Weights and Biases project belongs to entity: mosaic-ml
Required parameters include:
Optional parameters of the Weights and Biases Integration are used to configure the Weights and Biases logger.
Optional parameters include:
group(str): The group the run belongs to. For more information on grouping runs see the Weights and Biases docs.
job_type(str): The Weights and Biases job type. This is useful when you’re grouping runs together into larger experiments using groups (e.g. “train”, “eval”).
tags(List[str]): A list of tags for the run. Tags are useful for organizing runs together (e.g. “baseline”, “production”).
integrations: - integration_type: wandb # The Weights and Biases project name project: my_project # The organization the Weights and Biases user belongs to entity: mosaic-ml # Make the run a member of this run group group: my_sweep # A job type to tag the run with job_type: train # Tags for the run tags: - first_tag - second_tag