You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Research task (batch 2026-08-31-pm, member numba-vs-jax-sparse, --auto, effective level supervised = min(header safe, research cap)). The subhalo_validation end-to-end runs put the numba CPU path ~8x faster than the old code. The human asked whether the linear-algebra approach behind that speed is the same as the sparse-operator mode already implemented for JAX — and if not, whether the numba approach is amenable to GPU-JAX speed-up or rests on sparsity exploitation that suits it to CPU. Deliverable is a written verdict posted on this issue; no library changes.
Characterise the JAX sparse-operator mode: the FFT-backed matrix-free ImagingSparseOperator, batched F assembly, and the jaxnnls PDIP solve with its relaxed-KKT custom VJP.
Compare formulation: operator storage, curvature assembly, solve strategy — same normal-equations problem or different mathematics?
For each point of difference, assess GPU-JAX portability (batched/dense enough? data-dependent control flow? cross-evaluation state?) against the closed solver ledger (nnls_solver_ledger.md: PDIP/BPP/ADMM/warm-start already measured).
Verdict + recommendation: unify, port, or keep two deliberately different paths, with evidence.
Detailed implementation plan
Affected Repositories
PyAutoArray (primary — read-only; no changes)
Branch Survey
Repository
Current Branch
Dirty?
./PyAutoArray
main
clean (read-only)
Suggested branch: n/a — research verdict only, no code changes, no worktree.
Read the two operator realisations: inversion/inversion/imaging/inversion_imaging_util.py::ImagingSparseOperator (JAX, FFT matrix-free W = Hᵀ N⁻¹ H) vs inversion/inversion/imaging_numba/inversion_imaging_numba_util.py::psf_precision_operator_sparse_from + SparseLinAlgImagingNumba (numba, explicit per-pixel-pair preload); the dataset factories apply_sparse_operator / apply_sparse_operator_cpu and the inversion factory dispatch.
Ground the numbers against autolens_profiling/results/notes/nnls_warm_start_memo.md, nnls_warm_start_memo_matrix.md, nnls_solver_ledger.md and the breakdown JSONs — no re-profiling.
Pull Memory context: wiki/methods/concepts/autodiff-implicit-diff.md (gradients through the positive-only solve), wiki/methods/sources/linear-algebra.md (FNNLS lineage).
Write the verdict per the prompt's four questions as an issue comment; park for human review (judge-tier task — no decide-and-flag).
Key Files
autoarray/inversion/inversion/inversion_util.py — solver dispatch, both paths
Is the numba positive-only solve the same linear algebra as the JAX sparse-operator mode?
Type: research
Target: autoarray
Repos:
PyAutoArray
Themes:
numba-cpu
jax
Difficulty: medium
Autonomy: safe
Priority: normal
Status: formalised
Consequence: judge
Review-minutes: 20
Unattended: ready
Filed: 2026-08-31
Intake from the 2026-08-31-am batch review, prompted by the subhalo_validation
end-to-end runs (numba CPU path ~x8 faster than the old code end to end). Human,
verbatim:
"""
End to end runs are good in general, with numba speed up run times roughly x8
faster than old code, incredible. Do an intake to investigate if the linear algebra
approach taken for this is the same as the sparse operator mode alreasdy implemented
for JAX, and if it is not ask whether it is amenable to GPU JAX speed up or if there
is some sparsity exploitation that means this is suited to CPU.
"""
Deliverable is a written verdict (no library changes):
Compare against the sparse-operator mode already implemented for JAX: same
formulation (operator storage, curvature assembly, solve strategy) or different?
If different: is the numba approach amenable to a GPU-JAX port (batched/dense
enough, no data-dependent control flow), or does its speed rest on sparsity
exploitation / branchy active-set iteration that is intrinsically CPU-suited?
Verdict + recommendation: unify, port, or keep two deliberately different paths —
with the evidence for whichever it is.
Ground against the installed stack and the numba-cpu epic's memory/notes; do not
re-profile from scratch — the breakdown JSONs and nnls_warm_start_memo.md in
autolens_profiling already carry the numbers.
Overview
Research task (batch 2026-08-31-pm, member
numba-vs-jax-sparse,--auto, effective levelsupervised= min(headersafe, research cap)). The subhalo_validation end-to-end runs put the numba CPU path ~8x faster than the old code. The human asked whether the linear-algebra approach behind that speed is the same as the sparse-operator mode already implemented for JAX — and if not, whether the numba approach is amenable to GPU-JAX speed-up or rests on sparsity exploitation that suits it to CPU. Deliverable is a written verdict posted on this issue; no library changes.Plan
SparseLinAlgImagingNumbaPSF-precision preload, the sparse F contraction (perf: numba CPU curvature matrix F at HST resolution (phase 1: split + FFT mapper×func block) #505/perf(numba): HST curvature matrix phase 2 — mapper×mapper block + MGE operated matrix #507 two-stage accumulator), and the fnnls active-set solve with the cross-evaluation warm-start memo (perf: cut positive-only solve active-set iterations — warm-start memo + diagnostics (numba CPU likelihood, phase 3a) #498/perf: warm-start the positive-only NNLS solve from the previous evaluation's passive set (#498) #501).ImagingSparseOperator, batched F assembly, and the jaxnnls PDIP solve with its relaxed-KKT custom VJP.nnls_solver_ledger.md: PDIP/BPP/ADMM/warm-start already measured).Detailed implementation plan
Affected Repositories
Branch Survey
Suggested branch: n/a — research verdict only, no code changes, no worktree.
Investigation Steps
autoarray/inversion/inversion/inversion_util.py::reconstruction_positive_only_from(xp dispatch: JAX →util/jax_nnls.py::solve_nnls_primalPDIP; NumPy →util/fnnls.py::fnnls_choleskyactive-set +inversion/inversion/nnls_memo.pywarm-start memo).inversion/inversion/imaging/inversion_imaging_util.py::ImagingSparseOperator(JAX, FFT matrix-free W = Hᵀ N⁻¹ H) vsinversion/inversion/imaging_numba/inversion_imaging_numba_util.py::psf_precision_operator_sparse_from+SparseLinAlgImagingNumba(numba, explicit per-pixel-pair preload); the dataset factoriesapply_sparse_operator/apply_sparse_operator_cpuand the inversion factory dispatch.ImagingSparseOperator.curvature_matrix_diag_from(COO scatter → batched FFT → segment_sum) vscurvature_matrix_via_sparse_operator_two_stage_from(perf(numba): HST curvature matrix phase 2 — mapper×mapper block + MGE operated matrix #507 sparse contraction over unique data→pix mappings).autolens_profiling/results/notes/nnls_warm_start_memo.md,nnls_warm_start_memo_matrix.md,nnls_solver_ledger.mdand the breakdown JSONs — no re-profiling.wiki/methods/concepts/autodiff-implicit-diff.md(gradients through the positive-only solve),wiki/methods/sources/linear-algebra.md(FNNLS lineage).Key Files
autoarray/inversion/inversion/inversion_util.py— solver dispatch, both pathsautoarray/util/fnnls.py,autoarray/util/cholesky_funcs.py,autoarray/inversion/inversion/nnls_memo.py— numba/NumPy active-set solveautoarray/util/jax_nnls.py— JAX PDIP driver with custom VJPautoarray/inversion/inversion/imaging/{sparse.py,inversion_imaging_util.py}— JAX sparse-operator modeautoarray/inversion/inversion/imaging_numba/{sparse.py,inversion_imaging_numba_util.py}— numba sparse-operator modeautoarray/inversion/inversion/factory.py,autoarray/dataset/imaging/dataset.py— mode selectionOriginal Prompt
Click to expand starting prompt
Is the numba positive-only solve the same linear algebra as the JAX sparse-operator mode?
Type: research
Target: autoarray
Repos:
Themes:
Difficulty: medium
Autonomy: safe
Priority: normal
Status: formalised
Consequence: judge
Review-minutes: 20
Unattended: ready
Filed: 2026-08-31
Intake from the 2026-08-31-am batch review, prompted by the subhalo_validation
end-to-end runs (numba CPU path ~x8 faster than the old code end to end). Human,
verbatim:
"""
faster than old code, incredible. Do an intake to investigate if the linear algebra
approach taken for this is the same as the sparse operator mode alreasdy implemented
for JAX, and if it is not ask whether it is amenable to GPU JAX speed up or if there
is some sparsity exploitation that means this is suited to CPU.
"""
Deliverable is a written verdict (no library changes):
(the NNLS warm-start/memo lineage — PyAutoArray perf: warm-start the positive-only NNLS solve from the previous evaluation's passive set (#498) #501, epic
numba-cpu-likelihood;curvature-matrix F work perf: numba CPU curvature matrix F at HST resolution (phase 1: split + FFT mapper×func block) #505/perf(numba): HST curvature matrix phase 2 — mapper×mapper block + MGE operated matrix #507; the 177 MB sparse operator per process).
formulation (operator storage, curvature assembly, solve strategy) or different?
enough, no data-dependent control flow), or does its speed rest on sparsity
exploitation / branchy active-set iteration that is intrinsically CPU-suited?
with the evidence for whichever it is.
Ground against the installed stack and the numba-cpu epic's memory/notes; do not
re-profile from scratch — the breakdown JSONs and
nnls_warm_start_memo.mdinautolens_profiling already carry the numbers.