Closed vturrisi closed 1 year ago
@vturrisi Why not use hydra from FAIR. It is a more powerful, and can easily convert to and from OmegaConf
options?
I have used hydra in the past and could give feedback and code review
@turian yes, using hydra is another possibility. What would be the main advantages over omegaconf?
@vturrisi Hydra is a library that builds on Omegaconf, so it's more powerful. (Nonetheless, you can easily cast things to OmegaConf if need be.) But it's pretty easy to port to it.
TBH I am not super familiar with OmegaConf because I just just Hydra and it seems to handle the casts to OmegaConf automatically as necessary.
Here is what Hydra does that's cool, let me know if OmegaConf does all this:
Skim the intro: https://hydra.cc/docs/intro/ and you'll see what I mean.
There's also the Structured Configs which I haven't allowed, but I believe it allows you to statically type all your parameters and not need the YAML file. I haven't really needed this but super mission-critical services might want this.
BTW, Lightning-Hydra-Template which implements best practices also uses hydra?
One more benefit of hydra that I don't think omegaconf has.
Let's say you have two YAML files, one for a super large model and one for a tiny model.
hydra let's you switch configs using just the name of the YAML. Does omegaconf require you to
(I wanted to take a crack at this but first I'd like to discuss #303 i.e. which is the most common / most covering main file(s) to run on toy data.)
I'm thinking about just using hydra to parse the args and merge appropriate default files. Then, we can just call some script like: python main_pretrain.py --config-path scripts/pretrain/imagenet --config-name barlow {extra parameters to modify} +{extra parameters to add}. I'm not a bit fan or relying on hydra for everything (e.g. initializing objs) nor adhering to the default "configs" structure that hydra uses as it seems like a nightmare to manage many settings.
I'm thinking about just using hydra to parse the args and merge appropriate default files. Then, we can just call some script like: python main_pretrain.py --config-path scripts/pretrain/imagenet --config-name barlow {extra parameters to modify} +{extra parameters to add}.
Agreed
I'm not a bit fan or relying on hydra for everything (e.g. initializing objs) nor adhering to the default "configs" structure that hydra uses as it seems like a nightmare to manage many settings.
Agreed
Nonetheless, you need to add hydra-core
to setup.py and requirements.txt. hydra
is the wrong package.
Yes, I was in a hurry to commit and put the wrong packaged by mistake. Gonna fix it tomorrow together with moving all config files for pretrain from bash to the new setting. Hopefully I'll also fix the tests soon enough and merge everything this week.
@vturrisi did CI/CD get disabled?
@turian it's just failing in the background for some reason. I'm still fixing the tests so it's gonna take a while.
Merging #300 (3ae3e26) into main (be3de80) will decrease coverage by
7.12%
. The diff coverage is76.66%
.
Opening the PR now so that we can properly visualize the changes and eventually get the tests rolling.