Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Add --times flag to exp run/repro #5608

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

Closed
dberenbaum opened this issue Mar 11, 2021 · 7 comments
Closed

Add --times flag to exp run/repro #5608

dberenbaum opened this issue Mar 11, 2021 · 7 comments
Labels
A: experiments Related to dvc exp feature request Requesting a new feature

Comments

@dberenbaum
Copy link
Contributor

It would be great to have a --times flag (maybe @jorgeorpinel has a better naming suggestion) that runs an experiment X many times. In other words, dvc exp run --times 5 would run the same experiment 5 times.

This benefits a couple of use cases:

  1. Checkpoints (see Document checkpoints without make_checkpoint() dvc.org#2292): A user may want to repeat a checkpoint experiment multiple times to run through many epochs rather than having that hard-coded into the script or requiring the user to break out of an infinite loop.
  2. Non-deterministic stage: A user may want to compare multiple non-deterministic experiment runs. For example, a user could read in random splits of training and test data on each experiment run to perform cross-validation.

One complication is that the first scenario is sequential and the second is parallelizable, but similar concerns are true with --queue/--run-all. Maybe this could even be merged with --queue, like allowing multiple identical experiments to be added to accomplish the same idea.

Thoughts @pmrowla?

@jorgeorpinel
Copy link
Contributor

jorgeorpinel commented Mar 11, 2021

Current workaround (Linux):

$ for run in {1..10}; do
  dvc exp run ... ;
done

Questions:

  1. How would users run that kind of code without DVC? (Using some other logger e.g. Dvclive or without logging) Same as above?
  2. Not sure it makes sense to support non-deterministic stages, as they're not reproducible anyway.

As for the name, maybe --re(peat) <number>

@jorgeorpinel jorgeorpinel added A: experiments Related to dvc exp feature request Requesting a new feature labels Mar 11, 2021
@dberenbaum
Copy link
Contributor Author

2\. Not sure it makes sense to support non-deterministic stages, as they're not reproducible anyway.

Good point, but we do support those now with --always-changed, right?

@jorgeorpinel
Copy link
Contributor

jorgeorpinel commented Mar 12, 2021

Is that the use case for stage add --always-changed? TBH I'm not sure 🤷

UPDATE: Doesn't seem like that's the intended use per #2479. Something about forcing "callback stages" (without deps) in the middle of a pipeline.

@pmrowla
Copy link
Contributor

pmrowla commented Mar 12, 2021

IMO this seems like something that should just be done by the user through shell scripting?

@dberenbaum
Copy link
Contributor Author

I see some downstream uses for this, but I can put them in an enhancement proposal with other thoughts on future experiment/checkpoint developments. If you don't mind, we can leave this here until I get to that.

@jorgeorpinel jorgeorpinel added the discussion requires active participation to reach a conclusion label Mar 14, 2021
@jorgeorpinel jorgeorpinel removed the discussion requires active participation to reach a conclusion label Mar 20, 2021
@jorgeorpinel
Copy link
Contributor

jorgeorpinel commented Mar 20, 2021

Apparently it can be difficult to quit shell loops (e.g. a while true) per iterative/dvc.org#2292 (comment). That would be an argument for this.

@pmrowla
Copy link
Contributor

pmrowla commented Mar 21, 2021

That's specifically when it comes to using an infinite loop in a shell script. This flag would be for a fixed number of iterations, which isn't the same thing.

@iterative iterative locked and limited conversation to collaborators Mar 21, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
A: experiments Related to dvc exp feature request Requesting a new feature
Projects
None yet
Development

No branches or pull requests

3 participants