question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Best practice for running multiple (possible parallel) experiments

See original GitHub issue

Take a really basic example like this

ex = Experiment('basic')
ex.observers.append(FileStorageObserver.create('my_runs'))

@ex.config
def cfg():
    x = 2

@ex.automain
def run(x):
    print (x, x**3)

What is the best way of configuring multiple experiments that could be run independently, each one producing it’s own config output, e.g.

ex = Experiment('basic')
ex.observers.append(FileStorageObserver.create('my_runs'))

@ex.config
def cfg():
    x = [2, 3, 4] # take one of these at a time and pass to run

@ex.automain
def run(x):
    print (x, x**3)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
Qwlousecommented, Sep 26, 2017

There is no notion of providing several options inside the configuration. The code you posted will simply assign the list [2, 3, 4} to x.

For trying multiple options I often use a separate script that imports the experiment and runs it many times. So e.g. like this:

from basic import ex
x_choices = [2, 3, 4]
for x in x_choices:
    ex.run(config_updates={'x': x})

A grid search can then also easily be implemented using itertools.product.

If you are interested in parallel execution, then I agree with @trickmeyer: the simplest way is to use the commanline interface, and just call the experiment many times with different parameters.

A different strategy, that is only partially supported at this point is to use the queueing function of sacred (-q) to store the configurations that you plan on running in the database with the status QUEUED, and have a set of workers that periodically query the database for such entries and run them. The querying is fully supported, but there is currently no code for the workers. I have a prototype locally, that should be included in sacred soon. But I can also post it here if you are interested.

0reactions
Qwlousecommented, May 6, 2018

Closing, since it seems resolved to me, and further job scheduling support deserves its own issue(s).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running Multiple A/B Tests at The Same Time: Do's and Don'ts
First, running tests in parallel isolated lanes (testing silos) doesn't really make sense from an efficiency standpoint. With any given number ...
Read more >
Simultaneous Experimentation: Run Multiple A/B Tests ...
Learn how running simultaneous experiments improve your product as well as increase your revenue and overall velocity.
Read more >
Running Multiple Improvement Experiments in Parallel
Although this strategy will help your team to increase its rate of improvement, there are two fundamental challenges with it. First, it is ......
Read more >
Running multiple A/B tests in parallel - Bytepawn
I show using Monte Carlo simulations that randomizing user assignments into A/B test experiments makes it possible to run multiple A/B tests ......
Read more >
Can You Run Multiple A/B Tests at the Same Time? - CXL
The reason you'd want to do this is to eliminate noise or bias from your results. The possible downside is that it might...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found