Skip to content
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

add --experimental-rerun CLI option #2098

Merged
merged 5 commits into from Apr 1, 2022
Merged

Conversation

jieru-hu
Copy link
Contributor

@jieru-hu jieru-hu commented Mar 16, 2022

related to #1805

The goal is to add experimental support for single RUN only for now. We will iterate depending on the feedback.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 16, 2022
Copy link
Collaborator

@Jasha10 Jasha10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall it looks good!
I left a few review comments below.

hydra/main.py Outdated Show resolved Hide resolved
hydra/main.py Outdated
cfg = _get_rerun_conf(args.experimental_rerun, args.overrides)
ret = task_function(cfg)
_flush_loggers()
return ret
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why return the value here? The else branch below does not return anything.

Copy link
Contributor Author

@jieru-hu jieru-hu Mar 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return here to be consistent with the cfg_passthrough case above, since this feels more like a special case of cfg_passthrough...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, ok.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we support --experimental-rerun in combination with the --multirun flag in the future (so that users could pass a sweep override)? It's not clear what the return value would be. This is the reason why the else branch below does not return a value (see the comment on that branch).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. multirun is going to be way more complex than what is purposed here. And as I mentioned here I think it makes sense to only support SINGLE run for now and see how it goes. I should have make it more clear on what this issue is trying to address, I've updated the PR description.

I will remove the return statement since I agree it sees redundant.

website/docs/experimental/rerun.md Show resolved Hide resolved
website/docs/experimental/rerun.md Outdated Show resolved Hide resolved
@Jasha10
Copy link
Collaborator

Jasha10 commented Mar 17, 2022

One additional note:
I've noticed that the --experimental-rerun CLI flag does not play well with tab-completion. The following triggers an error:

$ python my_app.py --experimental-rer<TAB>

If this feature becomes non-experimental in the future, we might want to polish this interaction with tab-completion.

@jieru-hu
Copy link
Contributor Author

One additional note: I've noticed that the --experimental-rerun CLI flag does not play well with tab-completion. The following triggers an error:

$ python my_app.py --experimental-rer<TAB>

If this feature becomes non-experimental in the future, we might want to polish this interaction with tab-completion.

I cannot seem to repro this. Do you mean this does not play well with the shell completion plugin Hydra offers?

@jieru-hu jieru-hu requested a review from Jasha10 March 25, 2022 22:59
@Jasha10
Copy link
Collaborator

Jasha10 commented Mar 27, 2022

Do you mean this does not play well with the shell completion plugin Hydra offers?

Yes, exactly.

hydra/main.py Outdated Show resolved Hide resolved
hydra/main.py Outdated
cfg = _get_rerun_conf(args.experimental_rerun, args.overrides)
ret = task_function(cfg)
_flush_loggers()
return ret
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we support --experimental-rerun in combination with the --multirun flag in the future (so that users could pass a sweep override)? It's not clear what the return value would be. This is the reason why the else branch below does not return a value (see the comment on that branch).

@jieru-hu
Copy link
Contributor Author

Do you mean this does not play well with the shell completion plugin Hydra offers?

Yes, exactly.

Gotcha, yea, I can work on that as a follow up item.

@@ -0,0 +1 @@
Add `--experimental-rerun` command-line option
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... to reproduce pickled single runs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in b6ae6ed

### Important Notes
This is an experimental feature. Please reach out if you have any question.
- Only single run is supported.
- `--experimental-rerun` cannot be used with other command-line options or overrides. They will simply be ignored.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should at least warn about ignored args.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

edited the warning message in b6ae6ed

@pixelb
Copy link
Contributor

pixelb commented Mar 30, 2022

The implementation looks good, exept perhaps warning about ignored args with --experimental-rerun.
Having this as experimental seems appropriate for now, given it doesn't handle multirun.
We can use this to garner feedback for non experimental support in future

@jieru-hu jieru-hu merged commit a257e87 into facebookresearch:main Apr 1, 2022
@jieru-hu jieru-hu deleted the i1805 branch April 1, 2022 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants