-
Notifications
You must be signed in to change notification settings - Fork 18
Attempt to make optimas generators compatible with generator standard
#249
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
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
Check output of multitask trials
Original (from main) 2 runs: New Also note that the multi-task generator - This also brings up the question why Optimas limits generation to the number of workers, rather than just giving libEnsemble all points produced, and letting it manage the queue. This would also prevent the need to have failed suggests. The multitask test in
I think I follow the pattern here. The second hifi batch is processing a best point chosen from the previous lofi batch (hence a repeated arm), but uses a new ax trial id for the batch. The arm name really IDs the point. So arm could be mapped to an |
* Simplify ingest function * self._ax_client.attach_trial not called on ignored trial
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
* File dumps can exactly match requested counts.
optimas/gen_functions.py
Outdated
| # Register trials with unknown SEM | ||
| # generator.tell_trials(trials) # Give as batch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we switch to this code?
What was the intention for this comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated to batch, but it throws out a few things - like checkpointing at an exact id.
| "GridSamplingGenerator", | ||
| "LineSamplingGenerator", | ||
| "RandomSamplingGenerator", | ||
| "ExternalGenerator", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to add a test for this object in the CI?
(This could potentially be a follow-up PR.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
| config[var.name] for var in trial.varying_parameters | ||
| ] | ||
| return trials | ||
| points.append(config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| points.append(config) | |
| points.append(config) |
| make_plots(gen) | ||
|
|
||
|
|
||
| def test_ax_single_fidelity_resume(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that this function was simply moved from its previous location in this file to this new location.
If this is indeed the case, could you move it back to its previous location?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was the one function that was out of order from the list of tests - why should it be out of order?
optimas generators compatible with generator standardoptimas generators compatible with generator standard
| # If want to use _id can have a mapping inside the generator, but those | ||
| # points that are part of same ax trial_index will not be seen in history. | ||
| custom_trial_parameters = [ | ||
| TrialParameter("arm_name", "ax_arm_name", dtype="U32"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a follow-up PR, let us consider how to fit this in the VOCS format and/or whether to convert arm_id as a unique _id.
Overall approach:
optimasgenerators currently call theaskandtellmethods, which, under the hood, can the_askand_tellmethods.In this PR:
ask/tellare renamed toask_trials/tell_trialsand keep the same interface (for compatibility with the rest of the framework)_ask/_tellare renamed toask/telland adopt the new standardized interface.This allows other packages to use the
optimasgenerators. (In this case, these other packages will call the new, standardizedask/telldirectly, without going throughask_trials/tell_trials.)In order to wrap a standardized generator from another package, one would only need to make a thin wrapper around it that defines
ask_trialsandtell_trials.Checks (SH):
trial_indextoax_trial_id_, trial_id = self._ax_client.attach_trial(params)could get called on an ignored trial, is this needed?tell_trialsfunction can work on a set of points, but if do more than one at a time...max_evalsdone, rest of batch gets given (this could be truncated with an internal check if they are not wanted).