Skip to content

Commit

Permalink
missing or (#2574)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvpatel2000 authored Oct 2, 2023
1 parent cd01419 commit 6375740
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer/algorithms/seq_length_warmup/seq_length_warmup.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def _activate_model(self, state: State, logger: Logger) -> None:
if state.auto_microbatching and _is_cuda_oom(e):
log.debug((f"Rank {dist.get_global_rank()} OOM'd."))
found_cuda_oom = 1
elif state.auto_microbatching and 'cuda' in str(e).lower() or 'c10' in str(e).lower():
elif state.auto_microbatching and ('cuda' in str(e).lower() or 'c10' in str(e).lower()):
raise ValueError(
textwrap.dedent(
'Encountered non-addressable cuda error while using auto microbatching. '
Expand Down
4 changes: 2 additions & 2 deletions composer/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2250,7 +2250,7 @@ def _train_batch(self, use_grad_scaling: bool) -> Dict[str, torch.Tensor]:
if self.state.auto_microbatching and _is_cuda_oom(e):
log.debug((f"Rank {dist.get_global_rank()} OOM'd."))
found_cuda_oom = 1
elif self.state.auto_microbatching and 'cuda' in str(e).lower() or 'c10' in str(e).lower():
elif self.state.auto_microbatching and ('cuda' in str(e).lower() or 'c10' in str(e).lower()):
raise RuntimeError(
textwrap.dedent(
'Encountered non-addressable cuda error while using auto microbatching. '
Expand Down Expand Up @@ -2922,7 +2922,7 @@ def _eval_loop(
if evaluator.auto_microbatching and _is_cuda_oom(e):
log.debug((f"Rank {dist.get_global_rank()} OOM'd."))
found_cuda_oom = 1
elif self.state.auto_microbatching and 'cuda' in str(e).lower() or 'c10' in str(e).lower():
elif self.state.auto_microbatching and ('cuda' in str(e).lower() or 'c10' in str(e).lower()):
raise ValueError(
textwrap.dedent(
'Encountered non-addressable cuda error while using auto microbatching. '
Expand Down

0 comments on commit 6375740

Please sign in to comment.