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

Experiments proof of concept #4199

Merged
merged 15 commits into from
Jul 17, 2020
Merged

Experiments proof of concept #4199

merged 15 commits into from
Jul 17, 2020

Conversation

pmrowla
Copy link
Contributor

@pmrowla pmrowla commented Jul 13, 2020

Related to #2799.

  • ❗ I have followed the Contributing to DVC checklist.

  • πŸ“– If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here.

  • ❌ I will check DeepSource, CodeClimate, and other sanity checks below. (We consider them recommendatory and don't expect everything to be addressed. Please fix things that actually improve code or fix bugs.)

Thank you for the contribution - we'll try to review it as soon as possible. πŸ™

Implements initial POC support using a single git clone. UI is rough expected to change a lot.

  • dvc repro -e/--experiment - creates a new experiment. Experiment is derived from the current HEAD commit in the user's repo and contains any changes in the user's current workspace.
  • dvc experiments show - show experiment table. By default table includes the user's workspace, the current HEAD commit and any experiments derived from HEAD. --all-commits/--all-tags/--all-branches can be used to display more experiments.
  • dvc experiments diff - diff 2 experiments. Currently just concats the output from dvc metrics diff and dvc plots diff.
  • dvc experiments checkout <experiment_rev> - applies the changes from the specified experiment to the user's current workspace. If the changes would generate a git merge conflict, this command does nothing. --force can be used to replace the user's current workspace with the experiment changes. This has only been tested in cases where user checks out an experiment into a workspace with the original commit the experiment was derived from.
    Note: using --force currently does a git reset --hard in your workspace, the behavior you most likely want is to git stash your workspace changes before using dvc experiments checkout
  • Experiments support is disabled by default.
    • Experiment related commands and args are hidden from the normal dvc --help output, but running dvc experiments --help can be used to show the usage for the experiments commands.
    • Experiments commands do nothing unless the core.experiments config option is set to true (or if DVC is run inside a testing/CI environment).

General thoughts/questions for next iteration:

  • What is the desired behavior for experiments diff - mimic metrics/params diff formats or use the show table with added deltas?
  • How to show data/code changes between experiments?
  • experiments checkout feels a bit awkward to use, maybe it should be a repro --experiment <rev> command to reproduce a specific experiment instead?
  • What kind of workflow to use for "promoting" an experiment commit to a "real" commit or branch in the main repo?

@pmrowla
Copy link
Contributor Author

pmrowla commented Jul 13, 2020

Not really ready yet, but some basic things work:

asciicast

@pmrowla pmrowla self-assigned this Jul 14, 2020
Comment on lines +233 to +238
experiments_parser = subparsers.add_parser(
"experiments",
parents=[parent_parser],
description=append_doc_link(EXPERIMENTS_HELP, "experiments"),
formatter_class=argparse.RawDescriptionHelpFormatter,
)
Copy link
Contributor Author

@pmrowla pmrowla Jul 16, 2020

Choose a reason for hiding this comment

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

help param intentionally omitted here for now so that the command is hidden from the default dvc/dvc --help usage output

Copy link
Member

Choose a reason for hiding this comment

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

In the long term, we should think of some way for this. Even though we had it hidden, users were still trying out new 1.0 docs in 0.94 dvc. Something like [experimental] flags come to mind but would be difficult to read it at this higher-level (add_parser), or could introduce DVC_EXPERIMENTAL_XXX_ENABLE envs or maybe, even simpler name mangling till it's ready.

Not a big issue right now, just sharing the issue that I had. πŸ™‚. Definitely something we should consider, as we mostly work on HEAD.

@pmrowla pmrowla marked this pull request as ready for review July 16, 2020 10:55
@pmrowla pmrowla changed the title [WIP] Experiments proof of concept Experiments proof of concept Jul 16, 2020
@pmrowla pmrowla requested review from efiop and dmpetrov July 16, 2020 10:56
@pmrowla
Copy link
Contributor Author

pmrowla commented Jul 16, 2020

First post has been updated with details. All behavior changes are disabled unless core.experiments config option is set to true, so we should be able to merge and do future iterations on the experiments feature without breaking anything else.

Copy link
Contributor

@efiop efiop left a comment

Choose a reason for hiding this comment

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

Great start!

@efiop efiop merged commit a56c8bb into iterative:master Jul 17, 2020
@pmrowla pmrowla deleted the experiments-poc branch July 17, 2020 02:49
@kenahoo
Copy link

kenahoo commented Jul 28, 2020

This feature piqued my interest. Is there a writeup somewhere of what an "experiment" is, and how it relates to a pipeline and its results? I didn't see any docs/explanation in the PR itself.

@efiop
Copy link
Contributor

efiop commented Jul 28, 2020

@kenahoo Not yet, this is just a poc and is under active development. There are some discussions about it in #2799 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants