Support backwards compatible operation by default#2065
Support backwards compatible operation by default#2065pixelb merged 7 commits intofacebookresearch:mainfrom
Conversation
|
TODO:
|
|
Let me outline an argument in favor of using hydra's Remote launcher plugins need to serialize Hydra's global state so that the remote process that will run the job can use the same global state. For example, the Hydra submitit launcher uses this pattern:
Since the final config is composed on the remote process, that remote process must have access to Hydra's global state. I believe that this should include the version base, as the composition process will probably depend on the version base (e.g. PR #2056 removes deprecated functionality that affects config composition, and so the version base will play a role in finalizing that PR). The |
cfb28f5 to
8cdef72
Compare
c132bad to
cd48ce9
Compare
Add the "version_base" parameter to hydra.main, which acts as central way to select the defaults for that version. Without a specified "version_base" the user will get a warning, and we'll default to the currently supported minimum version defaults (currently those of version 1.1). Specifying a "version_base" will suffice to select appropriate defaults, rather than requiring one explicitly set other config items like config_path, or hydra.job.chdir. New hydra uses should use version_base=None to get the default set of the currently installed version.
Update the website/docs/upgrades/*/hydra_main_config_path.md docs, to indicate the new version_base default setting for config_path.
$ git grep -l hydra.main.*config_path=None | grep -Ev '(docs/upgrades|versioned_docs)' |
xargs sed -i 's/hydra.main(config_path=None/hydra.main(version_base=None/'
$ git grep -l initialize.*config_path=None | grep -Ev '(docs/upgrades|versioned_docs)' |
xargs sed -i 's/initialize(config_path=None)/initialize(version_base=None)/'
$ git grep hydra.main.*config_path= | grep -v version_base | grep -Ev '(docs/upgrades|versioned_docs)' |
cut -d: -f1 | uniq | xargs sed -i 's/hydra\.main(config_path=/hydra.main(version_base=None, config_path=/'
Also various manual additions
Also adjust docs to remove the implication we'll break behavior in hydra 1.3
|
lg! should we add some notes on version_base in the developer guide as well? This is helpful to know for introducing breaking changes. |
Add the "version_base" parameter to hydra.main,
which acts as central way to select the defaults for that version.
Without a specified "version_base" the user will get a warning,
and we'll default to the currently supported minimum version defaults
(currently those of version 1.1).
Specifying a "version_base" will suffice to select appropriate defaults,
rather than requiring one explicitly set other config items like
config_path, or hydra.job.chdir.
New hydra uses should use version_base=None to get
the default set of the currently installed version.