This repository was archived by the owner on Sep 1, 2024. It is now read-only.
Migration to hydra latest#187
Open
RedLeader962 wants to merge 8 commits into
Open
Conversation
…re hydra-core=1.1.0 behaviour. - relax omegaconf requirement - bump hydra-core to version 1.1 - Error msg eg: `omegaconf.errors.ValidationError: Error instantiating 'mbrl.models.gaussian_mlp.GaussianMLP' : Object of unsupported type: 'SiLU'`. Note: those error msg for migrating hydra-core 1.o to 1.1 are not really helpful until you open a debug session - Problem: `hydra-core>=1.1.0` set `instantiate` fct to recursive by default, breaking all mbrl-lib use of `hydra.instantiate` original behaviour with nested dict config ([hydra 1.1.0 release note](https://github.com/facebookresearch/hydra/releases/tag/v1.1.0)). - Solution: changing config files on the user side would be error-prone, so simply add `_recursive_=False` to every `hydra.utils.instantiate(cfg, _recursive_=False)` that deal with nested instantiation logic.
- `hydra-core<1.1.2` introduced breaking change relevant to mbrl-lib. - `mbrl-lib` was tested with both `tests/core` and `tests/algorythm` against hydra-core versions 1.1, 1.2 and 1.3
- Preserve mbrl-lib default config ordering behaviour using `_self_` keyword (Ref https://hydra.cc/docs/1.1/upgrades/1.0_to_1.1/default_composition_order/) - remove deprecated package header `@package _group_` (ref https://hydra.cc/docs/1.1/upgrades/1.0_to_1.1/changes_to_package_header/)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Types of changes
Motivation and Context / Related issue
Motivation: Enable importing
mbrl-libin project requiring newer hydra-core>=1.1.2 version.Context:
mbrl-libhydra-coreversion was freezed at v1.0.3 which was release in 2020. A lot of useful functionality were introduce since then.Regression warning/bug that where fixed:
Post hydra-core version 1.1 introduce breaking changes that were fixed in this PR the following way:
hydra-core>=1.1.0setinstantiatefct to recursive by default, breaking all mbrl-lib use ofhydra.instantiateoriginal behaviour with nested dict config (hydra 1.1.0 release note). Changing config files on the user side would be error-prone, so I simply added_recursive_=Falseto everyhydra.utils.instantiate(<cfg>)that deal with nested instantiation logic;_self_keyword inexamples/conf/main.yamldefaults(Ref https://hydra.cc/docs/1.1/upgrades/1.0_to_1.1/default_composition_order/);@package _group_to all config group yaml file (ref https://hydra.cc/docs/1.1/upgrades/1.0_to_1.1/changes_to_package_header/).Remark on breaking change:
++eg:python -m mbrl.examples.main algorithm=mbpo ++device=cpuNote:
hydra-core>=1.1.2. Older than that wont be compatible with the proposed changes.How Has This Been Tested (if it applies)
tests/coreandtests/algorithmsmbrl/examples/README.md.github/workflows/ci.ymlChecklist