Skip to content

Commit f39c200

Browse files
fix(nnx): convert NNX state to checkpoint dict layout before saving in gpt3 paxml conversion
1 parent 0a5066a commit f39c200

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/maxtext/checkpoint_conversion/standalone_scripts/convert_gpt3_ckpt_from_paxml.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@ def map_fn(key_path, value):
316316
max_utils.print_mem_stats("converted state finished")
317317

318318
step_value = int(converted_state.optimizer.step.value) if cfg.pure_nnx else converted_state.step
319+
if cfg.pure_nnx:
320+
converted_state = train_state_nnx.to_checkpoint_dict(converted_state)
319321
if checkpointing.save_checkpoint(checkpoint_manager, step_value, converted_state):
320322
max_logging.log(f"saved a checkpoint at step {step_value}")
321323
# Upon preemption, exit when and only when all ongoing saves are complete.

0 commit comments

Comments
 (0)