Skip to content

Commit

Permalink
Increase mimimum number of warmup runs to 2
Browse files Browse the repository at this point in the history
The JIT will typically need two warmup runs to do profiling and
optimization.
  • Loading branch information
t-vi committed May 22, 2021
1 parent dc8bc6b commit 3efe0a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch/utils/benchmark/utils/timer.py
Expand Up @@ -259,7 +259,7 @@ def timeit(self, number: int = 1000000) -> common.Measurement:
"""
with common.set_torch_threads(self._task_spec.num_threads):
# Warmup
self._timer.timeit(number=max(int(number // 100), 1))
self._timer.timeit(number=max(int(number // 100), 2))

return common.Measurement(
number_per_run=number,
Expand Down

0 comments on commit 3efe0a2

Please sign in to comment.