Skip to content

Commit a78d6b8

Browse files
Fix nebula in save_16bit_model issue (deepspeedai#3023)
Co-authored-by: Qinghuan Rao <qinghuanrao@microsoft.com>
1 parent 1286e37 commit a78d6b8

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

deepspeed/runtime/engine.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3534,9 +3534,15 @@ def save_16bit_model(self, save_dir, save_filename="pytorch_model.bin"):
35343534
else:
35353535
state_dict = self.module.state_dict()
35363536

3537+
tag = f"global_step{self.global_steps}"
3538+
tag = str(tag)
3539+
self.checkpoint_engine.create(tag)
3540+
35373541
if dist.get_rank() == 0:
35383542
self.checkpoint_engine.makedirs(save_dir, exist_ok=True)
3539-
logger.info(f"Saving model weights to {path}")
3543+
logger.info(f"Saving model weights to {path}, tag: {tag}")
35403544
self.checkpoint_engine.save(state_dict, path)
35413545

3546+
self.checkpoint_engine.commit(tag)
3547+
35423548
return True

0 commit comments

Comments
 (0)