Repository navigation
Make the ParamState-write error actionable and document the rule (#187) - #189
Merged
Merged
Conversation
Name every ParamState written inside the online step by its model path, state that the rule also covers parameters not trained online, and point at the two supported patterns (update trained weights outside the step from etrace_grad; hold locally-updated weights in a non-param state such as brainstate.LongTermState). Add the rule to the limitations page.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merged
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.
Fixes #187.
Summary
_model_that_not_allow_param_assign(_compiler/module_info.py) now lists everyParamStatewritten inside the traced step by its model path. A state not reachable from the model falls back to its repr. The message says the rule applies whether or not the parameter is trained online, and gives the two supported patterns:etrace_gradreturns;brainstate.LongTermState, which is then not trained online.docs/advanced/limitations.ipynb: new section "Parameters Are Constant Within a Step" (failing + working example, stored output) and a matching Summary item.docs/specs/2026-10-24-issue-187-param-write-message.md.Behaviour is unchanged: the same
NotSupportedErroris raised in the same cases.Before / after (issue repro)
Tests
module_info_test.py::TestParamStateWriteError:('layer', 'w_local');LongTermStatevariant compiles.Full suite (CPU, remote): 2911 passed, 1 skipped.
maingives 2906 passed. The only collection error is a missinghypothesisin the remote env, and it also occurs onmain.