-
Hello everyone, I wondered when launching a multi run if there is a way to specify some configurations that should not be run if encountered in hydra. For example assume I have two models python main.py -m +model=odenet,resnet +optim=adam,rmsprop Now what if I don't want to run the combination Thank you for any help :) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
One or more of the following techniques may suit your use-case:
$ python my_app.py -m '+model_optim={model:odenet,optim:adam},{model:odenet,optim:rmsprop},{model:resnet,optim:adam}'
[2022-12-09 06:22:41,703][HYDRA] Launching 3 jobs locally
[2022-12-09 06:22:41,703][HYDRA] #0 : +model_optim={model:odenet,optim:adam}
model_optim:
model: odenet
optim: adam
[2022-12-09 06:22:41,757][HYDRA] #1 : +model_optim={model:odenet,optim:rmsprop}
model_optim:
model: odenet
optim: rmsprop
[2022-12-09 06:22:41,815][HYDRA] #2 : +model_optim={model:resnet,optim:adam}
model_optim:
model: resnet
optim: adam |
Beta Was this translation helpful? Give feedback.
-
Hi @Jasha10, Thank you for your detailed answer. I will try one of those options. However for the first two proposed solutions, as this raises an error it will interrupt every other run scheduled right ? I had more in mind something that checks and just skip if one forbidden configuration is detected. |
Beta Was this translation helpful? Give feedback.
One or more of the following techniques may suit your use-case:
@main
-decorated function:if (cfg.model, cfg.optim) == ("resnet", "rmsprop"): raise RuntimeError(f"Aborting job with invalid config: {cfg.model=}, {cfg.optim=}")
on_job_start
callback. You can throw an error from the callback to abort the job. (Edit: it turns out that a callback-raisedException
will not cause cause the job to abort; see my comment below)