Skip to content

Commit 568a96a

Browse files
authored
Benchmark updates for faster run and more reliable results (#2164)
1 parent 6f5c5ae commit 568a96a

File tree

9 files changed

+187
-131
lines changed

9 files changed

+187
-131
lines changed

scripts/benchmarks/benches/SobelFilter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ def parse_output(self, stdout: str) -> float:
3535
if match:
3636
return round(float(match.group(1)) * 1000, 3)
3737
else:
38-
raise ValueError("Failed to parse benchmark output.")
38+
raise ValueError("{self.__class__.__name__}: Failed to parse benchmark output.")
3939

scripts/benchmarks/benches/bitcracker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ def parse_output(self, stdout: str) -> float:
3131
if match:
3232
return float(match.group(1))
3333
else:
34-
raise ValueError("Failed to parse benchmark output.")
34+
raise ValueError("{self.__class__.__name__}: Failed to parse benchmark output.")

scripts/benchmarks/benches/compute.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def setup(self):
2020
if self.built:
2121
return
2222

23-
repo_path = git_clone(self.directory, "compute-benchmarks-repo", "https://github.com/intel/compute-benchmarks.git", "f6882552215736f90295244046fcb6e17fe53e83")
23+
repo_path = git_clone(self.directory, "compute-benchmarks-repo", "https://github.com/intel/compute-benchmarks.git", "08c41bb8bc1762ad53c6194df6d36bfcceff4aa2")
2424
build_path = create_build_path(self.directory, 'compute-benchmarks-build')
2525

2626
configure_command = [
@@ -34,12 +34,13 @@ def setup(self):
3434
f"-DBUILD_UR=ON",
3535
f"-Dunified-runtime_DIR={options.ur_dir}/lib/cmake/unified-runtime",
3636
]
37-
run(configure_command, add_sycl=True)
3837

38+
print(f"{self.__class__.__name__}: Run {configure_command}")
39+
run(configure_command, add_sycl=True)
40+
print(f"{self.__class__.__name__}: Run cmake --build {build_path} -j")
3941
run(f"cmake --build {build_path} -j", add_sycl=True)
4042

4143
self.built = True
42-
self.bins = os.path.join(build_path, 'bin')
4344

4445
class ComputeBenchmark(Benchmark):
4546
def __init__(self, bench, name, test):
@@ -58,8 +59,8 @@ def unit(self):
5859
return "μs"
5960

6061
def setup(self):
62+
self.benchmark_bin = os.path.join(self.bench.directory, 'compute-benchmarks-build', 'bin', self.bench_name)
6163
self.bench.setup()
62-
self.benchmark_bin = os.path.join(self.bench.bins, self.bench_name)
6364

6465
def run(self, env_vars) -> list[Result]:
6566
command = [

scripts/benchmarks/benches/hashtable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ def parse_output(self, stdout: str) -> float:
3131
if match:
3232
return float(match.group(1))
3333
else:
34-
raise ValueError("Failed to parse keys per second from benchmark output.")
34+
raise ValueError("{self.__class__.__name__}: Failed to parse keys per second from benchmark output.")

scripts/benchmarks/benches/quicksilver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ def parse_output(self, stdout: str) -> float:
4242
if match:
4343
return float(match.group(1))
4444
else:
45-
raise ValueError("Failed to parse benchmark output.")
45+
raise ValueError("{self.__class__.__name__}: Failed to parse benchmark output.")

scripts/benchmarks/benches/result.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class Result:
1414
command: str
1515
env: str
1616
stdout: str
17+
passed: bool = True
1718
unit: str = ""
1819
name: str = ""
1920
lower_is_better: bool = True

0 commit comments

Comments
 (0)