From b8bc4771e48f58b9ac591be244af53c7b4cf0ff2 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 5 Aug 2026 06:43:52 +0000 Subject: [PATCH] docs: make the multi-start batch_size decision explicit A new static check in PyAutoHands flags any MultiStart* search built without an explicit batch_size, because defaulting to None is how two workspace interferometer scripts inherited an unbounded 48-way vmap and OOMed nightly release runs (PyAutoLabs/PyAutoFit#1452). Behaviour is unchanged - None is already the default. What changes is that the choice is written down where a reviewer sees it, with a pointer to the knob if a reader hits a memory limit. This is a 1D toy likelihood at 16 starts, so no bounded value is warranted. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_0171voyyTrr91hJ3vU5AjeVz --- notebooks/searches/mle.ipynb | 1 + scripts/searches/mle.py | 1 + 2 files changed, 2 insertions(+) diff --git a/notebooks/searches/mle.ipynb b/notebooks/searches/mle.ipynb index efc3180f..572a6807 100644 --- a/notebooks/searches/mle.ipynb +++ b/notebooks/searches/mle.ipynb @@ -379,6 +379,7 @@ " path_prefix=\"searches\",\n", " name=\"MultiStartAdam\",\n", " n_starts=16,\n", + " batch_size=None, # Starts evaluated at once: `None` vmaps all 16 together, which is fastest but allocates the whole batched gradient; set an integer (e.g. 4) if you hit an out-of-memory error.\n", " n_steps=500,\n", " learning_rate=0.5,\n", ")\n", diff --git a/scripts/searches/mle.py b/scripts/searches/mle.py index 7a7fee7f..0019f998 100644 --- a/scripts/searches/mle.py +++ b/scripts/searches/mle.py @@ -243,6 +243,7 @@ path_prefix="searches", name="MultiStartAdam", n_starts=16, + batch_size=None, # Starts evaluated at once: `None` vmaps all 16 together, which is fastest but allocates the whole batched gradient; set an integer (e.g. 4) if you hit an out-of-memory error. n_steps=500, learning_rate=0.5, )