Skip to content

Commit 5c5ff1a

Browse files
committed
Added special runtime exception in case all tuning budget is exceeded in startup / search space construction
1 parent 7dc9b63 commit 5c5ff1a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel_tuner/util.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ def check_stop_criterion(to):
195195
if "max_fevals" in to and len(to.unique_results) >= to.max_fevals:
196196
raise StopCriterionReached("max_fevals reached")
197197
if "time_limit" in to and (((time.perf_counter() - to.start_time) + (to.simulated_time * 1e-3) + to.startup_time) > to.time_limit):
198+
if to.startup_time > to.time_limit:
199+
raise RuntimeError(f"Time budget of {to.time_limit} seconds was already exceeded during startup ({to.startup_time} seconds).")
198200
raise StopCriterionReached("time limit exceeded")
199201

200202

0 commit comments

Comments
 (0)