Skip to content

Commit 0fdb43d

Browse files
authored
Final singlefile checkpoint saves one folder up (#127)
* Final singlefile checkpoint saves one folder up Signed-off-by: Davis Wertheimer <davis.wertheimer@ibm.com> * save file under new pth subfolder Signed-off-by: Davis Wertheimer <davis.wertheimer@ibm.com> * Repath for easier consumption/conversion Signed-off-by: Davis Wertheimer <davis.wertheimer@ibm.com> --------- Signed-off-by: Davis Wertheimer <davis.wertheimer@ibm.com>
1 parent 0e47e93 commit 0fdb43d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

fms_fsdp/utils/checkpointing_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,9 @@ def save_single_file(
324324
):
325325
# Note: metadata kwargs cannot contain any of:
326326
# (step, model)
327-
save_name = os.path.join(self.ckp_path, "step_" + str(step) + "_ckp.pth")
327+
pth_path = os.path.join(self.ckp_path[:-12], "pth", "step_" + str(step))
328+
os.makedirs(pth_path, exist_ok=True)
329+
save_name = os.path.join(pth_path, "consolidated.00.pth")
328330
save_time = time.time()
329331
with FSDP.state_dict_type(
330332
model,

0 commit comments

Comments
 (0)