You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request] Add option to replace "/" in hydra.job.override_dirname #3018
If overrides contain a / then a subdirectory is created when using hydra.job.override_dirname. The referenced discussion suggests to write a custom function that replaces instances of /. However, it would be convenient if this was done using a mechanism similar to e.g. hydra.job.config.override_dirname.kv_sep.
Originally posted by Aceticia October 9, 2022
I'm using the override_dirname as the folder to store checkpoints and logs. This does store the logs, but since my configs contain overrides with /, hydra ended up not treating them as part of the subdir but as a directory under the subdir, creating one redundant level of folder each time I override something. This is a pretty small inconvenience, and it would probably be very difficult to fix (how to differentiate where user actually want a subdirectory but not override?), but I imagine it's not the intended behavior?
For more details, here is how I'm overriding some configs. If there is an alternative where I can just not use / overrides I guess that would solve the issue too.
In net1.yaml and net2.yaml, there are configurations for neural networks including __target__ instantiations and their hyperparameters. In default.yaml I simply have a default list of using net1.yaml. When I do need to run an experiment with net2, I just override with models/temporal_nets=net2. What are alternative ways to organize the configs, so that I can override the choice of temporal_nets? Any suggestions would be appreciated. Thank you.
changed the title [-]Add option to replace "/" in hydra.job.override_dirname[/-][+][Feature Request] Add option to replace "/" in hydra.job.override_dirname[/+]on Feb 1, 2025
Thanks for the report. This is addressed in #3241 for Hydra 1.4 by moving override_dirname toward a resolver-based API.
Instead of adding more special-case options to hydra.job.override_dirname, Hydra 1.4 adds ${hydra_override_dirname:...}. It supports the existing formatting options, and also lets users provide an optional per-element resolver. That makes cases like replacing path separators configurable without baking one behavior into Hydra.
The element resolver needs to be registered before Hydra starts composing/running the app.
The old hydra.job.override_dirname behavior is preserved for compatibility in 1.4, but it is deprecated in favor of the resolver form because the resolver can be configured at the use site or replaced entirely by user-defined behavior.
Activity
[-]Add option to replace "/" in hydra.job.override_dirname[/-][+][Feature Request] Add option to replace "/" in hydra.job.override_dirname[/+]omry commentedon Jun 25, 2026
Thanks for the report. This is addressed in #3241 for Hydra 1.4 by moving
override_dirnametoward a resolver-based API.Instead of adding more special-case options to
hydra.job.override_dirname, Hydra 1.4 adds${hydra_override_dirname:...}. It supports the existing formatting options, and also lets users provide an optional per-element resolver. That makes cases like replacing path separators configurable without baking one behavior into Hydra.Example:
The element resolver needs to be registered before Hydra starts composing/running the app.
The old
hydra.job.override_dirnamebehavior is preserved for compatibility in 1.4, but it is deprecated in favor of the resolver form because the resolver can be configured at the use site or replaced entirely by user-defined behavior.Add hydra_override_dirname resolver
Add hydra_override_dirname resolver
Add hydra_override_dirname resolver (hydra-ecosystem#3241)