facebookresearch / vissl

VISSL is FAIR's library of extensible, modular and scalable components for SOTA Self-Supervised Learning with images.
https://vissl.ai
MIT License
3.26k stars 334 forks source link

ssl-framework: future compatibility with Hydra 1.1 #414

Closed QuentinDuval closed 3 years ago

QuentinDuval commented 3 years ago

Summary: Updates necessary to update to Hydra 1.1.

Composition order is changing

One of the changes in Hydra 1.1 is that the default composition order is changing. This is documented in: https://hydra.cc/docs/upgrades/1.0_to_1.1/default_composition_order.

In Hydra 1.1, a config is overriding values introduced by the defaults list while in Hydra 1.0 - the defaults list was overriding the values in the config.

The solution is to add _self_ as the first item in the defaults list.

Hydra 1.0.7: As of Hydra 1.0.7, Hydra 1.0 ignores _self_ in the defaults list. Adding it there does not change the behaviour of Hydra 1.0. This is the minimum version of Hydra supported by VISSL from this commit on. An assert has been added to ask users to upgrade.

Hydra 1.1: In Hydra 1.1, _self_ determines the composition order of the content of a config relative to the items from its defaults list. Adding _self_ as the first item ensures that the defaults list will override the config and not the other way around.

Compose is not experimental anymore

Calls to hydra.experimental.compose will raise a warning starting from Hydra 1.1. The code has been adapted to make sure the correct version of compose is used in Hydra 1.1.

Differential Revision: D29778452

facebook-github-bot commented 3 years ago

This pull request was exported from Phabricator. Differential Revision: D29778452

facebook-github-bot commented 3 years ago

This pull request was exported from Phabricator. Differential Revision: D29778452

facebook-github-bot commented 3 years ago

This pull request was exported from Phabricator. Differential Revision: D29778452

facebook-github-bot commented 3 years ago

This pull request has been merged in facebookresearch/vissl@974576b93a77d0a9357e8b89e76842911c137eae.