Skip to content

Commit

Permalink
[NeMo-UX] log val loss (#9814) (#9831)
Browse files Browse the repository at this point in the history
Signed-off-by: ashors1 <[email protected]>
Co-authored-by: Anna Shors <[email protected]>
  • Loading branch information
2 people authored and monica-sekoyan committed Oct 11, 2024
1 parent 5632801 commit 97a1c0f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nemo/lightning/pytorch/strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,9 @@ def validation_step(self, dataloader_iter, *args: Any, **kwargs: Any) -> STEP_OU
kwargs = self._update_step_kwargs(dataloader_iter, kwargs, "validation")

with self.precision_plugin.val_step_context(): # TODO: Do we need this?
return self.model(dataloader_iter, forward_only=True, *args, **kwargs)
out = self.model(dataloader_iter, forward_only=True, *args, **kwargs)
self.lightning_module.log('val_loss', out, rank_zero_only=True, batch_size=1)
return out

@override
def test_step(self, dataloader_iter, *args: Any, **kwargs: Any) -> STEP_OUTPUT:
Expand Down

0 comments on commit 97a1c0f

Please sign in to comment.