From 520468e8d803a3b9ff8eb42c572054e097e4ce78 Mon Sep 17 00:00:00 2001 From: Max Balandat Date: Tue, 5 Mar 2024 08:46:57 -0800 Subject: [PATCH] Speed up Multi_objective_multi_fidelity_BO.ipynb by in smoke test (#2236) Summary: Modifies some options to reduce compute and speed up execution in smoke test mode. This cuts the execution time in half on my laptop. Pull Request resolved: https://github.com/pytorch/botorch/pull/2236 Reviewed By: SebastianAment Differential Revision: D54540341 Pulled By: Balandat fbshipit-source-id: 93b1019f713a76ec4252f0987f0136428bb6cef0 --- .../Multi_objective_multi_fidelity_BO.ipynb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tutorials/Multi_objective_multi_fidelity_BO.ipynb b/tutorials/Multi_objective_multi_fidelity_BO.ipynb index 82f55c9c7c..41be5fbec8 100644 --- a/tutorials/Multi_objective_multi_fidelity_BO.ipynb +++ b/tutorials/Multi_objective_multi_fidelity_BO.ipynb @@ -424,7 +424,7 @@ " raw_samples=RAW_SAMPLES, # used for intialization heuristic\n", " options={\n", " \"batch_limit\": 5,\n", - " \"maxiter\": 20 if SMOKE_TEST else 200,\n", + " \"maxiter\": 3 if SMOKE_TEST else 200,\n", " \"nonnegative\": True,\n", " },\n", " sequential=True,\n", @@ -479,7 +479,7 @@ "from torch import Tensor\n", "\n", "NUM_INNER_MC_SAMPLES = 2 if SMOKE_TEST else 32\n", - "NUM_PARETO = 3 if SMOKE_TEST else 10\n", + "NUM_PARETO = 1 if SMOKE_TEST else 10\n", "NUM_FANTASIES = 2 if SMOKE_TEST else 8\n", "\n", "\n", @@ -514,9 +514,12 @@ " bounds=bounds[:, non_fidelity_dims],\n", " q=NUM_PARETO,\n", " num_restarts=1,\n", - " raw_samples=1024,\n", + " raw_samples=2 * RAW_SAMPLES,\n", " return_best_only=True,\n", - " options={\"nonnegative\": True},\n", + " options={\n", + " \"nonnegative\": True,\n", + " \"maxiter\": 3 if SMOKE_TEST else 200,\n", + " },\n", " )\n", " return current_value\n", "\n", @@ -572,7 +575,10 @@ " q=BATCH_SIZE,\n", " num_restarts=1,\n", " raw_samples=RAW_SAMPLES, # used for intialization heuristic\n", - " options={\"batch_limit\": 5},\n", + " options={\n", + " \"batch_limit\": 5,\n", + " \"maxiter\": 3 if SMOKE_TEST else 200,\n", + " },\n", " )\n", " # if the AF val is 0, set the fidelity parameter to zero\n", " if vals.item() == 0.0:\n",