Project-level shared fits on the fused JAX backend (v0.13.0) - #39
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a compiled fast path for project-level shared-parameter fits: when
Project.spec_fun_str == "fit_model_jax"and every file's model passes thecan_lower_2d+can_lower_jax_2dgates,Project.fit_2d()runs one fused,jitted JAX program over all files (per-file plan trace, static fit-window
slices, flattened + concatenated residuals) with an analytic joint Jacobian
via
jacfwdwired into lmfit'sDfun.spectra.pack_project_theta(combined-theta gather arrays) andeval_jax.make_project_evaluator_2d_jax/make_project_jacobian_2d_jax.fit_project_mcpif any file misses a gate orjax isn't installed — no mixed backends; the backend in use is reported in
the fit output.
static window slices, concatenated residual vector).
XLA compile stays sub-linear (< ~0.4 s at 8 files).
Tests
TestProjectFitJax: interpreter/JAX end-to-end parity, truth recovery,heterogeneous grids, fallback gating (non-lowerable file, jax missing).
-Wdocs build clean.Docs / release
docs/design/project-level-fits.mdupdated with implementationstatus and measured results;
supported_models.mdandroundtrip_test_matrix.mdupdated for the new backend axis.CHANGELOG.md0.13.0 entry; version bumped to 0.13.0. Tagv0.13.0aftermerge to trigger the PyPI release workflow.