Repository navigation
feat(autofit): MultiStartProdigy + optax.contrib + per-start vmapped state - #1398
Merged
Merged
Conversation
…ltiStartProdigy Promote the learning-rate-free rule support from autolens_workspace_developer#101 into af.AbstractMultiStartGradient (Phase 1 of the multi-start gradient v2 promotion; restart-on-death resurrection is Phase 2): - resolve the optax rule from optax then optax.contrib (unlocks prodigy et al.) - per-start jax.vmap optimizer init/update, so the lr-free rules' global scalar estimates no longer couple across starts (elementwise Adam family unchanged) - optax.apply_if_finite in-step guard (new max_consecutive_nan knob) with the value= branch for momo-family rules - add af.MultiStartProdigy (learning-rate-free; == tuned Adam on the MGE cell) - bump optax pin to >=0.2.5 Numpy-only unit tests; JAX MGE validation follows in autofit_workspace_test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jul 20, 2026
Collaborator
Author
|
Linked workspace PR (JAX validation for |
This was referenced Jul 21, 2026
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
Phase 1 of the multi-start gradient v2 promotion (autolens_workspace_developer#101). Promotes learning-rate-free /
optax.contribrule support intoaf.AbstractMultiStartGradient:optaxthenoptax.contrib, unlockingprodigyand the other lr-free / experimental rules.init/updateare nowjax.vmaped per start. The learning-rate-free rules estimate a global scalar step scale from whole-tree norms (Prodigy'sd, DoG'smax_dist, Mechanic's scale, MoMo's Polyak step); the old stacked-(n_starts, ndim)state silently coupled every start into one shared estimate. Elementwise rules (Adam/ADABelief/Lion) are numerically unaffected.optax.apply_if_finitein-step guard (newmax_consecutive_nanknob, default 8) — a non-finite step zeroes that start's update rather than NaN-poisoning the population, with thevalue=branch for MoMo-family rules (optax >= 0.2.5 forwards it).af.MultiStartProdigy— learning-rate-free; on the parametric MGE cell it reaches Adam's optimum with no learning rate (the headline Remove use of sym link from Emcee, Dynesty. #101 result).The restart-on-death resurrection recovery layer is deferred to Phase 2 (it builds on this PR's per-start vmapped state).
API Changes
af.MultiStartProdigy— a learning-rate-free multi-start gradient MAP search (optax.contrib.prodigy).max_consecutive_nan: int = 8constructor argument onaf.AbstractMultiStartGradient(inherited by allMultiStart*searches) — theapply_if_finiteper-start rejected-step budget.MultiStartAdam/MultiStartADABelief/MultiStartLionnow use per-start vmapped optimizer state and anapply_if_finiteguard. For these elementwise rules this is numerically identical on finite trajectories — results are unchanged.optaxpin raised tooptax>=0.2.5(forapply_if_finite'svalue=forwarding).See full details below.
Test Plan
pytest test_autofit/non_linear/search/mle/— 7 passed (Prodigy defaults / lr-free / dict round-trip,max_consecutive_nanknob).MultiStartAdam,MultiStartProdigy, andMultiStartProdigy(batch_size=4)each recover the truth basin; Adam and Prodigy land on the identical optimum with no learning rate on Prodigy.ApplyIfFiniteStateopt_state dill round-trips exactly and a step continues on the reloaded state./ship_workspace): permanentautofit_workspace_test/scripts/searches/MultiStartProdigy.pyJAX validation script.Full API Changes (for automation & release notes)
Added
af.MultiStartProdigy(...)— learning-rate-free multi-start gradient MAP search usingoptax.contrib.prodigy;optax_method = "prodigy",_default_learning_rate = None.af.AbstractMultiStartGradient(..., max_consecutive_nan: int = 8, ...)— new constructor argument (inherited byMultiStartAdam/MultiStartADABelief/MultiStartLion/MultiStartProdigy); theoptax.apply_if_finiteper-start rejected-step budget. Serialised into_dict/from_dictand recorded insamples_info.Changed Behaviour
AbstractMultiStartGradient._fit— optimizer state moved from a single stackedinitto per-startjax.vmap(optimizer.init), and the update step is a per-startjax.vmapofoptimizer.update(with avalue=-forwarding branch for MoMo-family rules). The rule is wrapped inoptax.apply_if_finite. Numerically inert for the elementwise Adam family; enables lr-free rules to keep independent per-start scalar estimates.getattr(optax, method)tooptax→optax.contribfallback.Migration
MultiStartAdam/MultiStartADABelief/MultiStartLioncode is unchanged in behaviour and API (the new argument is optional). New capability is opt-in viaaf.MultiStartProdigy.Generated by the PyAutoLabs agent workflow.