Releases: facebookresearch/hydra
Hydra 1.3.2
Hydra 1.3.1
1.3.1 (2022-12-20)
This bugfix release updates a version pin on the OmegaConf library, allowing Hydra to be installed alongside the latest version of OmegaConf.
Bug Fixes
- Relax OmegaConf pin allowing OmegaConf 2.3 to be installed (#2510)
Links:
Hydra 1.3.0
1.3.0 (2022-12-08)
Features:
- Implement
_convert_="object"
option forinstantiate
, enabling conversion of non-_target_
structured configs to instances of the backing dataclass / attr class. (#1719) - Enable layering of the
@hydra.main
decorator on top of other decorators produced usingfunctools.wraps
. (#2303) - Allow for non-leading dashes in override keys (#2363)
- support specifying an absolute path with
--config-path
(#2368) - Support python3.11 (#2443)
Bug Fixes:
- Fix an issue where Hydra's exception-handling logic could raise an
AssertionError
(#2342)
Links:
Hydra 1.2.0
1.2.0 (2022-05-17)
Bug fixes
hydra.runtime.choices
is now updated correctly during multi-run (#1882)hydra.verbose=True
now works with multirun. (#1897)- Fix a resolution error occurring when a nested class is passed as a
_target_
keyword argument toinstantiate
(#1914) - It is now possible to pass other callable objects (besides functions) to
hydra.main
. (#2042)
New features
- Add support to Hydra's instantiation API for creation of
functools.partial
instances via a_partial_
keyword. (#1283) - Support defining basic sweeping in input config. (#1376)
- Improve error message with more context when an omegaconf exception occurs during the config merge step. (#1697)
- Add
--experimental-rerun
command-line option to reproduce pickled single runs (#1805) - Add experimental Callback for pickling job info. (#2092)
- Implement tab completions for appending to the defaults list (+group=option) and deleting from the defaults list (~group). (#1841)
- Enable the use of the pipe symbol
|
in unquoted strings when parsing command-line overrides. (#1850) - Support for Python 3.10 (#1856)
- Improve clarity of error messages when
hydra.utils.instantiate
encounters a_target_
that cannot be located (#1863) - The
instantiate
API now acceptsListConfig
/list
-type config as top-level input. (#1950) - Improve error messages raised in case of instantiation failure. (#2099)
- Add callback for logging JobReturn. (#2100)
- Support disable changing working directory at runtime. (#910)
- Support setting hydra.mode through config. (#394)
Behavior changes
- The antlr version requirement is updated from 4.8 to 4.9, to align better with current antlr versions
- If user code raises an exception when called by
instantiate
, raise anInstantiateError
exception instead of an instance of the same exception class that was raised by the user code. (#1911) - Remove support for deprecated arg
config_loader
to Plugin.setup, and update signature ofrun_job
to requirehydra_context
. (#1953)
The remaining changes are protected by the new version_base support,
which allows one to either configure Hydra to support older setups / config, or configure Hydra to use the following more modern defaults:
- Remove deprecated "old optional" defaults list syntax (#1952)
- Remove support for the legacy hydra override syntax (see deprecation notice). (#2056)
- Remove support for old hydra.experimental.{compose,initialize} interface
- Remove support for
_name_
and_group_
from package header (see deprecation notice) - Remove support for legacy default list interpolation format (see deprecation notice)
- Remove support for TargetConf class
- Remove support for strict flag from compose API (see deprecation notice)
- Remove support for ".yml" extensions, requiring ".yaml" instead.
- Default to not changing the working directory at runtime. Use
hydra.job.chdir=True
to reinstate old behavior. - Default to not adding any directory to the config path. (see
config_path
options)
Hydra 1.1.2
1.1.2 (2022-04-12)
Features
- Add support to Hydra's instantiation API for creation of
functools.partial
instances via a_partial_
keyword. (#1283) - The
instantiate
API now acceptsListConfig
/list
-type config as top-level input. (#1950) - Improve error messages raised in case of instantiation failure. (#2099)
- Add callback for logging JobReturn. (#2100)
API Change (Renames, deprecations and removals)
- Fix an internal key collision to prevent an exception when
- group@_global_: choice
is used in the same defaults list as- group: choice
. (#1784)
Bug Fixes
Hydra 1.1.1
1.1.1 (2021-08-19)
Features
- Allow range() in override grammar to have only one argument (the stop value), e.g. range(3) (#1664)
- Add support for a HYDRA_DEPRECATION_WARNINGS_AS_ERRORS envorinment variable. When it is set, using deprecated features causes an exception instead of a warning. (#1689)
- To make migration from Hydra 1.0 to 1.1 easier, Hydra will now issue a warning if the primary config defines config values and Defaults List if the Defaults List does not specify
_self_
(#1755)
API Change (Renames, deprecations and removals)
- Re-introduced a deprecated strict flag in the Compose API (#1694)
- Relax handling of legacy hydra overrides in the defaults list to make migration from Hydra 1.0 to 1.1 easier (#1748)
Bug Fixes
- Allow Defaults List interpolation in nested configs and document that the interpolation keys must be absolute (#1668)
- instantiate API now supports
target
as a parameter name (#1669) - Fix
--cfg=job --resolve
and--help --resolve
so that the ${hydra:...} resolver now prints properly (#1681) - Fix unexpected changes to defaults list in some cases when appending an experiment (+experiment=test) (#1706)
- Fixed composition where top level of a config composed from a config group is a list (#1724)
- Fix bug where overriding hydra config groups more than once without using the override keyword resulted in an error instead of deprecation warnings (#1730)
- Fix failure when sanitizing stack traces resulting from job exceptions (#1739)
Hydra 1.0.7
1.0.7 (2021-07-14)
This release contains a few small changes to make Hydra 1.0 a bit more compatible with OmegaConf 2.1 and Hydra 1.1 to enable easier migration.
There is no risk in using it if you are using 1.0.6 now as it just makes the migration a bit smoother in some scenarios:
- If you are upgrading OmegaConf to 2.1 before upgrading Hydra to 1.1.
- It enables some configs to be compatible with both versions in some rare cases related to the change in the default composition order in Hydra 1.1.
Maintenance Changes
Hydra 1.1.0
1.1.0 (2021-06-09)
This is the biggest Hydra release yet.
Highlights
- OmegaConf 2.1 supports relative interpolations, nested interpolations, more powerful resolvers and better compatibility with plain Python dict and list.
- Recursive defaults list: Every config can now have a Defaults List.
- Recursive instantiation: When instantiating objects using the
instantiate
API, nested defined objects are instantiated automatically.
There have also been many bug fixes and performance improvements, as well of as some breaking changes - both in Hydra and in OmegaConf.
Please check the API changes and deprecation sections in these release notes and in the OmegaConf release notes.
Features
General enhancements
- Upgrade to OmegaConf 2.1. Please check the release notes for it (#1426)
- Support for Python 3.9. (#1062)
- Improve performance of config composition in a benchmark by 64% (#1328)
- Allow
@
,$
and?
symbols in unquoted values in overrides (#1074, #1437, #1597) - Add a --resolve flag that can be used with the --cfg and --help flags to resolve interpolations before the config is printed. (#1585,#1482)
- It is now possible to disable Hydra's logging configuration (#1130)
- Support for Zsh tab completion (#347)
- Support for force-add of config values via
++key=value
(force-add overrides if the value exists and adds it otherwise) (#1049) - New experimental Callback API (#1402)
Config composition enhancements
- Support for Defaults List in any config (Recursive relative defaults) (#1170)
- Composition order of a config with a Defaults List can be specified with the
_self_
keyword. (#326) - Support for configuring the config search path from the primary config (#274)
- Add support for selecting multiple configs from the same Config Group (#499)
- Final choices of defaults list are retained in the dictionary hydra.runtime.choices (#956)
Object Instantiation enhancements
- Support for recursive instantiation with
hydra.utils.instantiate()
(#566) - Instantiate now fully supports positional arguments (#1432)
- Support for converting parameters to primitive containers during instantiation (#1015)
- It is now possible to override the
_target_
of instantiation with a Python type or a string (#1017)
API Change (Renames, deprecations and removals)
General changes
- Default composition order change, see this for details (#1217)
- Remove deprecated strict flag from
@hydra.main
and theCompose API
(#1010) - Passing a config name as config_path to
@hydra.main
is now an error (#1010) - Promote
hydra.experimental.{compose,initialize,initialize_config_dir,initialize_config_module}
out from thehydra.experimental
module to the hydra module. (#1030) - The override grammar now requires that, in quoted strings, any sequence of \ preceding a quote (either an escaped quote, or the closing quote) must be escaped (#1600)
- Support partial failures in MULTIRUN mode (#1377)
- Add
HydraContext
torun_job
and Launcher/Sweeper'ssetup
(#1498)
Instantiate changes
- Instantiate is now recursive by default, use
_recursive_=False
to disable recursive instantiation. (#566) - Deprecated TargetConf, you should no longer be extending or annotating with it (#1010)
- Remove ObjectConf and deprecated params support that was deprecated in Hydra 1.0 (#1010)
Plugins API changes
- HydraContext required in run_job, Launcher and Sweeper's setup methods, see issue for details (#1498)
- ConfigSourcePlugins needs to be modified to support recursive defaults, see link for details (#1080)
Bug Fixes
- Hydra no longer erroneously changes the USER environment variable in pytest unit tests once installed (#1059)
- Fix a bug where Structured Config has a field like
list : Optional[List[int]] = None
(#1117) - No longer modifies exception stack trace when running under a debugger (#1237)
hydra.job.{id,num}
are now properly passed to jobs in multirun (#1270)- Add support for
%f
directive (microseconds) to the${now:PATTERN}
resolver (#1287) - Fixed a bug where tab completion did not work if the Defaults List had a missing (???) item. (#1381)
- Fix
+
overrides to properly insert new values into Structured Configs. (#1515) - Fix edge cases where using the command line to set a key to a value containing a string ending with a backslash could crash (#1600)
--cfg=hydra
now works for read-only config (#1461)- Change hydra.job_logging and hydra.hydra_logging to be non-optional (#1656)
- Configs with unicode characters are now working on Windows (#1659)
Plugins
- Add Optuna Sweeper plugin
Improved Documentation
- New Defaults List page (#1170)
- New Extending Configs pattern (#1170)
- Major updates to the Packages page (#1170)
- New Configuring Experiments pattern (#1170)
- Documentation updates for configuring search path (#1449)
- Documentation for
hydra.callbacks
(#1526) - Document how to configure Hydra plugins (#1582)
Hydra 1.1.0.rc1
1.1.0.rc1 (2021-05-13)
This is the biggest Hydra release yet.
Highlights
- OmegaConf 2.1 supports relative interpolations, nested interpolations, more powerful resolvers and better compatibility with plain Python dict and list.
- Recursive defaults list: Every config can now have a Defaults List.
- Recursive instantiation: When instantiating objects using the
instantiate
API, nested defined objects are instantiated automatically.
There have also been many bug fixes and performance improvements, as well of as some breaking changes - both in Hydra and in OmegaConf.
Please check the API changes and deprecation sections in these release notes and in the OmegaConf release notes.
Features
General enhancements
- Upgrade to OmegaConf 2.1. Please check the release notes for it (#1426)
- Support for Python 3.9. (#1062)
- Improve performance of config composition in a benchmark by 64% (#1328)
- Allow
@
,$
and?
symbols in unquoted values in overrides (#1074, #1437, #1597) - Add a --resolve flag that can be used with the --cfg flag to resolve interpolations before the config is printed. (#1585)
- It is now possible to disable Hydra's logging configuration (#1130)
- Support for Zsh tab completion (#347)
- Support for force-add of config values via
++key=value
(force-add overrides if the value exists and adds it otherwise) (#1049)
Config composition enhancements
- Support for Defaults List in any config (Recursive relative defaults) (#1170)
- Composition order of a config with a Defaults List can be specified with the
_self_
keyword. (#326) - Support for configuring the config search path from the primary config (#274)
- Add support for selecting multiple configs from the same Config Group (#499)
- Final choices of defaults list are retained in the dictionary hydra.runtime.choices (#956)
Object Instantiation enhancements
- Support for recursive instantiation with
hydra.utils.instantiate()
(#566) - Instantiate now fully supports positional arguments (#1432)
- Support for converting parameters to primitive containers during instantiation (#1015)
- It is now possible to override the
_target_
of instantiation with a Python type or a string (#1017)
API Change (Renames, deprecations and removals)
General changes
- Default composition order change, see this for details (#1217)
- Remove deprecated strict flag from
@hydra.main
and theCompose API
(#1010) - Passing a config name as config_path to
@hydra.main
is now an error (#1010) - Promote
hydra.experimental.{compose,initialize,initialize_config_dir,initialize_config_module}
out from thehydra.experimental
module to the hydra module. (#1030) - The override grammar now requires that, in quoted strings, any sequence of \ preceding a quote (either an escaped quote, or the closing quote) must be escaped (#1600)
Instantiate changes
- Instantiate is now recursive by default, use
_recursive_=False
to disable recursive instantiation. (#566) - Deprecated TargetConf, you should no longer be extending or annotating with it (#1010)
- Remove ObjectConf and deprecated params support that was deprecated in Hydra 1.0 (#1010)
Plugins API changes
- HydraContext required in run_job, Launcher and Sweeper's setup methods, see issue for details (#1498)
- ConfigSourcePlugins needs to be modified to support recursive defaults, see link for details (#1080)
Bug Fixes
- Hydra no longer erroneously changes the USER environment variable in pytest unit tests once installed (#1059)
- Fix a bug where Structured Config has a field like
list : Optional[List[int]] = None
(#1117) - No longer modifies exception stack trace when running under a debugger (#1237)
hydra.job.{id,num}
are now properly passed to jobs in multirun (#1270)- Add support for
%f
directive (microseconds) to the${now:PATTERN}
resolver (#1287) - Fixed a bug where tab completion did not work if the Defaults List had a missing (???) item. (#1381)
- Fix
+
overrides to properly insert new values into Structured Configs. (#1515) - Fix edge cases where using the command line to set a key to a value containing a string ending with a backslash could crash (#1600)
Plugins
- Add Optuna Sweeper plugin
Improved Documentation
- New Defaults List page (#1170)
- New Extending Configs pattern (#1170)
- Major updates to the Packages page (#1170)
- New Configuring Experiments pattern (#1170)
Hydra 1.1.0 dev6
The following are informal release notes for Hydra 1.1 as of the publication of 1.1.0.dev6.
Note that there are many changes in OmegaConf 2.1 that are not covered by these release notes. Once OmegaConf 2.1 is officially release it will have formal release notes.
Features
- Support for converting parameters to primitive containers during instantiation (#1015)
- It is now possible to override the target of instantiation with a type or a string (#1017)
- Support for force-add of config values via ++key=value (force-add overrides if the value exists and adds it otherwise) (#1049)
- Support Python 3.9. (#1062)
- It is now possible to disable Hydra's logging configuration (#1130)
- Support for Defaults List in any config (Recursive relative defaults) (#1170)
- Improve performance of config composition in a benchmark by 64% (#1328)
- Can now add keys to fields annotated as Dict[K,V] from the command line without + prefix (#1421)
- Upgrade to OmegaConf 2.1 (#1426)
- Instantiate now fully supports positional arguments (#1432)
- Support for configuring the config search path from the primary config (#274)
- Composition order of a config with a Defaults List can be specified with the self keyword. (#326)
- Support for Zsh tab completion (#347)
- Add support for selecting multiple configs from the same Config Group (#499)
- Support for recursive instantiation with hydra.utils.instantiate() (#566)
- Final choices of defaults list are retained in the dictionary hydra.runtime.choices (#956)
API Change (Renames, deprecations and removals)
- Deprecated TargetConf, you should no longer be extending or annotating with it (#1010)
- Remove ObjectConf and deprecated params support that was deprecated in Hydra 1.0 (#1010)
- Remove deprecated strict flag from @hydra.main and the Compose API (#1010)
- Passing a config name as config_path to @hydra.main is now an error (#1010)
- Promote hydra.experimental.{compose,initialize,initialize_config_dir,initialize_config_module} out from the hydra.experimental module to the hydra module. (#1030)
- ConfigSourcePlugins needs to be modified to support recursive defaults, see link for details (#1080)
- Default composition order change, see this for details (#1217)
- Instantiate is now recursive by default, use recursive=False to disable recursive instantiation. (#566)
Bug Fixes
- Hydra no longer errorenously changes the USER environment variable in pytest unit tests once installed (#1059)
- Allow @ symbol in unquoted values in overrides (#1074)
- Fix a bug where Structured Config has a field like 'list : Optional[List[int]] = None` (#1117)
- No longer modifies exception stack trace when running under a debugger (#1237)
- Fixed hydra.job.id and hydra.job.num not getting passed to jobs in multirun (#1270)
- Add support for %f directive (microseconds) to the ${now:} resolver (#1287)
- Fix interpolation in Hydra config node (#1335)
- Fixed a bug where tab completion did not work if the Defaults List had a missing (???) item. (#1381)
- Fix add overrides to properly insert new values into Structured Configs. (#1515)
Plugins
- Add Optuna Sweeper plugin
- Add support for multi-objective optimization to Optuna sweeper
Improved Documentation
- New Defaults List [page])(https://hydra.cc/docs/next/advanced/defaults_list) (#1170)
- New Extending Configs pattern (#1170)
- Major updates to the Packages page (#1170)
- New Configuring Experiments pattern (#1170)