Repository navigation
feat: per-lane best (params, fom, step) preservation in MultiStartGradient - #1515
Merged
Merged
Conversation
…dient (#1514) Each lane's best figure-of-merit, physical position, and step index are now tracked in the _fit loop and persisted in search_internal (lane_best_params / lane_best_foms / lane_best_steps) alongside the existing global best and per-lane finals. Diagnostics only — the same never-gates rule as the NaN-lane counters. Needed by the inference programme's Phase 3 (per-start basin classification / p_hit measurement; finals are unreliable because a lane can leave its best basin late, die, or pin to a bound after its best step). - Capture is a pure-NumPy static helper (_lane_best_update), strict-< so ties keep the earliest best step, with a lazy gather so the device->host copy only happens on improving steps. Seed/restore use np.array copies — np.asarray of a device array is READ-ONLY and the update writes in place (caught by an end-to-end JAX run). - Resume restores the new keys defensively; legacy search_internal files re-seed from the restored finals rather than KeyError-ing. - A resurrected slot is a NEW start: its record resets (NaN params, inf fom) rather than conflating two starts' basins in one slot. - Tests: direct helper tests + _fit source-level wiring guards, per the suite's NumPy-only contract. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019s6eAYCjAvn7tRNetAFadP
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.
Closes #1514.
Inference-programme Phase 3 pre-req (Epic: jax-inference-profiling, CP-3 —
autolens_profiling/results/notes/inference/PROGRAMME.md§4/§7): per-start basin classification needs each lane's own best, not just its final position and the global best.What
_fitnow maintainslane_best_params(PHYSICAL, likebest_params),lane_best_foms, andlane_best_steps(index intofom_history, stable across resumes), persisted insearch_internal. Diagnostics only — never gates a redraw or a step (the NaN-lane-counter rule)._lane_best_update: strict<so ties keep the earliest best step ("steps after best" stays an honest waste measure); a lazygather_physicalcallable keeps the device→host copy off no-improvement steps; alive-masked foms mean dead lanes never update.search_internalfiles re-seed from the restored finals (inffoms) rather than KeyError-ing, same doctrine asalive_history.inffom, step stamped) rather than conflating two starts' basins in one slot.np.arraycopies:np.asarrayof a JAX device array is read-only and the update writes in place. This was caught by an end-to-end JAX validation run (quadratic objective, 6 starts), which then passed: every lane finite, global best == min over lane bests, best lane's params ==best_params.Tests
_lane_best_updatetests: improvement capture, untouched non-improved lanes, dead-lane immunity, tie handling, lazy improved-only gather, monotonicity across calls._fitsource-level wiring guards (capture call, persistence keys, defensive resume, resurrection reset), per the suite's NumPy-only contract — JAX behaviour validated by the e2e run above and downstream in autofit_workspace_test.No public-API change; the profiling repo reads
search_internaldirectly. Downstream (autolens_profiling CP-3 arms) consumes the new keys for per-lane basin classification.🤖 Generated with Claude Code
https://claude.ai/code/session_019s6eAYCjAvn7tRNetAFadP