Skip to content

Commit

Permalink
fix(checkpoint/components.py): fix lr scheduler resume step count (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
huangting4201 authored Oct 18, 2024
1 parent d0a19fb commit c3dfe0f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internlm/checkpoint/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,9 @@ def load_scheduler(ckpt_path: str, lr_scheduler, optimizer, train_state: TrainSt
)

lr_scheduler.load_state_dict(scheduler_states)
lr_scheduler.last_epoch = train_state.step_count + 1

# step_count have been updated before saving checkpoint.
lr_scheduler.last_epoch = train_state.step_count

# compatible with old code that only have one param group
if len(base_lrs) == 1:
Expand Down

0 comments on commit c3dfe0f

Please sign in to comment.