Skip to content

feat: automatic compute-setup header and concise Setup line - #755

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/auto-setup-banner
Nov 25, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/auto-setup-banner

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Setup resolution logs a header line stating that this is the automatic CPU/GPU compute-setup choice (Automatic compute setup (CPU/GPU choice from setup="auto"; override with PYAUTO_SETUP or setup=...):, with explicit and PYAUTO_SETUP wording). It follows with a concise Setup: line: readable tokens, rule <dataset_type>/<variant>, and the reason when extrapolated (too few cores, non-A100 GPU, no GPU detected, no GPU rule).

  • The header and Setup line log at the end of AnalysisDataset.modify_before_fit (new resolve_setup(model, log_banner=...) and log_setup_banner()), so the block runs straight into PyAutoFit's Parallel and Estimate lines.
  • No setup gives one line: Compute setup: not set (auto would choose …; pass setup="auto").
  • Aggregator reloads log Compute setup: reapplied <setup_id> from the search's setup.json.
  • Note: an override of resolve_setup(self, model) needs **kwargs for the new keyword.

Test Plan

  • pytest test_autogalaxy: 1664 passed
  • Heart dev gate (all five repos): GREEN. Non-blocking shown reasons: manifest drift; test run status unknown; no release rehearsal for current source; release push credential check 69 h old.
  • pyauto-heart smoke --affected-by PyAutoNerves --jobs 3 over the task root (all five branches): 8/8 workspaces PASS

The terminal output now (real test-mode run from autolens_workspace)

A rectangular pixelization fit with setup="auto" and af.Nautilus(number_of_cores="auto"), on a laptop (8 cores, RTX 2060, JAX pinned to CPU by JAX_PLATFORMS=cpu), with timestamps trimmed:

autofit.non_linear.search.runtime - INFO - Starting non-linear search.
... (numba / mask-padding warnings) ...
autogalaxy.analysis.analysis.setup - INFO - Automatic compute setup (CPU/GPU choice from setup="auto"; override with PYAUTO_SETUP or setup=...):
autogalaxy.analysis.analysis.setup - INFO - Setup:    numba · CPU · sparse operator · fp64   (rule imaging/rectangular · extrapolated: 8 cores, rules measured on ≥16-core nodes)
auto - INFO - Parallel: 8 workers (auto: detected cores)
auto - INFO - Estimate: ~6.4 min on this hardware   (283 ms/eval, euclid cell · Nautilus n_live=50 ≈ 4.6e3 evals, heuristic · η=0.55)

Outside modeling, a plain al.FitImaging(dataset, tracer, settings=aa.Settings(lazy_sparse_operator="auto")) prints once, and the second fit reuses the cache silently:

autoarray.dataset.imaging.dataset - INFO - Automatic compute setup: built the numba sparse operator for this dataset (256 image pixels, 0.20 s; cached; lazy_sparse_operator: auto)

Before this change the same run printed a stale Starting non-linear search with JAX (CPU: cpu). before setup resolution, a verbose Setup line, and warnings between the lines. After the old JAX line was removed, the run also picked JAX · GPU · dense (detected via nvidia-smi) while JAX ran on the CPU. The PyAutoNerves PR fixes that.

All five PRs share the branch name feature/auto-setup-banner, so each repo's CI tests them together. Merge order: PyAutoNerves → PyAutoArray → PyAutoFit → PyAutoGalaxy → PyAutoLens.

Part of #754 (format approved by the human on 2026-11-25).

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

Part of the concise automatic compute-setup banner (#754):
one header line stating the automatic CPU/GPU choice, aligned Setup /
Parallel / Estimate lines printed together, and notices when the setup acts
outside modeling. Shares branch feature/auto-setup-banner across PyAutoNerves,
PyAutoArray, PyAutoFit, PyAutoGalaxy and PyAutoLens.

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 9756fa9 into main Nov 25, 2026
5 checks passed
@Jammy2211
Jammy2211 deleted the feature/auto-setup-banner branch November 25, 2026 11:07
@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.

1 participant