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
feat: NNLS solver knobs via Settings (nnls_solver_tol / nnls_max_iter), default off (#369)
Rework of the parked d8a1c84: the knobs move from general.yaml config keys
to per-fit Settings attributes (defaults None = jaxnnls's own tolerance
formula and 50-iteration cap — behaviour identical when unset). The vendored
autoarray/util/jax_nnls.py driver is unchanged: reuses all jaxnnls building
blocks + the relaxed-KKT custom-vjp backward; defaults validated bit-identical
to upstream in solutions and gradients on real production systems.
Measured on the real HST pixelization+MGE systems (PyAutoArray#369):
Settings(nnls_solver_tol=1e-6) saves ~15-20% of solve time with rel
delta-objective 3.8e-13 (delta log-evidence ~1e-8); nnls_max_iter also caps
the vmap worst-case lane. Full ledger: autolens_profiling
results/notes/nnls_solver_ledger.md.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QgtjXWS2iJegXMTDU4GHth
Copy file name to clipboardExpand all lines: autoarray/config/general.yaml
-2Lines changed: 0 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,6 @@ inversion:
8
8
use_border_relocator: false # If True, by default a pixelization's border is used to relocate all pixels outside its border to the border.
9
9
nnls_jacobi_preconditioning: true # If True (default), the curvature matrix passed to jaxnnls.solve_nnls_primal is Jacobi-preconditioned (D Q D y = D q, x = D y). Fixes NaN backward-pass gradients on ill-conditioned Q and roughly halves forward solve time. Set False to restore the raw unpreconditioned solve.
10
10
nnls_target_kappa: 1.0e-11# Central-path relaxation parameter passed to jaxnnls.solve_nnls_primal. Larger values smooth the relaxed-KKT backward pass and prevent NaN gradients on ill-conditioned Q; smaller values tighten the primal solve. Verified finite gradients across all MGE/rectangular/delaunay pipelines (imaging + interferometer) with scale invariance over 5 orders of magnitude in noise. jaxnnls's own default (1e-3) is too aggressive for the backward pass.
11
-
nnls_solver_tol: null # Convergence tolerance (infinity-norm KKT residual) of the JAX NNLS interior-point solve. null reproduces jaxnnls's own tolerance min(n * eps * 5e3, 1e-2) ~ 1.7e-9 at n=1500 fp64. Each solver iteration is a fresh dense Cholesky of the (n, n) system, so looser tolerances buy real speed: 1e-6 saves ~15-20% of solve time with a log-evidence shift of order 1e-8 (PyAutoArray#369).
12
-
nnls_max_iter: 50# Iteration cap of the JAX NNLS interior-point solve (jaxnnls hard-codes 50; production HST pixelization+MGE systems converge in ~19-21 iterations). Under vmap the solve runs until the slowest lane in the batch converges, so this also caps the worst-case batched cost.
13
11
reconstruction_vmax_factor: 0.5# Plots of an Inversion's reconstruction use the reconstructed data's bright value multiplied by this factor.
0 commit comments