Skip to content

Commit 686ec2c

Browse files
committed
Added startup overhead to StopCriterion
1 parent 94ce705 commit 686ec2c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

kernel_tuner/interface.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,7 @@ def tune_kernel(
684684

685685
# call the strategy to execute the tuning process
686686
tuning_options["start_time"] = perf_counter()
687+
tuning_options["startup_time"] = perf_counter() - start_overhead_time
687688
results = strategy.tune(searchspace, runner, tuning_options)
688689
env = runner.get_environment(tuning_options)
689690

kernel_tuner/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def check_stop_criterion(to):
194194
"""Checks if max_fevals is reached or time limit is exceeded."""
195195
if "max_fevals" in to and len(to.unique_results) >= to.max_fevals:
196196
raise StopCriterionReached("max_fevals reached")
197-
if "time_limit" in to and (((time.perf_counter() - to.start_time) + (to.simulated_time * 1e-3)) > to.time_limit):
197+
if "time_limit" in to and (((time.perf_counter() - to.start_time) + (to.simulated_time * 1e-3) + to.startup_time) > to.time_limit):
198198
raise StopCriterionReached("time limit exceeded")
199199

200200

0 commit comments

Comments
 (0)