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
{{ message }}
Repository navigation
perf: windowed numba fast path for the RectangularAdaptDensity kernel-CDF transform #457
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.
Activity