Repository navigation
fix: skip the CPU memory probe that doubles MultiStart compile - #1647
Merged
Merged
Conversation
MultiStartGradient._warn_if_unbatched_exceeds_memory probed Analysis.batched_memory_bytes at batch 1 and 2 whenever batch_size=None, and each probe is a full throwaway XLA compile of the batched value_and_grad. It relied on memory_analysis returning 0 on CPU to bail after the first probe; from jax 0.10.2 CPU reports a non-zero value, so every CPU MultiStart fit paid two extra full-model compiles. One drew the slow compile mode (~54 min) and pushed autolens imaging/start_here.py to a 3605 s TIMEOUT in release-integrate run 36226772178. Return before any probe on the CPU backend (the guard exists for GPU OOM, #1452), and read the memory budget before probing so an unknown budget never pays a compile. Tests pin both gates with stub probes. Closes #1646 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Jammy2211
pushed a commit
to PyAutoLabs/PyAutoMind
that referenced
this pull request
Sep 26, 2026
PyAutoFit#1647 merged (326f611b); issue #1646 closed. Record carries pending-release: PyAutoFit@PyAutoLabs/PyAutoFit#1647. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
MultiStartGradient._warn_if_unbatched_exceeds_memory(PyAutoFit#1453) probedAnalysis.batched_memory_bytesat batch 1 and 2 wheneverbatch_size=None. Each probe is a full throwaway XLA compile ofjit(vmap(value_and_grad(fitness.call))). It counted onmemory_analysisreturning 0 on CPU to stop after the first probe. From jax 0.10.2 CPU returns a non-zero value, so every CPU MultiStart fit paid two extra full-model compiles. In release-integrate run 36226772178 (2026-09-26) one of them hit the slow CPU compile mode (~54 min) and pushedautolens_workspace/scripts/imaging/start_here.pyto a 3605 s TIMEOUT. The previous three nights took 704-770 s.The guard now returns before any probe on the CPU backend. It exists to catch GPU OOM (#1452). It also reads the memory budget before probing, so an unknown budget never pays for a compile. The docstring's "Known limitation" paragraph is rewritten to explain the deliberate CPU skip and cite the run.
Closes #1646
API Changes
None — internal changes only.
Test Plan
test__unbatched_memory_guard__*tests (stub probe records calls;jax.default_backendmonkeypatched):batch_size=warning: passes before and afterpytest test_autofit/non_linear/search/mle/: 139 passedimaging/start_here.pyback near ~700 s🤖 Generated with Claude Code