[NNX] Delete Linen (12.1a): collapse dispatch in the core train loop and maxtext_utils - #4683
Draft
ecnal-cienet wants to merge 1 commit into
Draft
[NNX] Delete Linen (12.1a): collapse dispatch in the core train loop and maxtext_utils#4683ecnal-cienet wants to merge 1 commit into
ecnal-cienet wants to merge 1 commit into
Conversation
…ate setup and train loop The pure_nnx defaults are true, so the Linen branches in the pre-train state and train-loop path are dead. Collapse them: - train_utils.setup_train_loop: always build the abstract NNX model and a TrainStateNNX init_state_fn; drop the Linen model/TrainState branch and the Linen arms of the DiLoCo sharding and debug_sharding blocks. - maxtext_utils: get_functional_train_with_signature and get_functional_eval_with_signature drop the trailing rng in_sharding; load_compiled drops the example rng; get_abstract_state delegates to get_abstract_state_nnx. setup_initial_state is deliberately left alone. Its Linen branch is entangled with the checkpoint restore overlay, and the orbax v1 migration is touching that code; it is collapsed in a later change. Tests follow the same narrowing: the Linen-only cases in maxtext_utils_test, state_dtypes_test and the sharding_compare_test Linen-golden driver go away. test_deepseek4 is skipped rather than pinned to Linen, since nnx_decoders.py has no deepseek4 decoder_block branch yet.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
…ate setup and train loop
The pure_nnx defaults are true, so the Linen branches in the pre-train state and train-loop path are dead. Collapse them:
setup_initial_state is deliberately left alone. Its Linen branch is entangled with the checkpoint restore overlay, and the orbax v1 migration is touching that code; it is collapsed in a later change.
Tests follow the same narrowing: the Linen-only cases in maxtext_utils_test, state_dtypes_test and the sharding_compare_test Linen-golden driver go away. test_deepseek4 is skipped rather than pinned to Linen, since nnx_decoders.py has no deepseek4 decoder_block branch yet.
Description
Start with a short description of what the PR does and how this is a change from
the past.
The rest of the description includes relevant details and context, examples:
If the change fixes a bug or a Github issue, please include a link, e.g.,:
FIXES: b/123456
FIXES: #123456
You can also provide a comma-separated list. If you don't want to close a bug but
simply to reference it, use BUGS, e.g.:
BUGS: b/123456
Notice 1: Once all tests pass, the "pull ready" label will automatically be assigned.
This label is used for administrative purposes. Please do not add it manually.
Notice 2: For external contributions, our settings currently require an approval from a MaxText maintainer to trigger CI tests.
Tests
Please describe how you tested this change, and include any instructions and/or
commands to reproduce.
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.