Skip to content

Commit 6c28d33

Browse files
committed
simplify presets, remove suites if all set
1 parent 64cf79c commit 6c28d33

File tree

4 files changed

+41
-68
lines changed

4 files changed

+41
-68
lines changed

devops/scripts/benchmarks/html/scripts.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Core state
77
let activeRuns = new Set(defaultCompareNames);
88
let chartInstances = new Map();
9+
let suiteNames = new Set();
910
let timeseriesData, barChartsData, allRunNames;
1011

1112
// DOM Elements
@@ -306,7 +307,7 @@ function updateURL() {
306307
url.searchParams.delete('regex');
307308
}
308309

309-
if (activeSuites.length > 0) {
310+
if (activeSuites.length > 0 && activeSuites.length != suiteNames.size) {
310311
url.searchParams.set('suites', activeSuites.join(','));
311312
} else {
312313
url.searchParams.delete('suites');
@@ -444,7 +445,6 @@ function setupRunSelector() {
444445
function setupSuiteFilters() {
445446
suiteFiltersContainer = document.getElementById('suite-filters');
446447

447-
const suiteNames = new Set();
448448
benchmarkRuns.forEach(run => {
449449
run.results.forEach(result => {
450450
suiteNames.add(result.suite);

devops/scripts/benchmarks/main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from history import BenchmarkHistory
1818
from utils.utils import prepare_workdir
1919
from utils.compute_runtime import *
20-
from presets import preset_get_by_name, presets
20+
from presets import enabled_suites, presets
2121

2222
import argparse
2323
import re
@@ -164,7 +164,7 @@ def main(directory, additional_env_vars, save_name, compare_names, filter):
164164
failures = {}
165165

166166
for s in suites:
167-
if s.name() not in options.preset.suites():
167+
if s.name() not in enabled_suites(options.preset):
168168
continue
169169

170170
suite_benchmarks = s.benchmarks()
@@ -443,9 +443,9 @@ def validate_and_parse_env_args(env_args):
443443
parser.add_argument(
444444
"--preset",
445445
type=str,
446-
choices=[p.name() for p in presets],
446+
choices=[p for p in presets.keys()],
447447
help="Benchmark preset to run.",
448-
default=options.preset.name(),
448+
default=options.preset,
449449
)
450450
parser.add_argument(
451451
"--results-dir",
@@ -478,7 +478,7 @@ def validate_and_parse_env_args(env_args):
478478
options.current_run_name = args.relative_perf
479479
options.cudnn_directory = args.cudnn_directory
480480
options.cublas_directory = args.cublas_directory
481-
options.preset = preset_get_by_name(args.preset)
481+
options.preset = args.preset
482482
options.custom_results_dir = args.results_dir
483483

484484
if args.build_igc and args.compute_runtime is None:

devops/scripts/benchmarks/options.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from dataclasses import dataclass, field
22
from enum import Enum
3-
from presets import Preset, presets
43

4+
from presets import presets
55

66
class Compare(Enum):
77
LATEST = "latest"
@@ -40,7 +40,7 @@ class Options:
4040
compute_runtime_tag: str = "25.05.32567.18"
4141
build_igc: bool = False
4242
current_run_name: str = "This PR"
43-
preset: Preset = presets[0]
43+
preset: str = "Full"
4444
custom_results_dir = None
4545

4646

devops/scripts/benchmarks/presets.py

Lines changed: 32 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -3,63 +3,36 @@
33
# See LICENSE.TXT
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6-
from typing import List, Type
6+
presets: dict[str, list[str]] = {
7+
"Full": [
8+
"Compute Benchmarks",
9+
"llama.cpp bench",
10+
"SYCL-Bench",
11+
"Velocity Bench",
12+
"UMF",
13+
],
14+
"SYCL": [
15+
"Compute Benchmarks",
16+
"llama.cpp bench",
17+
"SYCL-Bench",
18+
"Velocity Bench",
19+
],
20+
"Minimal": [
21+
"Compute Benchmarks",
22+
],
23+
"Normal": [
24+
"Compute Benchmarks",
25+
"llama.cpp bench",
26+
"Velocity Bench",
27+
],
28+
"Test": [
29+
"Test Suite",
30+
],
31+
}
32+
33+
def enabled_suites(preset: str) -> list[str]:
34+
try:
35+
return presets[preset]
36+
except KeyError:
37+
raise ValueError(f"Preset '{preset}' not found.")
738

8-
class Preset:
9-
def description(self) -> str:
10-
raise NotImplementedError
11-
12-
def name(self) -> str:
13-
return self.__class__.__name__
14-
15-
def suites(self) -> List[str]:
16-
raise NotImplementedError
17-
18-
class Full(Preset):
19-
def description(self) -> str:
20-
return "All available benchmarks."
21-
22-
def suites(self) -> List[str]:
23-
return [
24-
"Compute Benchmarks",
25-
"llama.cpp bench",
26-
"SYCL-Bench",
27-
"Velocity Bench",
28-
"UMF",
29-
]
30-
31-
class SYCL(Preset):
32-
def description(self) -> str:
33-
return "All available benchmarks related to SYCL."
34-
35-
def suites(self) -> List[str]:
36-
return ["Compute Benchmarks", "llama.cpp bench", "SYCL-Bench", "Velocity Bench"]
37-
38-
class Minimal(Preset):
39-
def description(self) -> str:
40-
return "Short microbenchmarks."
41-
42-
def suites(self) -> List[str]:
43-
return ["Compute Benchmarks"]
44-
45-
class Normal(Preset):
46-
def description(self) -> str:
47-
return "Comprehensive mix of microbenchmarks and real applications."
48-
49-
def suites(self) -> List[str]:
50-
return ["Compute Benchmarks", "llama.cpp bench", "Velocity Bench"]
51-
52-
class Test(Preset):
53-
def description(self) -> str:
54-
return "Noop benchmarks for framework testing."
55-
56-
def suites(self) -> List[str]:
57-
return ["Test Suite"]
58-
59-
presets = [Full(), SYCL(), Minimal(), Normal(), Test()]
60-
61-
def preset_get_by_name(name: str) -> Preset:
62-
for p in presets:
63-
if p.name() == name:
64-
return p
65-
raise ValueError(f"Preset '{name}' not found.")

0 commit comments

Comments
 (0)