Repository navigation
Add uniform cold-start fallback for stateful models on file restarts - #2942
Open
copybara-service[bot] wants to merge 1 commit into
Open
copybara-service[bot] wants to merge 1 commit into
copybara-service[bot] wants to merge 1 commit into
Conversation
Replace strict `models.initial_state_from_datatree` restoration in `state_evaluation.evaluate_initial_state` with per-model restore-or-cold-start so any stateful model can be enabled, disabled, or reconfigured across a file restart without changing public V2 API signatures: - For each stateful model (sources, pedestal top-level/structure/formation, transport components, and edge state/outputs), restore saved state when `has_saved_state` is true and compatible; otherwise log a warning and cold-start from the plasma state at `t_restart`. - Treat saved state that is partly NaN padding (e.g. the pedestal node of a stitched file after a pedestal mode switch) as not saved, and never mark NaN edge boundary conditions read from a file as valid for core update. - Preserve restored states for explicit/previous-step models while keeping post-evaluation seeded states for cold-started models. - Delete the now-unused `Models`, `SourceModels`, `TransportModel`, and `GeometryModel` `initial_state_from_datatree` helpers. - Add unit and restart-toggle tests covering particle feedback, pedestal `martin_scaling` `include_dW_dt_in_P_SOL` and mode switches, edge `extended_lengyel`, NaN-padded saved state, and cold-start fallback warnings. PiperOrigin-RevId: 1020227701
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.
Add uniform cold-start fallback for stateful models on file restarts
Replace strict
models.initial_state_from_datatreerestoration instate_evaluation.evaluate_initial_statewith per-model restore-or-cold-start so any stateful model can be enabled, disabled, or reconfigured across a file restart without changing public V2 API signatures:has_saved_stateis true and compatible; otherwise log a warning and cold-start from the plasma state att_restart.Models,SourceModels,TransportModel, andGeometryModelinitial_state_from_datatreehelpers.martin_scalinginclude_dW_dt_in_P_SOLand mode switches, edgeextended_lengyel, NaN-padded saved state, and cold-start fallback warnings.