Skip to content

Commit 9424a82

Browse files
committed
Recalculate metrics for each configuration in simulation runner
1 parent 2451e2d commit 9424a82

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

kernel_tuner/runners/simulation.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from kernel_tuner import util
77
from kernel_tuner.runners.runner import Runner
88

9+
910
_SimulationDevice = namedtuple("_SimulationDevice", ["max_threads", "env", "quiet"])
1011

1112

@@ -90,6 +91,11 @@ def run(self, parameter_space, tuning_options):
9091
if tuning_options.cache and x_int in tuning_options.cache:
9192
result = tuning_options.cache[x_int].copy()
9293

94+
# only compute metrics on configs that have not errored
95+
if tuning_options.metrics and not isinstance(result.get(tuning_options.objective), util.ErrorConfig):
96+
result = util.process_metrics(result, tuning_options.metrics)
97+
98+
9399
# Simulate behavior of sequential runner that when a configuration is
94100
# served from the cache by the sequential runner, the compile_time,
95101
# verification_time, and benchmark_time are set to 0.

0 commit comments

Comments
 (0)