Skip to content

Commit

Permalink
Show warning only if train dl state is not in the snapshot (#613)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #613

Subj

Reviewed By: galrotem

Differential Revision: D51074005

fbshipit-source-id: ecfb5640ab7255cb7aa993313cfc55e283aad97f
  • Loading branch information
fnz authored and facebook-github-bot committed Nov 7, 2023
1 parent e8e15e3 commit 206f58a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions torchtnt/framework/callbacks/torchsnapshot_saver.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,11 @@ def restore(
if _TRAIN_DL_STATE_KEY in key:
app_state[_TRAIN_DL_STATE_KEY] = train_dataloader
break
rank_zero_warn(
"train_dataloader was passed to `restore` but no train dataloader exists in the Snapshot"
)

if _TRAIN_DL_STATE_KEY not in app_state:
rank_zero_warn(
"train_dataloader was passed to `restore` but no train dataloader exists in the Snapshot"
)

knob_options = knob_options or KnobOptions()
with _override_knobs(knob_options):
Expand Down

0 comments on commit 206f58a

Please sign in to comment.