Skip to content
This repository was archived by the owner on Nov 1, 2024. It is now read-only.

Commit 35bab2c

Browse files
committed
create symlink for different checkpoint names
1 parent 79785e4 commit 35bab2c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

metaseq/checkpoint_utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ def save_checkpoint(
9797
async_callback_fn=async_callback_fn if save_to_NFS else None,
9898
)
9999

100+
if len(checkpoints) > 1:
101+
# Create symlink between identical checkpoints (differing in naming for epoch/update/last).
102+
for other_checkpoint in checkpoints[1:]:
103+
assert PathManager.symlink(
104+
checkpoints[0], other_checkpoint, overwrite=True
105+
), f"Failed to symlink {checkpoints[0]} to {other_checkpoint}"
106+
100107
write_timer.stop()
101108
logger.info(
102109
f"Saved checkpoint {checkpoints[0]} (epoch {epoch} @ {updates} updates) "

0 commit comments

Comments
 (0)