Skip to content

Commit

Permalink
Fix UTs which were broken due to additional observability warnings (#862
Browse files Browse the repository at this point in the history
)

Summary:
Pull Request resolved: #862

 Fix UTs which were broken due to additional  observability warnings. DCP test should only validate the first warning in the list of warnings.

Reviewed By: galrotem

Differential Revision: D59684986

fbshipit-source-id: fa0eccc2f0a85e84c518cd15b4dfa09e34bb78ad
  • Loading branch information
saumishr authored and facebook-github-bot committed Jul 12, 2024
1 parent 60059ef commit 53c6f91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions tests/framework/callbacks/test_dcp_saver.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,8 @@ def test_save_restore_dataloader_state(self) -> None:
# load_state_dict is not called again on dataloader because there is no dataloader in manifest
self.assertEqual(stateful_dataloader.load_state_dict_call_count, 1)
self.assertEqual(
log.output,
[
"WARNING:torchtnt.utils.rank_zero_log:train_dataloader was passed to `restore` but no train dataloader exists in the Snapshot"
],
log.output[0],
"WARNING:torchtnt.utils.rank_zero_log:train_dataloader was passed to `restore` but no train dataloader exists in the Snapshot",
)

def test_restore_from_latest(self) -> None:
Expand Down
6 changes: 2 additions & 4 deletions tests/framework/callbacks/test_torchsnapshot_saver.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,8 @@ def test_save_restore_dataloader_state(self) -> None:
# load_state_dict is not called again on dataloader because there is no dataloader in manifest
self.assertEqual(stateful_dataloader.load_state_dict_call_count, 1)
self.assertEqual(
log.output,
[
"WARNING:torchtnt.utils.rank_zero_log:train_dataloader was passed to `restore` but no train dataloader exists in the Snapshot"
],
log.output[0],
"WARNING:torchtnt.utils.rank_zero_log:train_dataloader was passed to `restore` but no train dataloader exists in the Snapshot",
)

def test_restore_from_latest(self) -> None:
Expand Down

0 comments on commit 53c6f91

Please sign in to comment.