Skip to content

Commit

Permalink
add save comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hanwen-sun committed Oct 15, 2024
1 parent 128517c commit 7260beb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion torchacc/dist/state_dict_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def save_checkpoints(state_dict_list, shard_metadata_list, save_paths,
We use multiple thread to accelerate the saving progress, each thread
save one shard checkpoint.
"""
# save consolidate checkpoint
if not isinstance(state_dict_list, list):
torch.save(state_dict_list, save_paths)
return
Expand All @@ -196,7 +197,7 @@ def save_checkpoint(state_dict, shard_metadata, save_path, save_type):
torch.save(model, save_path)

threads = []

# save reshard checkpoints
for state_dict, shard_metadata, save_path in zip(state_dict_list,
shard_metadata_list,
save_paths):
Expand Down

0 comments on commit 7260beb

Please sign in to comment.