New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HydraConfig support #1022
HydraConfig support #1022
Conversation
…IST classification test pipeline was added 2. catalyst/experiments/hydra_config.py: HydraConfigExperiment was added 3. catalyst/runners/hydra_supervised.py: HydraSupervisedExperiment was added 4. catalyst/dl/script/hydra_run.py: @hydra.main() was added as entry point for hydra configuration experiment 5. catalyst/dl/script/run.py: optional argument '--hydra' was added to change entrypoint to hydra config experiment one 6. catalyst/settings.py: optional 'hydra' package import was added 7. catalyst/utils/hydra_config.py: hydra config utils was added 8. catalyst/utils/hydra_scripts.py: hydra scripts utils was added 9. catalyst/utils/hydra_sys.py: hydra sys utils was added 10. requirements/requirements-hydra.txt: optional 'hydra-core' package was added
I don't know what's wrong with this Error
Think I need some review help guys. |
Dear @otherman16 , |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thrilled by this PR, amazing work!
Yes we can close #943 |
cfg.setdefault("args", DictConfig({})) | ||
cfg.args.setdefault("expdir", ".") | ||
cfg.args.setdefault("resume", None) | ||
cfg.args.setdefault("autoresume", None) | ||
cfg.args.setdefault("seed", 42) | ||
cfg.args.setdefault("distributed", os.getenv("USE_DDP", "0") == "1") | ||
cfg.args.setdefault("apex", os.getenv("USE_APEX", "0") == "1") | ||
cfg.args.setdefault("amp", os.getenv("USE_AMP", "0") == "1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this!
While I understand you have backward compatibility requirements that might be in conflict with the suggestions here, I wanted to provide them anyway (at least as food for thought) :
I'd recommend utilizing config composition to get this instead of manually editing the config.
for example, the defaults list of the primary config can look like:
defaults:
- catalyst/config # mandatory catalyst config (provided by catalyst)
- foo: bar # user config groups
catalyst/config can contain everything needed by catalyst (what you are adding above).
A few extra points:
- I am guessing this is designed to be backward compatible with the standard command line.
If possible, break away from that and utilize hierarchy to give catalyst a space of it's own where it wouldn't conflict with other frameworks/user config.
for example:
catalst/config.yaml:
catalyst:
resume: null
seed: 42
...
- Consider using Structured Configs to get config type safety, the above yaml file can be replaced with something like:
@dataclass
class CatalystConf:
resume: Optional[bool] = None
seed: int = 42
ConfigStore.instance().store(group="catalst", name="config", node=CatalystConf)
(See the Structured Configs tutorial for more info).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Thinking about it.
Hydra cv classification test was fixed
All dublicated code was replaced to catalyst/experiments/functional.py
Hydra cv classification test was fixed
…and changed catalyst/utils/sys.py: Functions 'catalyst/utils/scripts.py:distributed_cmd_run()' and 'catalyst/utils/sys.py:dump_environment()' are used for both HydraConfigExperiment and ConfigExperiment
…i_supervised.py MultiSupervisedRunner was added for multiple model support
…ements/requirements-hydra.txt
I do not know what is wrong with |
could you try something like |
Hydra support
Before submitting
catalyst-make-codestyle && catalyst-check-codestyle
(pip install -U catalyst-codestyle
).make check-docs
?pytest .
?Description
Hydra support for catalyst-dl run
Previous PR: OmegaConf support for "catalyst-dl run" #943
Related Issue
Hydra/OmegaConf configuration structure #912
Type of Change
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
PS