Skip to content

Commit 7ca0b2e

Browse files
saitcakmakfacebook-github-bot
authored andcommitted
Use mini-batches when evaluating candidates within optimize_acqf_discrete_local_search (#2682)
Summary: Pull Request resolved: #2682 If `X_loc` is large (which happens if there are many potential neighbors) this could lead to OOM. Breaking evaluations into mini batches should help. Reviewed By: dme65 Differential Revision: D68354268 fbshipit-source-id: dc9ebf307dd30a30917c4bf35e2c269296f90679
1 parent 7c5c7cb commit 7ca0b2e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

botorch/optim/optimize.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1466,7 +1466,11 @@ def optimize_acqf_discrete_local_search(
14661466
if len(X_loc) == 0:
14671467
break
14681468
with torch.no_grad():
1469-
acqval_loc = acq_function(X_loc.unsqueeze(1))
1469+
acqval_loc = _split_batch_eval_acqf(
1470+
acq_function=acq_function,
1471+
X=X_loc.unsqueeze(1),
1472+
max_batch_size=max_batch_size,
1473+
)
14701474
# break if no neighbor is better than the current point (local optimum)
14711475
if acqval_loc.max() <= curr_acqval:
14721476
break

0 commit comments

Comments
 (0)