Skip to content

Commit

Permalink
sycl-bench added & ascii bar chart (#2115)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszpn authored Sep 30, 2024
1 parent bcd9032 commit d9d24ec
Show file tree
Hide file tree
Showing 8 changed files with 595 additions and 94 deletions.
3 changes: 1 addition & 2 deletions scripts/benchmarks/benches/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import os
import shutil
from pathlib import Path
import subprocess # nosec B404
from .result import Result
from .options import options
from utils.utils import run
Expand Down Expand Up @@ -57,7 +56,7 @@ def lower_is_better(self):
def setup(self):
raise NotImplementedError()

def run(self, env_vars) -> Result:
def run(self, env_vars) -> list[Result]:
raise NotImplementedError()

def teardown(self):
Expand Down
4 changes: 2 additions & 2 deletions scripts/benchmarks/benches/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def setup(self):
self.bench.setup()
self.benchmark_bin = os.path.join(self.bench.bins, self.bench_name)

def run(self, env_vars) -> Result:
def run(self, env_vars) -> list[Result]:
command = [
f"{self.benchmark_bin}",
f"--test={self.test}",
Expand All @@ -78,7 +78,7 @@ def run(self, env_vars) -> Result:

result = self.run_bench(command, env_vars)
(label, mean) = self.parse_output(result)
return Result(label=label, value=mean, command=command, env=env_vars, stdout=result, lower_is_better=self.lower_is_better())
return [ Result(label=self.name(), value=mean, command=command, env=env_vars, stdout=result, lower_is_better=self.lower_is_better()) ]

def parse_output(self, output):
csv_file = io.StringIO(output)
Expand Down
2 changes: 1 addition & 1 deletion scripts/benchmarks/benches/quicksilver.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, vb: VelocityBench):
super().__init__("QuickSilver", "qs", vb)
self.data_path = os.path.join(vb.repo_path, "QuickSilver", "Examples", "AllScattering")

def run(self, env_vars) -> Result:
def run(self, env_vars) -> list[Result]:
# TODO: fix the crash in QuickSilver when UR_L0_USE_IMMEDIATE_COMMANDLISTS=0
if 'UR_L0_USE_IMMEDIATE_COMMANDLISTS' in env_vars and env_vars['UR_L0_USE_IMMEDIATE_COMMANDLISTS'] == '0':
return None
Expand Down
Loading

0 comments on commit d9d24ec

Please sign in to comment.