Skip to content

Fix opt_state type mismatch when restoring checkpoints with Adam/LAMB optimizers - #105

Merged
copybara-service[bot] merged 1 commit into
google-deepmind:mainfrom
Qianruipku:hotfix2
Sep 17, 2025
Merged

Fix opt_state type mismatch when restoring checkpoints with Adam/LAMB optimizers#105
copybara-service[bot] merged 1 commit into
google-deepmind:mainfrom
Qianruipku:hotfix2

Conversation

@Qianruipku

Copy link
Copy Markdown
Contributor

When using Adam or LAMB optimizers with reset_if_nan=True, the opt_state loaded from checkpoint is a list but should be a tuple. This causes jax.lax.cond at train.py:315 to fail during training. Convert opt_state_ckpt to tuple when restoring from checkpoint to ensure type consistency.

… optimizers

When using Adam or LAMB optimizers with reset_if_nan=True, the opt_state
loaded from checkpoint is a list but should be a tuple. This causes
jax.lax.cond at train.py:315 to fail during training. Convert opt_state_ckpt
to tuple when restoring from checkpoint to ensure type consistency.
@jsspencer jsspencer self-assigned this Aug 12, 2025
@jsspencer
jsspencer self-requested a review August 12, 2025 11:51
@jsspencer jsspencer removed their assignment Aug 12, 2025
@copybara-service
copybara-service Bot merged commit ce6b3c8 into google-deepmind:main Sep 17, 2025
3 of 4 checks passed
@Qianruipku
Qianruipku deleted the hotfix2 branch April 11, 2026 11:12
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.

2 participants