Skip to content

Commit

Permalink
fix delay optimizer creation for non-fp8 cases
Browse files Browse the repository at this point in the history
  • Loading branch information
winglian committed Dec 8, 2024
1 parent c8c8dff commit b7621f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/transformers/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2251,7 +2251,8 @@ def _inner_training_loop(
else:
debug_overflow = DebugUnderflowOverflow(self.model) # noqa

delay_optimizer_creation = is_sagemaker_mp_enabled() or self.is_fsdp_xla_enabled
delay_optimizer_creation = (is_sagemaker_mp_enabled() or self.is_fsdp_xla_enabled
or (self.is_fsdp_enabled and not args.fp8))

# We need to reset the scheduler, as its parameters may be different on subsequent calls
if self._created_lr_scheduler:
Expand Down

0 comments on commit b7621f7

Please sign in to comment.