Skip to content

Commit

Permalink
bug fixer (#8314) (#8318)
Browse files Browse the repository at this point in the history
  • Loading branch information
FeixLiu authored Apr 24, 2024
1 parent 590cee9 commit 871070d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions paddlenlp/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,7 @@ def _inner_training_loop(
self.timers and self.timers("optimizer-step").start()

if self.args.gradient_accumulation_steps > 1 and self._enable_delay_scale_loss():
paddle.device.synchronize()
for p in model._layers.parameters():
with paddle.no_grad():
if hasattr(p, "main_grad") and p.main_grad is not None:
Expand Down

0 comments on commit 871070d

Please sign in to comment.