Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,6 @@ def _train_batch(self, use_grad_scaling: bool):
else:
original_grad_accum = self.state.grad_accum
self.state.grad_accum = min(2 * self.state.grad_accum, device_batch_size)
self.logger.data_batch({'trainer/grad_accum': self.state.grad_accum})
log.info(('CUDA out of memory detected. Gradient Accumulation '
f'increased from {original_grad_accum} -> {self.state.grad_accum}, '
'and the batch will be retrained.'))
Expand All @@ -1681,7 +1680,8 @@ def _train_batch(self, use_grad_scaling: bool):
# back only to this newly raised error.
raise caught_timeout_error
else:
# Otherwise, return calculated loss
# Otherwise, log grad_accum and return calculated loss
self.logger.data_batch({'trainer/grad_accum': self.state.grad_accum})
return total_loss

def _train_microbatches(self, microbatches: Sequence[Batch], ddp_sync: bool = True):
Expand Down