Skip to content

Commit

Permalink
bug fixer (#8314)
Browse files Browse the repository at this point in the history
  • Loading branch information
FeixLiu authored Apr 24, 2024
1 parent bc91dc6 commit eaca5b2
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 @@ -1013,6 +1013,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 eaca5b2

Please sign in to comment.