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
The kernel-CDF forward transform of RectangularAdaptDensity dominates the numba CPU likelihood on the default Rectangular route: 1.66 s = 55% of a euclid eval, 27 s = 89% at hst (PyAutoLabs/autolens_profiling#151) — an O(M×N) blocked erf broadcast with ~126 MB per-block temporaries, rebuilt every evaluation (the traced grid moves with the mass model, so no cross-eval caching applies). Phase 3 of the CPU speed campaign, per the PyAutoMind kernel-CDF prompt.
Plan
Numba kernel _kernel_cdf_dim_windowed in inversion/mesh/interpolator/rectangular.py: per-dimension weighted kernel CDF over sorted points + weight prefix sums with a ±9-bandwidth saturation window (dropped tails < 1e-19 of the weight sum → values match the exact sum to ~1e-13).
The numpy branch of F_raw uses it; the blocked numpy implementation stays as the JAX branch and the differentiable reference. The module's "no sorts" differentiability guarantee is preserved — the sort is internal evaluation order on the gradient-free numpy path only.
Overview
The kernel-CDF forward transform of
RectangularAdaptDensitydominates the numba CPU likelihood on the default Rectangular route: 1.66 s = 55% of a euclid eval, 27 s = 89% at hst (PyAutoLabs/autolens_profiling#151) — an O(M×N) blocked erf broadcast with ~126 MB per-block temporaries, rebuilt every evaluation (the traced grid moves with the mass model, so no cross-eval caching applies). Phase 3 of the CPU speed campaign, per the PyAutoMind kernel-CDF prompt.Plan
_kernel_cdf_dim_windowedininversion/mesh/interpolator/rectangular.py: per-dimension weighted kernel CDF over sorted points + weight prefix sums with a ±9-bandwidth saturation window (dropped tails < 1e-19 of the weight sum → values match the exact sum to ~1e-13).F_rawuses it; the blocked numpy implementation stays as the JAX branch and the differentiable reference. The module's "no sorts" differentiability guarantee is preserved — the sort is internal evaluation order on the gradient-free numpy path only.Results (4-core cloud container)
pixelization_numbapins pass at rtol 1e-6.test_autoarray/: 1036 passed (+2 dense-reference equivalence tests); same 3 pre-existing environmental pynufft failures.