Skip to content

Commit

Permalink
Fix model saving
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbenayoun committed Jul 12, 2023
1 parent 4402d91 commit 7d0e1c2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions optimum/neuron/distributed/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ def save_model_checkpoint_as_sharded(
if get_data_parallel_rank() == 0 and get_tensor_model_parallel_rank() == 0:
if output_path.is_dir():
shutil.rmtree(output_path, ignore_errors=True)
output_path.mkdir()
xm.rendezvous("waiting before saving")
parallel_layers.save(state_dict, output_path.as_posix())

Expand Down

0 comments on commit 7d0e1c2

Please sign in to comment.