Repository navigation
feat: runtime estimator, runtime_estimates.yaml and memory cap hook (5E-3) - #888
Merged
Merged
Conversation
…ok (5E-3) Ships autolens/config/runtime_estimates.yaml (v2, from the autolens_profiling exporter), a cached schema-checked loader, the ported autolens_inference wall model, al.RuntimeEstimate / al.estimate_runtime and al.Setup. Lens analyses implement runtime_estimate() (the Estimate: line PyAutoFit logs after the Parallel: banner) and resources_per_eval() (5D's memory cap). Rows are matched by decision_id + setup_id and nearest instrument size, otherwise a band; labels say Nautilus heuristic / uncalibrated / no estimate. Closes #887 (likelihood-lifecycle phase 5E-3). 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
Likelihood-lifecycle phase 5E-3, the third of three PRs under #887. This adds the PyAutoLens runtime estimator. A lens fit with a compute setup now prints an honest
Estimate:line after PyAutoFit'sParallel:banner (via the 5E-2 hook), giving ms per evaluation, expected evaluations (the Nautilus heuristic), parallel efficiency and wall time on this hardware. The same data makes 5D'snumber_of_cores="auto"memory cap live, throughresources_per_eval().Depends on PyAutoLabs/PyAutoFit#1796 (5E-2). The end-to-end test calls
resolve_fit_parallel(..., model=...), and this repo's CI clones PyAutoFitmain, so merge #1796 first and then re-run this PR's CI.API Changes
autolens/config/runtime_estimates.yaml: schema v2, generated by autolens_profilingexport_runtime_estimates.py --copy-to(autolens_profiling#535); do not edit by hand.al.estimate_runtime(dataset, model, search, setup, number_of_cores=1)→al.RuntimeEstimate(or None without a setup or row), with.line().al.Setup(theautoarrayclass, exported).runtime_estimate(search, model, number_of_cores)andresources_per_eval(). Both are None without a setup and never raise.See full details below.
Test Plan
pytest test_autolens: 1154 passed, 1 xfailed. Newtest_runtime_estimate.py(31 tests) covers:resolve_fit_parallel, logging oneEstimate:line;pyauto-heart readiness --dev --repos PyAutoLens): GREEN. Non-blocking shown reasons: manifest drift; test run status unknown; no release rehearsal for current source; release push credential check 55 h old.pyauto-heart smoke --affected-by PyAutoLens --jobs 3: 4/4 workspaces PASS (autolens, autolens_test, euclid, howtolens), run against this branch (with the 5E-2 PyAutoFit branch) via PYAUTO_ROOTFull API Changes (for automation & release notes)
Added
autolens/config/runtime_estimates.yaml(schema runtime-estimates v2).autolens.analysis.wall_model: a port of autolens_inferencescripts/misc/wall/model.py(Nautilus eval law, floor, startup, numba η, overrides), with provenance.autolens.analysis.runtime_estimate:load_runtime_estimates,RuntimeEstimate,estimate_runtime,candidate_rows,match_rows,dataset_size_from,resources_per_eval_from,AnalysisRuntimeEstimate(mixin).al.Setup,al.RuntimeEstimate,al.estimate_runtime.runtime_estimate()/resources_per_eval()onAnalysisDataset(imaging, interferometer),AnalysisPointandAnalysisWeak.Changed
AnalysisDataset,AnalysisPointandAnalysisWeakgain theAnalysisRuntimeEstimatemixin, first in their bases. Itsresolve_setupremembers the model, then defers to the existing setup resolution.Migration
setup=, nothing changes.Design calls (human-approved):
decision_id+setup_id, then the nearest instrument by size (masked pixels for imaging, visibilities for interferometer, log distance). A min–max band is reported when there's no size or a tie.al.estimate_runtime(...)rather than a method onSetup.Example line:
Estimate: ~697 ms/eval (hst cell) · Nautilus n_live=150 ≈ 1.0e4 evals (heuristic) · η=0.55 on 8 cores · ~30 min on this hardware.Caveats:
NUMBA_PARAMETRIC_FACTORis ported but unused).peak_rss_gb: null, so a fit matched to it gets no memory cap.Generated by the PyAutoLabs agent workflow.
🤖 Generated with Claude Code