Skip to content
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

Async bo rule and notebook #366

Merged
merged 23 commits into from
Oct 12, 2021
Merged

Conversation

apaleyes
Copy link
Collaborator

@apaleyes apaleyes commented Oct 5, 2021

This PR replaces and expands #363.

Here we:

  • Make changes in greedy acquisition function related to batch initialization and handling of pending points
  • Introduce new AsyncEGO rule.
  • Provide a notebook that illustrates how one could do async BO with Trieste

Unit tests, docs and other trimmings to come at a later point, I am mostly looking for feedback at this point. One note about new rule is that, unlike TrustRegion, this one works not with other rules but with function builders directly. Happy to hear suggestions of how to change that.

Update: all the trimmings are now done. The notebook is decorated with many-many comments to make it as accessible as possible, very happy to improve it further if people still find it unclear what's all this multiprocessing stuff is about.

Copy link
Collaborator

@uri-granta uri-granta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall approach looks good! Various comments. Also you'll need to add unit and integration tests for AsyncEGO (and maybe a couple of unit tests for the function changes).

we want to immediately use acquisition function to launch a new observation and avoid wasting computational resources.

To make the best decision about next point to observe, acquisition function needs to be aware of currently running observations.
We call such points "pending". AsyncEGO provides a ``AsyncEGO.State`` object that keeps track of pending points
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should differentiate between "pending" points used by greedy acquisition functions (points that have been selected but haven't been executed yet) and "outstanding" points, which have been executed but haven't returned.

Suggested change
We call such points "pending". AsyncEGO provides a ``AsyncEGO.State`` object that keeps track of pending points
We call such points "outstanding". AsyncEGO provides a ``AsyncEGO.State`` object that keeps track of outstanding points

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate a bit what's the difference between pending and outstanding? I don't think I understand.

Once the point was chosen by the acquisition function, there is no difference any more, as I understand it. It could have been chosen 5 calls ago or just now, it is still treated exactly the same - as a point which was selected for observations, but result for which hasn't arrived yet.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's like the difference between things in your Amazon basket, and things that you've ordered but haven't arrived yet.

  • Greedy acquistiion functions choose points one at a time. The first points are pending until we've selected the entire batch.
  • Asyn BO choose some points (greedily) and then ask for them to be evaluated (like normal BO), but then starts another loop before all of them have finished executing. The ones that haven't finished yet are outstanding.

@henrymoss henrymoss self-requested a review October 6, 2021 10:14
Copy link
Collaborator

@henrymoss henrymoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@apaleyes apaleyes changed the title Async bo - preview Async bo rule and notebook Oct 7, 2021
Copy link
Collaborator

@hstojic hstojic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what I could assess looks very good - mostly notebook, multiprocessing in python an AsyncEfficientGlobalOptimization itself I canno really evaluate

I have left lots of small suggestions for improvement in the notebook, nothing major

@henrymoss henrymoss self-requested a review October 8, 2021 07:58
Copy link
Collaborator

@henrymoss henrymoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting there! Notebook is much better

Copy link
Member

@vdutor vdutor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only went through the notebook. Looks really good to me - only left a few minor suggestions.

@apaleyes
Copy link
Collaborator Author

apaleyes commented Oct 8, 2021

Hopefully all the comments are addressed. Noticeable updates:

  • Renamed rule to AsynchronousGreedy. No abbreviations, no shortcuts, only hardcore!
  • Removed batch size parameter.
  • I've run into this bug when building docs locally, and had to update version of jupyter_client (and resolve a conflict)
  • Many-many fixes and updates in notebook's write-up

Copy link
Collaborator

@hstojic hstojic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

notebook looks great!

rule.py and function.py hopefully others were able to properly cover

@apaleyes apaleyes merged commit b7bde06 into secondmind-labs:develop Oct 12, 2021
@apaleyes apaleyes deleted the async-bo branch October 12, 2021 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants