Skip to content

Commit 28a7ef1

Browse files
author
gongenlei
authored
fix sharding save bug (#4220)
1 parent 6dc4f55 commit 28a7ef1

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
@@ -1295,6 +1295,7 @@ def _save_checkpoint(self, model, metrics=None):
12951295
self.save_model(output_dir)
12961296

12971297
if self.sharding is not None:
1298+
dist.barrier()
12981299
if self.dp_group.rank == 0:
12991300
paddle.save(
13001301
self.optimizer.state_dict(),

0 commit comments

Comments
 (0)