Repository navigation
Closed
Description
Bolt-on to the JAX profiling / inference programme (results/notes/inference/PROGRAMME.md; PyAutoMind epic jax-inference-profiling). Filed 2026-08-21 from the CPU-likelihood speed campaign (#151), at user direction.
Problem
After the 2026-08-20/21 CPU speed round, the Delaunay + Hilbert AdaptImage fiducial is fast on CPU (euclid 4.92 → 1.34 s/eval via PyAutoArray#453 + #455) — but it is the expert configuration. The default mesh a new user gets is RectangularAdaptDensity, whose kernel-CDF transform makes it the slowest thing on a CPU:
- euclid: transform = 1.66 s = 55% of the eval; hst: 27 s = 89% of a 21.6–30 s eval.
- The exact windowed numba kernel (PR in flight) buys 3.0–3.4×, but the transform is irreducibly O(N²) erf for exact values — hst stays ~8 s/eval, and the O(N²) scaling gets worse at JWST resolution.
- A config-gated interpolated-CDF forward (K=8192 knots) was measured at Δlnℒ ≤ +4e-3 absolute / ≤ 2e-3 differential (passes the rtol 1e-6 pins) and reaches ~18–55× on the step — but it is an approximation and a defaults/science decision.
- On GPU this is a non-issue (full hst eval 57.6 ms on A100) — the hazard is specifically CPU users on the default configuration, i.e. exactly the audience of
cpu_fast_modeling.pyand every new user without a GPU.
Options (decision needed, then a programme slice)
- Make Delaunay first-class: it is now the fast CPU mesh, but requires the adapt-image machinery (Hilbert image mesh from a prior fit) — first-class means either a sensible no-adapt entry path (e.g. Overlay image mesh) or chained-fit defaults that hide the setup from new users.
- A simpler/faster Rectangular default: plain uniform Rectangular (no kernel-CDF adaption) as the CPU default, and/or ship the interpolated-CDF mode as the CPU default with the exact transform config-gated instead (inverting the gate).
- Something else — e.g. backend-dependent defaults (adaptive Rectangular on JAX/GPU where it is free; a cheaper mesh on
use_jax=False), or resolution-dependent guardrails that warn when the O(N²) transform will dominate.
Evidence base
- Kernel-CDF cost + exact-numba prototype + interp-accuracy measurements: PyAutoMind
draft/feature/autoarray/numba_cpu_likelihood_kernel_cdf_fast_path.md(prototype header, 2026-08-21) and this repo's perf: numba CPU sparse-operator likelihood profiling infrastructure #151 findings trail. - Delaunay CPU campaign results: perf: numba CPU sparse-operator likelihood profiling infrastructure #151, PyAutoArray#452–chore: lifecycle follow-ups — point-source output path, cluster source-plane decomposition, coverage/guard tests (#454) #455.
Suggested handling: add a backlog row to PROGRAMME.md and adjudicate the default-mesh decision at the next programme gate — the engineering slices (whichever option wins) are all small once the decision is made.
Metadata
Metadata
Assignees
Labels
No labels
Activity
Merge pull request #154 from PyAutoLabs/docs/programme-phase14-defaul…
Jammy2211 commentedon Aug 21, 2026
Phase 14 default-mesh decision: adjudicated 2026-08-21 — option (2), in the "resurrect the empirical rank-CDF transform" form (task PyAutoLabs/PyAutoArray#461).
The rectangular adaptive mesh family is now split in PyAutoArray (PR PyAutoLabs/PyAutoArray#462, merged):
RectangularBilinearAdaptDensity/RectangularBilinearAdaptImage— the empirical rank-CDF transform (sort + cumsum, O(N log N), no hyperparameters), recovered from the pre-audit: timing-noise phase 1 — inventory of timing assertions and gates with PASS/FAIL/INCONCLUSIVE semantics (#362) #402 implementation. This becomes the workspace default (PRs autolens_workspace#495, autogalaxy_workspace#221), eliminating the O(M_sub × N_data) erf sum that is 55% (euclid) to 89% (hst) of the numba CPU eval.RectangularRTUAdaptDensity/RectangularRTUAdaptImage— pure renames of the kernel-CDF classes; the advanced option for GPU, JAX gradient samplers, and the interferometer sparse path (where Bilinear is permanently gradient-dead — no over-sampling exists). Docs state: gradient users setover_sample_size_pixelization >= 4(imaging) or use RTU.What this leaves for this issue / the PROGRAMME:
pixelization_numbalikelihood-runtime cells is still to be recorded here.results/notes/inference/PROGRAMME.mdPhase 14 (status table row + §Phase 14) should be flipped from "awaiting adjudication" to decided when this repo's in-flight branch (feat: numba CPU sparse-operator likelihood profiling (runtime, breakdown, multiprocessing scaling) #152) lands — not pushed now to avoid crossing that PR.Generated by Claude Code
programme: Phase 14 adjudicated + shipped — Bilinear default, RTU adv…
Jammy2211 commentedon Sep 4, 2026
Closing — decided and shipped, and the programme it was filed under is retired.
The default CPU mesh question was adjudicated and shipped on 2026-08-21 as programme Phase 14: Bilinear (rank-CDF) is the default, RTU (kernel-CDF) is the advanced option, and both meshes are explicit in the cells via
--rect-mesh(PR #155, PyAutoArray#461/#462). See the "Phase 14 default CPU mesh decision" row ofresults/notes/inference/PROGRAMME.md.The one item this issue left open — a versioned Bilinear-vs-RTU measurement — is not being carried in a tracker: the
jax-inference-profilingprogramme is retired as of PyAutoCortex R-20260904-01 (PR #217), and the successor epicgradient-slam-baselineruns a single fixed mesh (RectangularRTUAdaptImage(39,39)) and does not ask the default-mesh question. If the measurement is wanted, it is a fresh, scoped task rather than a survivor of this one.