Skip to content

Commit a6e6101

Browse files
committed
debug
1 parent 856cd66 commit a6e6101

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pytorch_lightning/loops/epoch/training_epoch_loop.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,13 @@ def advance(self, dataloader_iter: Iterator, **kwargs: Any) -> None:
110110
# TRAINING_STEP + TRAINING_STEP_END
111111
# ------------------------------------
112112
with self.trainer.profiler.profile("training_batch_to_device"):
113+
print("before run", self.iteration_count, torch.cuda.memory_allocated())
113114
batch = self.trainer.accelerator.batch_to_device(batch, dataloader_idx=self._dataloader_idx)
114115

115116
with self.trainer.profiler.profile("run_training_batch"):
116117
batch_output = self.batch_loop.run(batch, self.iteration_count, self._dataloader_idx)
117118
self.batches_seen += 1
119+
print("after run", self.iteration_count, torch.cuda.memory_allocated())
118120

119121
# when returning -1 from train_step, we end epoch early
120122
if batch_output.signal == -1:
@@ -150,6 +152,7 @@ def on_advance_end(self):
150152
Raises:
151153
StopIteration: if :attr:`done` evaluates to ``True`` to finish this epoch
152154
"""
155+
print("advance end", self.iteration_count, torch.cuda.memory_allocated())
153156
# -----------------------------------------
154157
# VALIDATE IF NEEDED + CHECKPOINT CALLBACK
155158
# -----------------------------------------

0 commit comments

Comments
 (0)