Skip to content

feat: resolve setup before pre-fit use; Setup line reports the JAX fallback - #757

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/likelihood-lifecycle-p5-setup-fixes
Nov 25, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/likelihood-lifecycle-p5-setup-fixes

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Closes #756 together with its PyAutoFit and PyAutoLens PRs (same branch feature/likelihood-lifecycle-p5-setup-fixes). Merge order: PyAutoFit → PyAutoGalaxy → PyAutoLens.

  • Setup resolves before pre-fit likelihood use. AnalysisSetupMixin.prepare_for_model(model) resolves a setup="auto" (or explicit) setup when it is still unresolved, so analysis.print_vram_use(model=..., batch_size=...) before search.fit works and prints the setup banner.
  • resolve_setup is idempotent. Re-resolving to the same setup (same setup_id, chosen the same way) re-applies it silently, so the banner prints once even when modify_before_fit runs after an early resolve; a different setup is applied and logged.
  • The Setup: line reports what runs. Under PYAUTO_DISABLE_JAX=1 or without JAX installed, a JAX-designated setup now reads e.g. numpy · CPU · dense · fp64 (rule imaging/mge · designated JAX; JAX disabled), agreeing with the Parallel: line.

API Changes

Added AnalysisSetupMixin.prepare_for_model and setup_util.jax_fallback_reason_from; setup_text_from / setup_banner_from / setup_banner_lines_from take an optional use_jax (default None keeps the previous output).
See full details below.

Test Plan

  • test_autogalaxy full suite passes
  • New tests in test_analysis_dataset.py: early resolve via print_vram_use, banner logged once, different setup re-logged, no-setup no-op, JAX-disabled Setup: line agrees with Parallel:, with_model(...).modify_before_fit resolves setup="auto"
  • HowToLens chapter_2_lens_modeling/tutorial_2_practicalities.py with setup="auto" in test mode (local only): banner once, VRAM printed; with PYAUTO_DISABLE_JAX=1 numpy banner and Parallel: agree
  • Heart dev-ship readiness: GREEN (non-blocking reasons listed on the PyAutoFit PR).
Full 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

…ck Setup line

Part of #756.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Nov 25, 2026
@Jammy2211
Jammy2211 merged commit b7b848d into main Nov 25, 2026
5 checks passed
@Jammy2211
Jammy2211 deleted the feature/likelihood-lifecycle-p5-setup-fixes branch November 25, 2026 16:44
@pyautolabs-bot pyautolabs-bot Bot removed the pending-release PR queued for the next release build label Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: likelihood-lifecycle pre-release setup fixes (auto setup before fit, estimate_runtime auto, JAX-disabled banner, ModelAnalysis forwarding)

1 participant