Skip to content

Commit 0271be6

Browse files
Merge pull request #307 from KernelTuner/simulation-process-metrics
Recalculate metrics for each configuration in simulation runner
2 parents 80d5a2b + 9424a82 commit 0271be6

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
@@ -7,6 +7,7 @@
77
from kernel_tuner import util
88
from kernel_tuner.runners.runner import Runner
99

10+
1011
_SimulationDevice = namedtuple("_SimulationDevice", ["max_threads", "env", "quiet"])
1112

1213

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

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

0 commit comments

Comments
 (0)