Skip to content

Move NNX state reconstruction and Linen conversion helpers to train_state_nnx.py.#4374

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_944118451
Open

Move NNX state reconstruction and Linen conversion helpers to train_state_nnx.py.#4374
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_944118451

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Move NNX state reconstruction and Linen conversion helpers to train_state_nnx.py.

This change refactors the MaxText checkpointing logic by moving helper functions for NNX state reconstruction and Linen checkpoint format conversion from checkpointing.py to train_state_nnx.py. The affected functions include default_for_sds, populate_pure_dict_from_partial, and rebuild_nnx_with_values. Corresponding unit tests have also been expanded in train_state_nnx_test.py.

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@copybara-service copybara-service Bot force-pushed the test_944118451 branch 2 times, most recently from 640e027 to 19cb8ec Compare July 8, 2026 07:15
…tate_nnx.py.

This change refactors the MaxText checkpointing logic by moving helper functions for NNX state reconstruction and Linen checkpoint format conversion from `checkpointing.py` to `train_state_nnx.py`. The affected functions include `default_for_sds`, `populate_pure_dict_from_partial`, and `rebuild_nnx_with_values`. Corresponding unit tests have also been expanded in `train_state_nnx_test.py`.

PiperOrigin-RevId: 944118451
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant