What problem does it solve?
Hydra configuration management solves the problem of scattered, hard-to-maintain ML experiment settings by letting you compose hierarchical configs and override parameters from the command line without editing code.
Core Features & Use Cases
- Hierarchical config composition: Organize configs into groups (model, data, trainer, callbacks, logger) and compose them at runtime using defaults and overrides.
- Dynamic instantiation via target: Create models, optimizers, trainers, callbacks, and loggers directly from config definitions using the target field.
- Experiment reproducibility + scaling: Run single experiments and multiruns for hyperparameter sweeps while keeping per-run directories and config snapshots.
- Optuna hyperparameter optimization: Use Hydra’s Optuna sweeper integration to define search spaces and run HPO without rewriting training logic.
- Lightning integration patterns: Fit cleanly into a PyTorch Lightning training script pattern (instantiate datamodule/model/callbacks/logger/trainer from configs).
Use case example: You can reproduce and sweep a Lightning training setup by composing a base config with experiment-specific groups and then sweeping learning rates and batch sizes using multirun or Optuna.
Quick Start
Run the Hydra-based training entrypoint with a specific model and data override (for example: change the model to vit and the dataset to imagenet) to verify your composed configuration instantiates correctly.