Hydra | 1.2
# Old (Hydra 1.1) @hydra.main(config_path="conf", config_name="config") def main(cfg): ... def main(): cfg = hydra.initialize_and_run(config_path="conf", config_name="config", task_function=my_task)
Navigating the Labyrinth: What’s New in Hydra 1.2 hydra 1.2
pip install hydra-core --upgrade Happy composing! Let us know in the comments if you have found the 1.2 resolver syntax tricky—I will be writing a deep dive on that next week. # Old (Hydra 1
defaults: - storage: aws - optional region: ${storage.region} Hydra was notorious for adding 200–400ms to script startup time because it parsed every @dataclass and OmegaConf structure recursively. For long-running training jobs, this didn't matter. For serverless functions or CLIs? It hurt. defaults: - storage: aws - optional region: ${storage
If you have ever tried to manage a massive Python configuration file full of nested dictionaries, you know the pain. That is why the open-source community fell in love with (from Facebook Research). It allows you to compose dynamic configurations from multiple files and override anything from the command line.
This moves Hydra away from rigid inheritance trees (which often broke) toward a more flexible composition model. You can now write: