Skip to content

docs: auto compute-setup guide, cpu_fast override example, HPC fix (5F PR1) - #689

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/likelihood-lifecycle-p5f1-workspace
Nov 25, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/likelihood-lifecycle-p5f1-workspace

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Likelihood-lifecycle phase 5F, PR1 of 3 (#688). This brings the workspace in line with the automatic compute setup now on library main (5A–5E plus the setup banner):

  • a new guides/advanced/auto_setup.py guide;
  • the cpu_fast_modeling.py scripts become the explicit-override examples;
  • the HPC CPU/GPU example is fixed;
  • stale speed prose is retired.

Merge timing: these scripts call setup="auto", number_of_cores="auto", al.estimate_runtime and al.Settings(lazy_sparse_operator=...), which are merged but not yet on PyPI. Merge this together with or after the release that carries them (pending-release: PyAutoNerves#223/#224, PyAutoArray#709/#710/#712/#713, PyAutoFit#1795/#1796/#1797, PyAutoGalaxy#752/#753/#755, PyAutoLens#882/#886/#888/#889).

Changes

  • New scripts/guides/advanced/auto_setup.py (and notebook) covers: what auto decides and never decides; the per-dataset table (CPU node vs A100, from setup_rules.yaml); a fit with setup="auto" / number_of_cores="auto"; reading the printed header and Setup: / Parallel: / Estimate: lines (real output pasted in); overrides (setup_id, al.Setup.from_setup_id, PYAUTO_SETUP, the JAX_PLATFORMS=cpu note); al.estimate_runtime; the lazy sparse operator for single fits; what masking, noise scaling and over-sampling keep; setup.json / parallel.json and aggregator reloads; factor graphs.
  • Links: guides/advanced/README.md (also fixes the stale graphical entry and the missing over_sampling_chaining), guides/README.md, the __JAX__ sections of root start_here.py (also fixes its "NumPy is the default" contradiction) and imaging/start_here.py, and guides/using_jax.py. Also a smoke_tests.txt entry.
  • cpu_fast_modeling.py (imaging, group, multi_galaxy) is reframed as "override the automatic setup":
    • setup = "numba_cpu_sparse_fp64" with dataset.apply_setup(...) and setup=setup on each analysis replaces apply_sparse_operator_cpu() / use_jax=False;
    • the false "does not support JAX", "rebuilt after re-sampling" and "beats JAX GPU" claims are removed;
    • in the imaging SLaM section, the SOURCE LP stage now uses setup="auto". Its prose said JAX but its code forced NumPy.
  • HPC: guides/hpc/example_cpu_and_gpu.py + hpc/README.md + batch-script comments now use setup="auto" / number_of_cores="auto". They fix the single-CPU vs 8-CPU and "identical because use_jax=True" contradictions, and mark the JAX_PLATFORMS / thread pins as optional.
  • Stale prose (about 15 files, imaging/interferometer/datacube modeling and fit scripts) points to setup="auto" and the guide. Explicit teaching code is unchanged, and the bulk use_jax=True boilerplate is left for the R6 default-flip sweep.
  • Notebooks, llms-full.txt and workspace_index.json regenerated by PyAutoHands generate.py.

Test Plan

  • Every edited script runs in test mode (PYAUTO_TEST_MODE=2, headless): 19/19 rc=0. The guide also passes under the smoke profile env (PYAUTO_DISABLE_JAX=1, small datasets).
  • pyauto-heart smoke autolens against this branch: 43/43 scripts PASS (including the new guide) plus notebooks.
  • scripts/check_sizes.sh: OK.
  • Heart dev gate (pyauto-heart readiness --dev --repos autolens_workspace): GREEN.

What the guide prints (8-core laptop, test mode):

Automatic compute setup (CPU/GPU choice from setup="auto"; override with PYAUTO_SETUP or setup=...):
Setup:    numba · CPU · sparse operator · fp64   (rule imaging/rectangular · extrapolated: 8 cores, rules measured on ≥16-core nodes)
Parallel: 8 workers (auto: detected cores)
Estimate: ~10 min on this hardware   (283 ms/eval, euclid cell · Nautilus n_live=50 ≈ 7.3e3 evals, heuristic · η=0.55)
Automatic compute setup: built the numba sparse operator for this dataset (2828 image pixels, 0.24 s; cached; lazy_sparse_operator: auto)

Notes:

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

…mple fix (5F PR1)

New guides/advanced/auto_setup.py (setup="auto" / number_of_cores="auto",
the per-dataset table, reading the Setup/Parallel/Estimate lines, overrides,
estimate_runtime, lazy sparse operator, setup.json, factor graphs), linked
from the READMEs, start_here and using_jax, and added to smoke_tests.txt.
cpu_fast_modeling.py scripts become explicit-override examples with stale
claims removed; hpc/example_cpu_and_gpu.py uses auto; stale speed prose
points to the guide. Notebooks and catalogues regenerated.

Part of #688 (likelihood-lifecycle phase 5F).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 7799932 into main Nov 25, 2026
8 checks passed
@Jammy2211
Jammy2211 deleted the feature/likelihood-lifecycle-p5f1-workspace branch November 25, 2026 20:14
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