-
Notifications
You must be signed in to change notification settings - Fork 6
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
[Decision] Behaviour of batched ask()
#227
Comments
My two cents: by default, a batch of Otherwise, the user would need to implement caching and uniqueness checks and call I think it should be a special case if the optimizer wants to have it in a different way. We could support optimizers by simply filtering the non-unique configs and returning some values twice, but this will break parallelization efficiency if you, for example, ask for 100 but only get 80 back. |
One more comment: maybe make seed/randomness a separate "thing" if that is the case for needing duplicates. Maybe randomness should not be part of the search space/config in the first place... |
For the case of SMAC with repeats and MF algorithms where the config is the same but it wants to be evaluated to a different fidelity, then the
Yup, I've run into this pain before as well and hence the reason why I am leaning towards it's required.
The benefit of uniqueness is that we don't need the seed during sampling. What I mean by that is that the optimizer is already seeded at creation (usually). In practice, I don't think many optimizers support dynamic seeding during So one possible solution is to make the decision that:
|
We do not necessarily need to check, although I would like to have this be something I can rely on. IMO, this seems to be a bug in the optimizer if |
Depends, you could also argue that |
Ah, my bad, absolutely. I somehow assumed we called What I would like to have is the following is unique: list_a = opt.ask(n=10)
opt.tell(eval(list_a))
list_b = opt.ask(n=10)
# list_a and list_b should be unique at this point. |
Hey,
1: list_a = opt.ask(n=10, replace=False)
opt.tell(eval(list_a))
list_b = opt.ask(n=10, replace=False)
# list_a + list_b CAN have duplicates, but both lists contain unique elements 2: opt.replace = False
list_a = opt.ask(n=10)
opt.tell(eval(list_a))
list_b = opt.ask(n=10)
# list_a + list_b contain unique elements Essentially allowing for sampling with or without replacement, either for just a single call to ask or throughout all the calls to ask. |
I like the idea if we had full control over the optimizers but it's more the issue that we are just wrapping existing optimizers, and so we can't control uniqueness in terms of what they provide internally. For example, I don't know how I would implement What we're looking for is a contract for integrated optimizers, not functionality to control this behaviour. Something we can put in a docstring to say, this is what you can expect, and then we make sure the existing optimizers respect that contract. I would ideally like to codify this in a test such that we assert this behaviour is So far, as it seems, the existing optimizers respect uniqueness per batch, i.e. |
Okay, I see what the problem is here. Thanks for the extra context! |
From what I gather it seems that expected behaviour would be for unique trials to be suggested. All integrated optimizers must be tested for this behaviour with and this be documented. This contract does not extend to custom optimizers that people can implement. It is then dependant upon their implementation. |
If asking for a batch of configs as implemented in PR #224, there is no hard requirement that all
n
configs asked for should be unique. In theory I don't see a use case where duplicates is allowed, but it's often a much harder requirement for optimizers to meet.Right now, asking for
n
configs is ambiguous w.r.t. property of uniqueness, although a brief test of SMAC and Optuna with a batch size ofn=100
without having anytell()
seems to suggest that all 100 configs returned were unique (search space was a float in(1.0, 10.0)
), meaning they do not return duplicates.So
ask(n)
then:ask(n)
then:100
configs which have no duplicates.True
, I will not enforce except for integrated optimizers.@KEggensperger @mfeurer
One a decision is made, this unblocks #226
The text was updated successfully, but these errors were encountered: