automl / hypersweeper

Hydra sweeper integration of our favorite optimization packages, utilizing ask-and-tell interfaces.
Other
8 stars 2 forks source link

[Bug] Hypersweeper runner is always doing one iteration too much #10

Closed LabChameleon closed 5 months ago

LabChameleon commented 6 months ago

I think there is a bug in the hypersweeper run function https://github.com/automl/hypersweeper/blob/7b401c4c012d6f857daec07e8f7760679c419eb7/hydra_plugins/hypersweeper/hypersweeper_sweeper.py#L397

In the following while loop is a check if the loop should be terminated next iteration. But the check is at the beginning of the loop and afterwards another iteration is run. This leads to always computing one iteration too much. The check if the loop should be terminated needs to be at the end of the while loop. Consider the problematic code below:

https://github.com/automl/hypersweeper/blob/7b401c4c012d6f857daec07e8f7760679c419eb7/hydra_plugins/hypersweeper/hypersweeper_sweeper.py#L419-L426

TheEimer commented 5 months ago

This actually does "max_parallel" too much. Should be fixed now, though.