From 4f27366f36e693e10c5e4627565c7559c78e3ea0 Mon Sep 17 00:00:00 2001 From: Elizabeth Santorella Date: Fri, 28 Jun 2024 08:11:34 -0700 Subject: [PATCH] Don't let MBM pass `raw_samples` to `optimize_acqf_discrete` Summary: https://github.com/pytorch/botorch/pull/2390 broke workflows that were passing this argument, which used to be silently ignored. This is a hotfix that will stop those usages from failing. Differential Revision: D59161641 --- ax/models/torch/botorch_modular/acquisition.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ax/models/torch/botorch_modular/acquisition.py b/ax/models/torch/botorch_modular/acquisition.py index f3b7aa8fcde..b97903ef43f 100644 --- a/ax/models/torch/botorch_modular/acquisition.py +++ b/ax/models/torch/botorch_modular/acquisition.py @@ -530,6 +530,11 @@ def optimize( ) n = num_choices + # `raw_samples` is not supported by `optimize_acqf_discrete`. + # TODO[santorella]: Rather than manually removing it, we should + # ensure that it is never passed. + if optimizer_options is not None: + optimizer_options.pop("raw_samples") discrete_opt_options = optimizer_argparse( self.acqf, bounds=bounds,