Skip to content

Commit 30cd308

Browse files
committed
apply formatting
1 parent f232b93 commit 30cd308

File tree

5 files changed

+32
-31
lines changed

5 files changed

+32
-31
lines changed

devops/scripts/benchmarks/benches/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def unstable(self) -> str:
110110

111111
def get_metadata(self) -> BenchmarkMetadata:
112112
return BenchmarkMetadata(
113-
type='benchmark',
113+
type="benchmark",
114114
description=self.description(),
115115
notes=self.notes(),
116116
unstable=self.unstable(),

devops/scripts/benchmarks/benches/compute.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,20 @@ def setup(self):
5656

5757
def additionalMetadata(self) -> dict[str, BenchmarkMetadata]:
5858
return {
59-
"SubmitKernel" : BenchmarkMetadata(
59+
"SubmitKernel": BenchmarkMetadata(
6060
type="group",
6161
description="Measures CPU time overhead of submitting kernels through different APIs.",
6262
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",
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",
6666
),
67-
"SinKernelGraph" : BenchmarkMetadata(
67+
"SinKernelGraph": BenchmarkMetadata(
6868
type="group",
6969
unstable="This benchmark combines both eager and graph execution, and may not be representative of real use cases.",
7070
),
7171
}
7272

73-
7473
def benchmarks(self) -> list[Benchmark]:
7574
if options.sycl is None:
7675
return []

devops/scripts/benchmarks/benches/test.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,20 @@ def benchmarks(self) -> list[Benchmark]:
3939
value = base_value * value_multiplier
4040
diff = base_diff * value_multiplier
4141

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

4446
return result
4547

4648
def additionalMetadata(self) -> dict[str, BenchmarkMetadata]:
4749
return {
48-
"Foo Group" : BenchmarkMetadata(
50+
"Foo Group": BenchmarkMetadata(
4951
type="group",
5052
description="This is a test benchmark for Foo Group.",
5153
notes="This is a test note for Foo Group.",
5254
),
53-
"Bar Group" : BenchmarkMetadata(
55+
"Bar Group": BenchmarkMetadata(
5456
type="group",
5557
description="This is a test benchmark for Bar Group.",
5658
unstable="This is an unstable note for Bar Group.",

devops/scripts/benchmarks/html/scripts.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -205,20 +205,20 @@ function createChartContainer(data, canvasId, type) {
205205
container.className = 'chart-container';
206206
container.setAttribute('data-label', data.label);
207207
container.setAttribute('data-suite', data.suite);
208-
208+
209209
// Check if this benchmark is marked as unstable
210210
const metadata = metadataForLabel(data.label, type);
211211
if (metadata && metadata.unstable) {
212212
container.setAttribute('data-unstable', 'true');
213-
213+
214214
// Add unstable warning
215215
const unstableWarning = document.createElement('div');
216216
unstableWarning.className = 'benchmark-unstable';
217217
unstableWarning.textContent = metadata.unstable;
218218
unstableWarning.style.display = showUnstable ? 'block' : 'none';
219219
container.appendChild(unstableWarning);
220220
}
221-
221+
222222
// Add notes if present
223223
if (metadata && metadata.notes) {
224224
const noteElement = document.createElement('div');
@@ -227,7 +227,7 @@ function createChartContainer(data, canvasId, type) {
227227
noteElement.style.display = showNotes ? 'block' : 'none';
228228
container.appendChild(noteElement);
229229
}
230-
230+
231231
// Add description if present in metadata, but only for groups
232232
if (metadata && metadata.description && metadata.type === "group") {
233233
const descElement = document.createElement('div');
@@ -274,7 +274,7 @@ function metadataForLabel(label, type) {
274274
return metadata;
275275
}
276276
}
277-
277+
278278
return null;
279279
}
280280

@@ -305,27 +305,27 @@ function generateExtraInfo(latestRunsLookup, data) {
305305
return labels.map(label => {
306306
const metadata = metadataForLabel(label);
307307
const latestRun = latestRunsLookup.get(label);
308-
308+
309309
let html = '<div class="extra-info-entry">';
310-
310+
311311
if (metadata) {
312312
html += `<strong>${label}:</strong> ${formatCommand(latestRun.result)}<br>`;
313-
313+
314314
if (metadata.description) {
315315
html += `<em>Description:</em> ${metadata.description}`;
316316
}
317-
317+
318318
if (metadata.notes) {
319319
html += `<br><em>Notes:</em> <span class="note-text">${metadata.notes}</span>`;
320320
}
321-
321+
322322
if (metadata.unstable) {
323323
html += `<br><em class="unstable-warning">⚠️ Unstable:</em> <span class="unstable-text">${metadata.unstable}</span>`;
324324
}
325325
} else {
326326
html += `<strong>${label}:</strong> No data available`;
327327
}
328-
328+
329329
html += '</div>';
330330
return html;
331331
}).join('');
@@ -407,9 +407,9 @@ function filterCharts() {
407407
const isUnstable = container.getAttribute('data-unstable') === 'true';
408408

409409
// Hide unstable benchmarks if showUnstable is false
410-
const shouldShow = regex.test(label) &&
411-
activeSuites.includes(suite) &&
412-
(showUnstable || !isUnstable);
410+
const shouldShow = regex.test(label) &&
411+
activeSuites.includes(suite) &&
412+
(showUnstable || !isUnstable);
413413

414414
container.style.display = shouldShow ? '' : 'none';
415415
});
@@ -471,7 +471,7 @@ function processBarChartsData(benchmarkRuns) {
471471
if (!groupedResults[result.explicit_group]) {
472472
// Look up group metadata
473473
const groupMetadata = metadataForLabel(result.explicit_group);
474-
474+
475475
groupedResults[result.explicit_group] = {
476476
label: result.explicit_group,
477477
suite: result.suite,
@@ -550,7 +550,7 @@ function setupSuiteFilters() {
550550
function setupToggles() {
551551
const notesToggle = document.getElementById('show-notes');
552552
const unstableToggle = document.getElementById('show-unstable');
553-
553+
554554
notesToggle.addEventListener('change', function() {
555555
showNotes = this.checked;
556556
// Update all note elements visibility
@@ -559,7 +559,7 @@ function setupToggles() {
559559
});
560560
filterCharts();
561561
});
562-
562+
563563
unstableToggle.addEventListener('change', function() {
564564
showUnstable = this.checked;
565565
// Update all unstable warning elements visibility
@@ -568,16 +568,16 @@ function setupToggles() {
568568
});
569569
filterCharts();
570570
});
571-
571+
572572
// Initialize from URL params if present
573573
const notesParam = getQueryParam('notes');
574574
const unstableParam = getQueryParam('unstable');
575-
575+
576576
if (notesParam !== null) {
577577
showNotes = notesParam === 'true';
578578
notesToggle.checked = showNotes;
579579
}
580-
580+
581581
if (unstableParam !== null) {
582582
showUnstable = unstableParam === 'true';
583583
unstableToggle.checked = showUnstable;

devops/scripts/benchmarks/utils/result.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class BenchmarkRun:
4747
@dataclass_json
4848
@dataclass
4949
class BenchmarkMetadata:
50-
type: str = 'benchmark' # or 'group'
50+
type: str = "benchmark" # or 'group'
5151
description: Optional[str] = None
5252
notes: Optional[str] = None
5353
unstable: Optional[str] = None

0 commit comments

Comments
 (0)