Documentation Index
Fetch the complete documentation index at: https://wb-21fd5541-style-guide-models-integrations-20260527-015516.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Hydra is an open source Python framework that simplifies the development of research and other complex applications. The key feature is the ability to dynamically create a hierarchical configuration by composition and override it through config files and the command line.This page shows how to combine Hydra-based configuration management with W&B experiment tracking, so you can keep Hydra’s composable configs while gaining W&B’s visualization, hyperparameter optimization, and run comparison capabilities. The following sections cover tracking metrics, logging hyperparameters from Hydra configs, troubleshooting multiprocessing, and optimizing hyperparameters with W&B Sweeps.
Track metrics
To send metrics from a Hydra-configured run to W&B, usewandb.init() and wandb.Run.log() as you normally would. In the following example, wandb.entity and wandb.project are defined within a Hydra configuration file so that the same config drives both Hydra and W&B.
Track hyperparameters
Logging Hydra’s configuration to W&B lets you see every hyperparameter alongside the run’s metrics, making experiments easier to compare and reproduce. Hydra uses omegaconf as the default way to interface with configuration dictionaries.OmegaConf’s dictionary isn’t a subclass of primitive dictionaries, so directly passing Hydra’s Config to wandb.Run.config leads to unexpected results on the dashboard. Convert omegaconf.DictConfig to the primitive dict type before passing it to wandb.Run.config.
Troubleshoot multiprocessing
If your process stops responding when started, the known multiprocessing issue in distributed training might be the cause. To resolve it, change W&B’s multiprocessing protocol by either adding an extra settings parameter towandb.init():
Optimize hyperparameters
W&B Sweeps is a hyperparameter search platform that provides insights and visualizations for W&B experiments with minimal code overhead. Sweeps integrates with Hydra projects without requiring code changes. You only need a configuration file that describes the parameters to sweep over. The followingsweep.yaml file is an example:
wandb agent command. Run that command on each machine on which you want to execute the sweep.
Pass parameters not present in Hydra defaults
Hydra supports passing extra parameters through the command line that aren’t present in the default configuration file, by using a+ before the command. For example, pass an extra parameter with some value by calling:
+ configurations the same way you would when configuring Hydra Experiments. To work around this, initialize the experiment parameter with a default empty file and use a W&B Sweep to override those empty configs on each call. For more information, read the W&B report Configuring W&B Projects with Hydra.