-
Notifications
You must be signed in to change notification settings - Fork 311
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
Bug fix: Make MBM acquisition pass the correct args to each BoTorch optimizer; cleanup #2571
Conversation
This pull request was exported from Phabricator. Differential Revision: D59354709 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2571 +/- ##
=======================================
Coverage 95.22% 95.23%
=======================================
Files 489 489
Lines 47612 47661 +49
=======================================
+ Hits 45338 45389 +51
+ Misses 2274 2272 -2 ☔ View full report in Codecov by Sentry. |
This pull request was exported from Phabricator. Differential Revision: D59354709 |
b461ad3
to
9a1b70f
Compare
…ptimizer; cleanup (facebook#2571) Summary: Pull Request resolved: facebook#2571 Motivation: MBM can dispatch to four different BoTorch optimizers depending on the search space. Currently, `optimize_acqf_discrete_local_search` is failing because it is passed the inappropriate argument `sequential`. This diff * Makes the logic more clear: First, Acquisition.optimize determines which of the four optimizers is appropriate. then it constructs arguments based on that optimizer. Then it constructs arguments for the optimizers using `optimizer_argparse`. Then it does any optimizer_specific logic and calls the optimizer. * Fixes optimizer_argparse so that inappropriate arguments such as `sequential` are not passed to optimizers they don't apply to. * Removes special-casing for qNEHVI and qMES in optimizer_argparse that wasn't actually doing anything * Extends unit tests for `optimizer_argparse` to check all optimizers * Reduces the usage and scope of mocks in test_acquisition so that `optimize_acqf` and its variants are actually run as much as possible. Differential Revision: D59354709
…ptimizer; cleanup (facebook#2571) Summary: Pull Request resolved: facebook#2571 Motivation: MBM can dispatch to four different BoTorch optimizers depending on the search space. Currently, `optimize_acqf_discrete_local_search` is failing because it is passed the inappropriate argument `sequential`. This diff * Makes the logic more clear: First, Acquisition.optimize determines which of the four optimizers is appropriate. then it constructs arguments based on that optimizer. Then it constructs arguments for the optimizers using `optimizer_argparse`. Then it does any optimizer_specific logic and calls the optimizer. * Fixes optimizer_argparse so that inappropriate arguments such as `sequential` are not passed to optimizers they don't apply to. * Removes special-casing for qNEHVI and qMES in optimizer_argparse that wasn't actually doing anything * Extends unit tests for `optimizer_argparse` to check all optimizers * Reduces the usage and scope of mocks in test_acquisition so that `optimize_acqf` and its variants are actually run as much as possible. Differential Revision: D59354709
This pull request was exported from Phabricator. Differential Revision: D59354709 |
…ptimizer; cleanup (facebook#2571) Summary: Pull Request resolved: facebook#2571 Motivation: MBM can dispatch to four different BoTorch optimizers depending on the search space. Currently, `optimize_acqf_discrete_local_search` is failing because it is passed the inappropriate argument `sequential`. This diff * Makes the logic more clear: First, Acquisition.optimize determines which of the four optimizers is appropriate. then it constructs arguments based on that optimizer. Then it constructs arguments for the optimizers using `optimizer_argparse`. Then it does any optimizer_specific logic and calls the optimizer. * Fixes optimizer_argparse so that inappropriate arguments such as `sequential` are not passed to optimizers they don't apply to. * Removes special-casing for qNEHVI and qMES in optimizer_argparse that wasn't actually doing anything * Extends unit tests for `optimizer_argparse` to check all optimizers * Reduces the usage and scope of mocks in test_acquisition so that `optimize_acqf` and its variants are actually run as much as possible. Differential Revision: D59354709
9a1b70f
to
6b0ad55
Compare
…ptimizer; cleanup (facebook#2571) Summary: Pull Request resolved: facebook#2571 # Context The current flow is 1. MBM `Acquisition.optimize` constructs arguments passed to BoTorch optimizers in `optimizer_argparse` without knowing which of the four optimizers it will be passing the arguments to. It has only a boolean flag indicating whether the optimizer is discrete. 2. `Acquisition.optimize` decides which of the four optimizers to use and does optimizer specific-logic (these two parts are not really sequential). 3. `Acquisition.optimize` calls a BoTorch optimizer, passing some arguments that may not apply to the optimizer that actually got used. 4. Prior to pytorch/botorch#2390, the inappropriate arguments would be silently ignored, but now they raise an exception. MBM can dispatch to four different BoTorch optimizers depending on the search space. Currently, `optimize_acqf_discrete_local_search` is failing because it is passed the inappropriate argument `sequential`. # This diff * Makes the flow within `Acquisition.optimize` more clear and changes `optimizer_argparse` so that inappropriate arguments such as `sequential` are not passed to optimizers they don't apply to: 1. `Acquisition.optimize` determines which of the four optimizers is appropriate. 2. `Acquisition.optimize` constructs arguments based on that optimizer, only constructing needed arguments. 3. Then it does any optimizer-specific logic. 4. Then it calls a BoTorch optimizer; there is no longer an error because only appropriate arguments were passed. * Extends unit tests for `optimizer_argparse` to check all optimizers * Reduces the usage and scope of mocks in test_acquisition so that `optimize_acqf` and its variants are actually run as much as possible. Differential Revision: D59354709
This pull request was exported from Phabricator. Differential Revision: D59354709 |
6b0ad55
to
8a00600
Compare
This pull request has been merged in 1a6faa6. |
Summary:
Motivation: MBM can dispatch to four different BoTorch optimizers depending on the search space. Currently,
optimize_acqf_discrete_local_search
is failing because it is passed the inappropriate argumentsequential
.This diff
optimizer_argparse
. Then it does any optimizer_specific logic and calls the optimizer.sequential
are not passed to optimizers they don't apply to.optimizer_argparse
to check all optimizersoptimize_acqf
and its variants are actually run as much as possible.Differential Revision: D59354709