fix(nnx): fix gpt3 paxml checkpoint conversion state map and layout#4555
Draft
hsuan-lun-chiang wants to merge 1 commit into
Draft
fix(nnx): fix gpt3 paxml checkpoint conversion state map and layout#4555hsuan-lun-chiang wants to merge 1 commit into
hsuan-lun-chiang wants to merge 1 commit into
Conversation
hsuan-lun-chiang
force-pushed
the
fix/nnx-gpt3-ckpt
branch
from
July 21, 2026 09:40
7ff3bbd to
7b0e353
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
hsuan-lun-chiang
force-pushed
the
fix/nnx-gpt3-ckpt
branch
from
July 22, 2026 08:01
f39c200 to
878827e
Compare
hsuan-lun-chiang
force-pushed
the
fix/nnx-gpt3-ckpt
branch
2 times, most recently
from
July 23, 2026 09:52
ebe8aba to
bbcc873
Compare
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.
Description
Fix the Errors in b/535891456:
When executing
convert_gpt3_ckpt_from_paxml.py, verification failed with:Cause: Recent NNX updates added dynamic RNG state (such as AQT count) into model variables, which are not present in PaxML checkpoints.
Fix: Bypassed
['rngs']key paths during state key verification and array loading map, and added support for non-indexedopt_statepaths.When restoring the converted checkpoint in
train.py, loading failed with:Cause:
convert_gpt3_ckpt_from_paxml.pywas saving the rawTrainStateNNXstructure directly instead of callingtrain_state_nnx.to_checkpoint_dict(converted_state)to format it into the standard Linen-interchangeable checkpoint layout.Fix: Added
converted_state = train_state_nnx.to_checkpoint_dict(converted_state)prior to saving whencfg.pure_nnxis active.Test
Test with
convert_gpt3_ckpt_from_paxml.pyandtrain.pyas in the DAG.Logs
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.