-
Notifications
You must be signed in to change notification settings - Fork 14
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
Updates to launch
#272
Updates to launch
#272
Conversation
src/hydra_zen/_launch.py
Outdated
if len(fields(config)) == 0: | ||
raise ValueError( | ||
"""There is an issue with your dataclass. If you previously executed with a | ||
`hydra/launcher` that utilizes cloudpickle (e.g., hydra-submitit-launcher), there is a known | ||
issue with dataclasses (see: https://github.com/cloudpipe/cloudpickle/issues/386). You will have | ||
to restart your interactive environment. To avoid this issue you can use the option `to_dictconfig=True`.""" |
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.
This check will prevent empty configs from working:
from hydra_zen import make_config
from dataclasses import fields
>>> fields(make_config())
()
This would break some of our basic mushin workflow examples
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.
Actually, when you get rid of this check, it would be good to add a regression test to ensure that launch
always supports an empty config.
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.
You could check the length of the fields before and after the run, and then raise a warning to the user.
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.
yeah, I was just thinking about that.
+ "`to_dictconfig=True`." | ||
) | ||
): | ||
with pytest.warns(UserWarning): |
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.
ahh, that's how you do that.
This PR does two things:
dataclass
input to aDictConfig
. This is a fix and response to the cloudpickle issuelaunch
to comform with Hydra's Compose API. Currently we cannot usecompose
as it does not supportmuliturn
, but these changes make it easy to update ifcompose
eventually supportsmultirun
.@rsokl I added cloudpickle to some of the test requirements. I'm not sure how to test without it.