Skip to content

Commit f232b93

Browse files
committed
add benchmark metadata
1 parent 38394bb commit f232b93

File tree

8 files changed

+376
-49
lines changed

8 files changed

+376
-49
lines changed

devops/scripts/benchmarks/benches/base.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import os
77
import shutil
88
from pathlib import Path
9-
from utils.result import Result
9+
from utils.result import BenchmarkMetadata, Result
1010
from options import options
1111
from utils.utils import download, run
1212
import urllib.request
@@ -78,6 +78,9 @@ def download(
7878
def name(self):
7979
raise NotImplementedError()
8080

81+
def description(self):
82+
return "No description provided."
83+
8184
def lower_is_better(self):
8285
return True
8386

@@ -96,6 +99,23 @@ def stddev_threshold(self):
9699
def get_suite_name(self) -> str:
97100
return self.suite.name()
98101

102+
def result_names(self) -> list[str]:
103+
return [self.name()]
104+
105+
def notes(self) -> str:
106+
return None
107+
108+
def unstable(self) -> str:
109+
return None
110+
111+
def get_metadata(self) -> BenchmarkMetadata:
112+
return BenchmarkMetadata(
113+
type='benchmark',
114+
description=self.description(),
115+
notes=self.notes(),
116+
unstable=self.unstable(),
117+
)
118+
99119

100120
class Suite:
101121
def benchmarks(self) -> list[Benchmark]:
@@ -106,3 +126,6 @@ def name(self) -> str:
106126

107127
def setup(self):
108128
return
129+
130+
def additionalMetadata(self) -> dict[str, BenchmarkMetadata]:
131+
return {}

devops/scripts/benchmarks/benches/compute.py

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import io
99
from utils.utils import run, git_clone, create_build_path
1010
from .base import Benchmark, Suite
11-
from utils.result import Result
11+
from utils.result import BenchmarkMetadata, Result
1212
from options import options
1313
from enum import Enum
1414

@@ -54,6 +54,23 @@ def setup(self):
5454

5555
self.built = True
5656

57+
def additionalMetadata(self) -> dict[str, BenchmarkMetadata]:
58+
return {
59+
"SubmitKernel" : BenchmarkMetadata(
60+
type="group",
61+
description="Measures CPU time overhead of submitting kernels through different APIs.",
62+
notes="Each layer builds on top of the previous layer, adding functionality and overhead. "
63+
"The first layer is the Level Zero API, the second is the Unified Runtime API, and the third is the SYCL API. "
64+
"The UR v2 adapter noticeably reduces UR layer overhead, also improving SYCL performance."
65+
"Work is ongoing to reduce the overhead of the SYCL API",
66+
),
67+
"SinKernelGraph" : BenchmarkMetadata(
68+
type="group",
69+
unstable="This benchmark combines both eager and graph execution, and may not be representative of real use cases.",
70+
),
71+
}
72+
73+
5774
def benchmarks(self) -> list[Benchmark]:
5875
if options.sycl is None:
5976
return []
@@ -106,14 +123,7 @@ def benchmarks(self) -> list[Benchmark]:
106123
SubmitKernelUR(self, 1, 0),
107124
SubmitKernelUR(self, 1, 1),
108125
MemcpyExecute(self, 400, 1, 102400, 10, 1, 1, 1),
109-
MemcpyExecute(self, 100, 8, 102400, 10, 1, 1, 1),
110-
MemcpyExecute(self, 400, 8, 1024, 1000, 1, 1, 1),
111-
MemcpyExecute(self, 10, 16, 1024, 10000, 1, 1, 1),
112126
MemcpyExecute(self, 400, 1, 102400, 10, 0, 1, 1),
113-
MemcpyExecute(self, 100, 8, 102400, 10, 0, 1, 1),
114-
MemcpyExecute(self, 400, 8, 1024, 1000, 0, 1, 1),
115-
MemcpyExecute(self, 10, 16, 1024, 10000, 0, 1, 1),
116-
MemcpyExecute(self, 4096, 1, 1024, 10, 0, 1, 0),
117127
MemcpyExecute(self, 4096, 4, 1024, 10, 0, 1, 0),
118128
GraphApiSinKernelGraph(self, RUNTIMES.UR, 0, 5),
119129
GraphApiSinKernelGraph(self, RUNTIMES.UR, 1, 5),
@@ -540,6 +550,9 @@ def description(self) -> str:
540550
def name(self):
541551
return f"graph_api_benchmark_{self.runtime.value} SinKernelGraph graphs:{self.withGraphs}, numKernels:{self.numKernels}"
542552

553+
def unstable(self) -> str:
554+
return "This benchmark combines both eager and graph execution, and may not be representative of real use cases."
555+
543556
def bin_args(self) -> list[str]:
544557
return [
545558
"--iterations=10000",

devops/scripts/benchmarks/benches/test.py

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import random
77
from utils.utils import git_clone
88
from .base import Benchmark, Suite
9-
from utils.result import Result
9+
from utils.result import BenchmarkMetadata, Result
1010
from utils.utils import run, create_build_path
1111
from options import options
1212
import os
@@ -24,33 +24,49 @@ def name(self) -> str:
2424

2525
def benchmarks(self) -> list[Benchmark]:
2626
bench_configs = [
27-
("Memory Bandwidth", 2000, 200, "Foo Group"),
28-
("Latency", 100, 20, "Bar Group"),
29-
("Throughput", 1500, 150, "Foo Group"),
30-
("FLOPS", 3000, 300, "Foo Group"),
31-
("Cache Miss Rate", 250, 25, "Bar Group"),
27+
("Memory Bandwidth", 2000, 200, "Foo Group", None, None),
28+
("Latency", 100, 20, "Bar Group", "A Latency test note!", None),
29+
("Throughput", 1500, 150, "Foo Group", None, None),
30+
("FLOPS", 3000, 300, "Foo Group", None, "Unstable FLOPS test!"),
31+
("Cache Miss Rate", 250, 25, "Bar Group", "Test Note", "And another note!"),
3232
]
3333

3434
result = []
35-
for base_name, base_value, base_diff, group in bench_configs:
35+
for base_name, base_value, base_diff, group, notes, unstable in bench_configs:
3636
for variant in range(6):
3737
value_multiplier = 1.0 + (variant * 0.2)
3838
name = f"{base_name} {variant+1}"
3939
value = base_value * value_multiplier
4040
diff = base_diff * value_multiplier
4141

42-
result.append(TestBench(self, name, value, diff, group))
42+
result.append(TestBench(self, name, value, diff, group, notes, unstable))
4343

4444
return result
4545

46+
def additionalMetadata(self) -> dict[str, BenchmarkMetadata]:
47+
return {
48+
"Foo Group" : BenchmarkMetadata(
49+
type="group",
50+
description="This is a test benchmark for Foo Group.",
51+
notes="This is a test note for Foo Group.",
52+
),
53+
"Bar Group" : BenchmarkMetadata(
54+
type="group",
55+
description="This is a test benchmark for Bar Group.",
56+
unstable="This is an unstable note for Bar Group.",
57+
),
58+
}
59+
4660

4761
class TestBench(Benchmark):
48-
def __init__(self, suite, name, value, diff, group=""):
62+
def __init__(self, suite, name, value, diff, group="", notes=None, unstable=None):
4963
super().__init__("", suite)
5064
self.bname = name
5165
self.value = value
5266
self.diff = diff
5367
self.group = group
68+
self.notes_text = notes
69+
self.unstable_text = unstable
5470

5571
def name(self):
5672
return self.bname
@@ -64,6 +80,12 @@ def setup(self):
6480
def description(self) -> str:
6581
return f"This is a test benchmark for {self.bname}."
6682

83+
def notes(self) -> str:
84+
return self.notes_text
85+
86+
def unstable(self) -> str:
87+
return self.unstable_text
88+
6789
def run(self, env_vars) -> list[Result]:
6890
random_value = self.value + random.uniform(-1 * (self.diff), self.diff)
6991
return [

devops/scripts/benchmarks/html/index.html

Lines changed: 117 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,98 @@
171171
.extra-info-entry em {
172172
color: #555;
173173
}
174-
</style>
174+
.display-options-container {
175+
text-align: center;
176+
margin-bottom: 24px;
177+
padding: 16px;
178+
background: #e9ecef;
179+
border-radius: 8px;
180+
}
181+
.display-options-container label {
182+
margin: 0 12px;
183+
cursor: pointer;
184+
}
185+
.display-options-container input {
186+
margin-right: 8px;
187+
}
188+
.benchmark-note {
189+
background-color: #cfe2ff;
190+
color: #084298;
191+
padding: 10px;
192+
margin-bottom: 10px;
193+
border-radius: 5px;
194+
border-left: 4px solid #084298;
195+
}
196+
.benchmark-unstable {
197+
background-color: #f8d7da;
198+
color: #842029;
199+
padding: 10px;
200+
margin-bottom: 10px;
201+
border-radius: 5px;
202+
border-left: 4px solid #842029;
203+
}
204+
.note-text {
205+
color: #084298;
206+
}
207+
.unstable-warning {
208+
color: #842029;
209+
font-weight: bold;
210+
}
211+
.unstable-text {
212+
color: #842029;
213+
}
214+
.options-container {
215+
margin-bottom: 24px;
216+
background: #e9ecef;
217+
border-radius: 8px;
218+
overflow: hidden;
219+
}
220+
.options-container summary {
221+
padding: 12px 16px;
222+
font-weight: 500;
223+
cursor: pointer;
224+
background: #dee2e6;
225+
user-select: none;
226+
}
227+
.options-container summary:hover {
228+
background: #ced4da;
229+
}
230+
.options-content {
231+
padding: 16px;
232+
display: flex;
233+
flex-wrap: wrap;
234+
gap: 24px;
235+
}
236+
.filter-section {
237+
flex: 1;
238+
min-width: 300px;
239+
}
240+
.filter-section h3 {
241+
margin-top: 0;
242+
margin-bottom: 12px;
243+
font-size: 18px;
244+
font-weight: 500;
245+
text-align: left;
246+
}
247+
#suite-filters {
248+
display: flex;
249+
flex-wrap: wrap;
250+
gap: 8px;
251+
}
252+
.display-options {
253+
display: flex;
254+
flex-direction: column;
255+
gap: 8px;
256+
}
257+
.display-options label {
258+
display: flex;
259+
align-items: center;
260+
cursor: pointer;
261+
}
262+
.display-options input {
263+
margin-right: 8px;
264+
}
265+
</style>
175266
</head>
176267
<body>
177268
<div class="container">
@@ -182,16 +273,38 @@ <h1>Benchmark Results</h1>
182273
<div class="filter-container">
183274
<input type="text" id="bench-filter" placeholder="Regex...">
184275
</div>
185-
<div class="suite-filter-container" id="suite-filters">
186-
<!-- Suite checkboxes will be generated by JavaScript -->
187-
</div>
188276
<div class="run-selector">
189277
<select id="run-select">
190278
<option value="">Select a run to compare...</option>
191279
</select>
192280
<button onclick="addSelectedRun()">Add</button>
193281
<div id="selected-runs" class="selected-runs"></div>
194282
</div>
283+
<details class="options-container">
284+
<summary>Options</summary>
285+
<div class="options-content">
286+
<div class="filter-section">
287+
<h3>Suites</h3>
288+
<div id="suite-filters">
289+
<!-- Suite checkboxes will be generated by JavaScript -->
290+
</div>
291+
</div>
292+
293+
<div class="filter-section">
294+
<h3>Display Options</h3>
295+
<div class="display-options">
296+
<label>
297+
<input type="checkbox" id="show-notes" checked>
298+
Director's commentary
299+
</label>
300+
<label>
301+
<input type="checkbox" id="show-unstable">
302+
Show 'it works on my machine' scenarios
303+
</label>
304+
</div>
305+
</div>
306+
</div>
307+
</details>
195308
<details class="timeseries" open>
196309
<summary>Historical Results</summary>
197310
<div class="charts"></div>

0 commit comments

Comments
 (0)