Skip to content

Compose multiple _global_ configs #621

Answered by rsokl
alexanderswerdlow asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the great minimal example - super helpful.

What is going on here is that Hydra sees that you are using "structured configs" (i.e. dataclasses) and is trying to make things "safer" by enforcing that config-B can only be merged with config-A if B is a subclass of A. In my opinion, this "safety" check does way more harm than good (in fact, I have quite literally only seen it do harm).

Fortunately, we can disable hydra's checks here by depriving it of type information. We can have our config-store convert dataclass types to omegaconf dictionaries upon storing them; these omegaconf dictionaries will have the same fields and hierarchical structure as our original configs, but hydra w…

Replies: 9 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by rsokl
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@jgbos
Comment options

@rsokl
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
hydra/omegaconf Tied to behavior of hydra/omegaconf
3 participants
Converted from issue

This discussion was converted from issue #620 on December 24, 2023 14:57.