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
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,12 @@ def __init__(self):
super().__init__()
self.ckpt_time = 0.0

def on_train_start(self, trainer, pl_module):
# Initialize timer at training start to avoid AttributeError when resuming mid-epoch
# (where on_train_epoch_start is skipped).
self.start_time = time.perf_counter()
self.ckpt_time = 0.0
Comment thread
zhixiangli marked this conversation as resolved.

def on_train_epoch_start(self, trainer, pl_module):
# Start timer at the beginning of the epoch to capture the first batch's data loading time
self.start_time = time.perf_counter()
Expand Down
Loading