Skip to content

Commit

Permalink
Fix training loop
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbenayoun committed Feb 6, 2025
1 parent 34d59f4 commit f0bc82e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions optimum/neuron/trainers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,11 @@ def _inner_training_loop(
if is_torch_xla_available():
xm.mark_step()
break
# We also need to break out of the nested loop
if self.control.should_epoch_stop or self.control.should_training_stop:
if is_torch_xla_available():
xm.mark_step()
break
if step < 0:
if is_main_worker():
logger.warning(
Expand Down

0 comments on commit f0bc82e

Please sign in to comment.