Repository navigation
feat: resolve setup before pre-fit use; Setup line reports the JAX fallback - #757
Merged
Merged
Conversation
…ck Setup line Part of #756. 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
Closes #756 together with its PyAutoFit and PyAutoLens PRs (same branch
feature/likelihood-lifecycle-p5-setup-fixes). Merge order: PyAutoFit → PyAutoGalaxy → PyAutoLens.AnalysisSetupMixin.prepare_for_model(model)resolves asetup="auto"(or explicit) setup when it is still unresolved, soanalysis.print_vram_use(model=..., batch_size=...)beforesearch.fitworks and prints the setup banner.resolve_setupis idempotent. Re-resolving to the same setup (samesetup_id, chosen the same way) re-applies it silently, so the banner prints once even whenmodify_before_fitruns after an early resolve; a different setup is applied and logged.Setup:line reports what runs. UnderPYAUTO_DISABLE_JAX=1or without JAX installed, a JAX-designated setup now reads e.g.numpy · CPU · dense · fp64 (rule imaging/mge · designated JAX; JAX disabled), agreeing with theParallel:line.API Changes
Added
AnalysisSetupMixin.prepare_for_modelandsetup_util.jax_fallback_reason_from;setup_text_from/setup_banner_from/setup_banner_lines_fromtake an optionaluse_jax(defaultNonekeeps the previous output).See full details below.
Test Plan
test_autogalaxyfull suite passestest_analysis_dataset.py: early resolve viaprint_vram_use, banner logged once, different setup re-logged, no-setup no-op, JAX-disabledSetup:line agrees withParallel:,with_model(...).modify_before_fitresolvessetup="auto"chapter_2_lens_modeling/tutorial_2_practicalities.pywithsetup="auto"in test mode (local only): banner once, VRAM printed; withPYAUTO_DISABLE_JAX=1numpy banner andParallel:agreeFull API Changes (for automation & release notes)
Added
AnalysisSetupMixin.prepare_for_model(model)— resolve the setup before the fit when unresolved.autogalaxy.analysis.setup_util.jax_fallback_reason_from(setup, use_jax=None)—"JAX disabled"/"JAX not installed"/None.Changed
setup_util.setup_text_from(setup, use_jax=None),setup_banner_from(..., use_jax=None),setup_banner_lines_from(..., use_jax=None)— report the backend that runs when given.AnalysisSetupMixin.resolve_setup— no second banner when re-resolving to the same setup.Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code