docs: make the multi-start batch_size decision explicit - #132
Merged
Conversation
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0171voyyTrr91hJ3vU5AjeVz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For PyAutoLabs/PyAutoFit#1452.
What and why
PyAutoLabs/PyAutoHands#228 added a static check that flags any
MultiStart*search constructed without an explicitbatch_size. Defaulting toNoneevaluates every start in a singlejax.vmap, materializing the whole batchedvalue_and_grad— which is how two workspace interferometer scripts inherited an unbounded 48-way vmap and OOMed two nightly release runs.One site here:
scripts/searches/mle.py:245(MultiStartAdam,n_starts=16).Behaviour is unchanged
batch_size=Noneis already the default, so nothing changes at runtime. The choice is now 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 — the annotation exists so the next author makes the decision deliberately rather than inheriting it.
Scripts changed
scripts/searches/mle.py— one line;notebooks/searches/mle.ipynbregenerated to match (byte-preserving insert, re-verified as valid JSON)Merge before PyAutoLabs/PyAutoHands#229, which turns the check into a required job.
Generated by Claude Code