Skip to content

Commit

Permalink
[BugFix] shutil.rmtree ignore_errors for shared disks between train n…
Browse files Browse the repository at this point in the history
…odes PaddlePaddle#8117 (PaddlePaddle#8123)

[BugFix] shutil.rmtree ignore_errors for shared disks between train nodes. PaddlePaddle#8117
  • Loading branch information
ZHUI authored Mar 14, 2024
1 parent bde3317 commit 0a8c0f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion paddlenlp/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2225,7 +2225,8 @@ def _rotate_checkpoints(self, use_mtime=False, output_dir=None) -> None:
checkpoints_to_be_deleted = checkpoints_sorted[:number_of_checkpoints_to_delete]
for checkpoint in checkpoints_to_be_deleted:
logger.info(f"Deleting older checkpoint [{checkpoint}] due to args.save_total_limit")
shutil.rmtree(checkpoint)
# ignore_errors for shared disks between train nodes.
shutil.rmtree(checkpoint, ignore_errors=True)

def _save(self, output_dir: Optional[str] = None, state_dict=None, merge_tensor_parallel=False):
output_dir = output_dir if output_dir is not None else self.args.output_dir
Expand Down

0 comments on commit 0a8c0f9

Please sign in to comment.