Skip to content

Commit 73c148e

Browse files
ianaylpbalcerlukaszstolarczuk
authored
[CI][Benchmark] Merge benchmark suite presets implementation (#17660)
In continuation of the effort outlined in #17545 (comment), this PR merges further changes introduced in #17229. Specifically, it merges @pbalcer's changes for adding the ability to run different benchmarking presets **Note:** I am relying on this PR having its commits squashed during merge (which should be the default behavior for intel/llvm) --------- Co-authored-by: Piotr Balcer <[email protected]> Co-authored-by: Łukasz Stolarczuk <[email protected]>
1 parent b62febc commit 73c148e

File tree

4 files changed

+56
-4
lines changed

4 files changed

+56
-4
lines changed

devops/scripts/benchmarks/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Scripts for running performance tests on SYCL and Unified Runtime.
66

77
- [Velocity Bench](https://github.com/oneapi-src/Velocity-Bench)
88
- [Compute Benchmarks](https://github.com/intel/compute-benchmarks/)
9+
- [LlamaCpp Benchmarks](https://github.com/ggerganov/llama.cpp)
10+
- [SYCL-Bench](https://github.com/unisa-hpc/sycl-bench)
911

1012
## Running
1113

@@ -27,8 +29,6 @@ You can also include additional benchmark parameters, such as environment variab
2729

2830
Once all the required information is entered, click the "Run workflow" button to initiate a new workflow run. This will execute the benchmarks and then post the results as a comment on the specified Pull Request.
2931

30-
By default, all benchmark runs are compared against `baseline`, which is a well-established set of the latest data.
31-
3232
You must be a member of the `oneapi-src` organization to access these features.
3333

3434
## Comparing results
@@ -37,8 +37,8 @@ By default, the benchmark results are not stored. To store them, use the option
3737

3838
You can compare benchmark results using `--compare` option. The comparison will be presented in a markdown output file (see below). If you want to calculate the relative performance of the new results against the previously saved data, use `--compare <previously_saved_data>` (i.e. `--compare baseline`). In case of comparing only stored data without generating new results, use `--dry-run --compare <name1> --compare <name2> --relative-perf <name1>`, where `name1` indicates the baseline for the relative performance calculation and `--dry-run` prevents the script for running benchmarks. Listing more than two `--compare` options results in displaying only execution time, without statistical analysis.
3939

40-
Baseline, as well as baseline-v2 (for the level-zero adapter v2) is updated automatically during a nightly job. The results
41-
are stored [here](https://oneapi-src.github.io/unified-runtime/benchmark_results.html).
40+
Baseline_L0, as well as Baseline_L0v2 (for the level-zero adapter v2) is updated automatically during a nightly job. The results
41+
are stored [here](https://oneapi-src.github.io/unified-runtime/performance/).
4242

4343
## Output formats
4444
You can display the results in the form of a HTML file by using `--ouptut-html` and a markdown file by using `--output-markdown`. Due to character limits for posting PR comments, the final content of the markdown file might be reduced. In order to obtain the full markdown output, use `--output-markdown full`.

devops/scripts/benchmarks/main.py

+12
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from history import BenchmarkHistory
1818
from utils.utils import prepare_workdir
1919
from utils.compute_runtime import *
20+
from presets import enabled_suites, presets
2021

2122
import argparse
2223
import re
@@ -175,6 +176,9 @@ def main(directory, additional_env_vars, save_name, compare_names, filter):
175176
failures = {}
176177

177178
for s in suites:
179+
if s.name() not in enabled_suites(options.preset):
180+
continue
181+
178182
suite_benchmarks = s.benchmarks()
179183
if filter:
180184
suite_benchmarks = [
@@ -457,6 +461,13 @@ def validate_and_parse_env_args(env_args):
457461
help="Directory for cublas library",
458462
default=None,
459463
)
464+
parser.add_argument(
465+
"--preset",
466+
type=str,
467+
choices=[p for p in presets.keys()],
468+
help="Benchmark preset to run",
469+
default=options.preset,
470+
)
460471
parser.add_argument(
461472
"--results-dir",
462473
type=str,
@@ -495,6 +506,7 @@ def validate_and_parse_env_args(env_args):
495506
options.current_run_name = args.relative_perf
496507
options.cudnn_directory = args.cudnn_directory
497508
options.cublas_directory = args.cublas_directory
509+
options.preset = args.preset
498510
options.custom_results_dir = args.results_dir
499511
options.build_jobs = args.build_jobs
500512

devops/scripts/benchmarks/options.py

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from enum import Enum
33
import multiprocessing
44

5+
from presets import presets
56

67
class Compare(Enum):
78
LATEST = "latest"
@@ -42,6 +43,7 @@ class Options:
4243
compute_runtime_tag: str = "25.05.32567.12"
4344
build_igc: bool = False
4445
current_run_name: str = "This PR"
46+
preset: str = "Full"
4547
custom_results_dir = None
4648
build_jobs: int = multiprocessing.cpu_count()
4749

devops/scripts/benchmarks/presets.py

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright (C) 2025 Intel Corporation
2+
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
3+
# See LICENSE.TXT
4+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5+
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+
34+
def enabled_suites(preset: str) -> list[str]:
35+
try:
36+
return presets[preset]
37+
except KeyError:
38+
raise ValueError(f"Preset '{preset}' not found.")

0 commit comments

Comments
 (0)