Repository navigation
Conversation
…lar viz scripts Since PyAutoFit#1297, fit_for_visualization is an eager fit_from served by per-function JIT caches. The Likelihood Sanity block ran analysis_probe.fit_from() before the timing block, warming every cache, so the probe timed two warm calls and failed its speedup assertion. Move the probe ahead of the sanity block, correct the docstrings, and un-park both scripts from config/build/no_run.yaml. Closes #375 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tangular viz scripts With the JIT-cache probe fixed, the scripts reached their Visualization Sanity perf guard, a fixed 100 ms budget on the warm zero_contour call. Warm calls log zero recompiles (jax_log_compiles), but take 108-203 ms on a loaded machine. Use the hardware-independent cold/warm ratio the point_source and interferometer siblings adopted in #148. Refs #375 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.
Closes #375. Un-parks
imaging/visualization/modeling_visualization_{delaunay,rectangular}_jit.What re-traced between calls
Nothing in the fit. The JIT cache is hit. The probe was timing two warm calls:
Analysis.fit_for_visualizationis an eagerfit_fromserved by per-function JAX JIT caches, not onejax.jit(self.fit_from)._assert_likelihood_sanity("JAX", analysis_probe, …), which callsanalysis_probe.fit_from(...), before the timing block. That warmed every per-function cache, so the timed "compile" call was already warm. On main: rectangular 0.450s → 0.389s, delaunay 0.808s → 0.720s, failing the 0.5x assertion.The producer that fixed it is the probe ordering in these two scripts (commit 093abd6). The timing block now runs on a cold
analysis_probe, ahead of the Likelihood Sanity block. The module docstrings no longer describe the oldjax.jit(self.fit_from)design. The MGE sibling's docstring got the same correction; it has no sanity block and stays parked as SLOW.What does re-trace, separately (not fixed here).
jax_log_compileson warm calls shows a few eagerlaxcontrol-flow primitives recompiling on every call, because their closures are rebuilt each call:jit(while)in the positive-only solver: PyAutoArrayutil/jax_active_set.pycond_fun/body_fun,util/jax_nnls.pyconverged_check.pure_callback,scanand the walk'swhile:inversion/mesh/interpolator/delaunay.py.That costs about 0.2s of a 0.48s rectangular warm call and about 0.5s of a 0.9s Delaunay one. It does not affect the assertion, and it lives in PyAutoArray, outside this task's repos. It is filed as the follow-up draft
draft/bug/autoarray/eager_lax_control_flow_recompiles_per_visualization_call.md.Second fix: the zero_contour perf guard was hidden behind the first failure
With the probe fixed, both scripts reached their Visualization Sanity perf guard, a fixed
_warm_dt < 0.1(100 ms). On this laptop it failed at 108 ms / 128 ms.jax_log_compilesshows zero recompiles on warmzero_contourcalls, so the time is honest execution on a loaded machine, not PyAutoGalaxy#433 cache-busting. Commit 04dce54 switches the guard to the hardware-independent cold/warm ratio the point_source and interferometer siblings already use (#148).Decisions taken (decide-and-flag; please confirm at /prm)
Witness
Wall times are from a loaded single-core sandbox with other shift workers running. The 2026-07-30 CI sweep timed these scripts at 36–52s.
The NEEDS_FIX lines for both scripts are removed from
config/build/no_run.yaml, and no other config entry excludes them.Checks
imaging/jax_likelihood/delaunay.py: PASS (57.3s).🤖 Generated with Claude Code