Skip to content

Commit f168301

Browse files
committed
chore(pt): use more warmup steps
The SiLUT activation function is using JIT compile. Hence, we require more warm-up steps to avoid JIT compiling time interfering the profiling result. This commit also adds logging info of the saved profiling results.
1 parent 43e0288 commit f168301

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

deepmd/pt/train/training.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ def run(self) -> None:
658658
writer = SummaryWriter(log_dir=self.tensorboard_log_dir)
659659
if self.enable_profiler or self.profiling:
660660
prof = torch.profiler.profile(
661-
schedule=torch.profiler.schedule(wait=1, warmup=1, active=3, repeat=1),
661+
schedule=torch.profiler.schedule(wait=1, warmup=15, active=3, repeat=1),
662662
on_trace_ready=torch.profiler.tensorboard_trace_handler(
663663
self.tensorboard_log_dir
664664
)
@@ -1032,6 +1032,9 @@ def log_loss_valid(_task_key="Default"):
10321032
writer.close()
10331033
if self.enable_profiler or self.profiling:
10341034
prof.stop()
1035+
log.info(
1036+
f"The profiling trace have been saved under {self.tensorboard_log_dir}"
1037+
)
10351038
if self.profiling:
10361039
prof.export_chrome_trace(self.profiling_file)
10371040
log.info(

0 commit comments

Comments
 (0)