Skip to content

Commit

Permalink
added sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenghh04 committed Feb 21, 2025
1 parent aafa316 commit d695c60
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dlio_benchmark/checkpointing/pytorch_checkpointing.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ def save_state(self, suffix, state, fsync = False):
@dlp.log
def load_state(self, suffix, state):
name = self.get_name(suffix)
state = dict() # clear up
state = torch.load(name)
logging.debug(f"checkpoint state loaded: {state}")
assert(len(state.keys())>0)

@dlp.log
def save_checkpoint(self, epoch, step_number):
Expand Down
3 changes: 3 additions & 0 deletions dlio_benchmark/checkpointing/tf_checkpointing.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ def save_state(self, suffix, state, fsync = False):
@dlp.log
def load_state(self, suffix, state):
name = self.get_name(suffix)
state = dict() # clear up
state = tf.train.load_checkpoint(name)
logging.debug(f"checkpoint state loaded: {state}")
assert(len(state.keys)!=0)

@dlp.log
def save_checkpoint(self, epoch, step_number):
Expand Down

0 comments on commit d695c60

Please sign in to comment.