Skip to content

Commit

Permalink
Rename method of OutputObserver from process_kernel_output to `pr…
Browse files Browse the repository at this point in the history
…ocess_output`
  • Loading branch information
stijnh committed Oct 2, 2023
1 parent afc8c7f commit 754fc45
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions kernel_tuner/accuracy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import logging
import re

from .observers import OutputObserver
from kernel_tuner.observers import OutputObserver


class Tunable(UserDict):
Expand Down Expand Up @@ -283,7 +283,7 @@ def __init__(self, metric=None, key="error", *, atol=1e-8):
self.metric = metric
self.result = None

def process_kernel_output(self, answers, outputs):
def process_output(self, answers, outputs):
errors = []

for answer, output in zip(answers, outputs):
Expand Down
3 changes: 1 addition & 2 deletions kernel_tuner/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import re
import numpy as np

from kernel_tuner.accuracy import Tunable

try:
import cupy as cp
Expand Down Expand Up @@ -423,7 +422,7 @@ def check_kernel_output(self, func, gpu_args, instance, answer, atol, verify, ve

# Call the output observers
for obs in self.output_observers:
obs.process_kernel_output(answer, result_host)
obs.process_output(answer, result_host)

# There are three scenarios:
# - if there is a custom verify function, call that.
Expand Down
2 changes: 1 addition & 1 deletion kernel_tuner/observers/observer.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class OutputObserver(BenchmarkObserver):
"""Observer that can verify or measure something about the output produced by a kernel."""

@abstractmethod
def process_kernel_output(self, answer, output):
def process_output(self, answer, output):
"""method will be called once before benchmarking of a single kernel configuration. The arguments
provided are the `answer` as passed `tune_kernel` and the `output` produced by the kernel
"""
Expand Down
2 changes: 1 addition & 1 deletion kernel_tuner/observers/powersensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def after_finish(self):
self.results["ps_energy"].append(ps_measured_e)
if "ps_power" in self.observables:
ps_measured_t = (
end_state.time_at_read - self.begin_state.time_at_read
end_state.time_at_read - self.begin_state.time_at_read
) # seconds
self.results["ps_power"].append(ps_measured_e / ps_measured_t) # Watt

Expand Down
1 change: 1 addition & 0 deletions kernel_tuner/runners/sequential.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def run(self, parameter_space, tuning_options):
warmup_time = 1e3 * (perf_counter() - warmup_time)

result = self.dev.compile_and_benchmark(self.kernel_source, self.gpu_args, params, self.kernel_options, tuning_options)

params.update(result)

if tuning_options.objective in result and isinstance(result[tuning_options.objective], ErrorConfig):
Expand Down

0 comments on commit 754fc45

Please sign in to comment.