Skip to content

Commit 8a6589c

Browse files
authored
bug fixer (#8314) (#8317)
1 parent 52338f0 commit 8a6589c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

paddlenlp/trainer/trainer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,7 @@ def train(
973973
self.timers and self.timers("optimizer-step").start()
974974

975975
if self.args.gradient_accumulation_steps > 1 and self._enable_delay_scale_loss():
976+
paddle.device.synchronize()
976977
for p in model._layers.parameters():
977978
with paddle.no_grad():
978979
if hasattr(p, "main_grad") and p.main_grad is not None:

0 commit comments

Comments
 (0)