Skip to content

Commit 8032832

Browse files
ianaylpbalcerlukaszstolarczuk
authored
[CI][BENCHMARK] Merge new metadata implementation + tweaks to benchmarks (#17617)
This PR partially merges changes introduced in #17229. Specifically, it merges changes related to: - Introducing metadata in the result - Tweaks to the benchmarks itself: benchmarks ran, parameters used to run, what is enabled/disabled, etc - Enables/Disables benchmarks we are interested/no longer interested in - Disables non-working benchmarks - Bumps commit hashes used to fetch each benchmark - New command line arguments, such as `--build-jobs` and `--redownload` (to re-fetch the benchmarks) **Note:** I am relying on this PR having its commits squashed during merge (which should be the default behavior for intel/llvm) I did not try to clean up the commit history. Most of these changes are by Piotr anyway, I wanted to make sure he was properly credited for the changes. Updates for current splitting effort of #17229: #17545 (comment) --------- Co-authored-by: Piotr Balcer <[email protected]> Co-authored-by: Łukasz Stolarczuk <[email protected]>
1 parent 358d73f commit 8032832

17 files changed

+868
-286
lines changed

devops/scripts/benchmarks/benches/base.py

+64-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,37 @@
1-
# Copyright (C) 2024 Intel Corporation
1+
# Copyright (C) 2024-2025 Intel Corporation
22
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
33
# See LICENSE.TXT
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6+
from dataclasses import dataclass
67
import os
78
import shutil
89
from pathlib import Path
9-
from .result import Result
10+
from utils.result import BenchmarkMetadata, BenchmarkTag, Result
1011
from options import options
1112
from utils.utils import download, run
12-
import urllib.request
13-
import tarfile
13+
14+
benchmark_tags = [
15+
BenchmarkTag("SYCL", "Benchmark uses SYCL runtime"),
16+
BenchmarkTag("UR", "Benchmark uses Unified Runtime API"),
17+
BenchmarkTag("L0", "Benchmark uses Level Zero API directly"),
18+
BenchmarkTag("UMF", "Benchmark uses Unified Memory Framework directly"),
19+
BenchmarkTag("micro", "Microbenchmark focusing on a specific functionality"),
20+
BenchmarkTag("application", "Real application-based performance test"),
21+
BenchmarkTag("proxy", "Benchmark that simulates real application use-cases"),
22+
BenchmarkTag("submit", "Tests kernel submission performance"),
23+
BenchmarkTag("math", "Tests math computation performance"),
24+
BenchmarkTag("memory", "Tests memory transfer or bandwidth performance"),
25+
BenchmarkTag("allocation", "Tests memory allocation performance"),
26+
BenchmarkTag("graph", "Tests graph-based execution performance"),
27+
BenchmarkTag("latency", "Measures operation latency"),
28+
BenchmarkTag("throughput", "Measures operation throughput"),
29+
BenchmarkTag("inference", "Tests ML/AI inference performance"),
30+
BenchmarkTag("image", "Image processing benchmark"),
31+
BenchmarkTag("simulation", "Physics or scientific simulation benchmark"),
32+
]
33+
34+
benchmark_tags_dict = {tag.name: tag for tag in benchmark_tags}
1435

1536

1637
class Benchmark:
@@ -55,19 +76,25 @@ def create_data_path(self, name, skip_data_dir=False):
5576
data_path = os.path.join(self.directory, name)
5677
else:
5778
data_path = os.path.join(self.directory, "data", name)
58-
if options.rebuild and Path(data_path).exists():
79+
if options.redownload and Path(data_path).exists():
5980
shutil.rmtree(data_path)
6081

6182
Path(data_path).mkdir(parents=True, exist_ok=True)
6283

6384
return data_path
6485

65-
def download(self, name, url, file, untar=False, unzip=False, skip_data_dir=False):
86+
def download(
87+
self,
88+
name,
89+
url,
90+
file,
91+
untar=False,
92+
unzip=False,
93+
skip_data_dir=False,
94+
checksum="",
95+
):
6696
self.data_path = self.create_data_path(name, skip_data_dir)
67-
return download(self.data_path, url, file, untar, unzip)
68-
69-
def name(self):
70-
raise NotImplementedError()
97+
return download(self.data_path, url, file, untar, unzip, checksum)
7198

7299
def lower_is_better(self):
73100
return True
@@ -87,6 +114,30 @@ def stddev_threshold(self):
87114
def get_suite_name(self) -> str:
88115
return self.suite.name()
89116

117+
def name(self):
118+
raise NotImplementedError()
119+
120+
def description(self):
121+
return ""
122+
123+
def notes(self) -> str:
124+
return None
125+
126+
def unstable(self) -> str:
127+
return None
128+
129+
def get_tags(self) -> list[str]:
130+
return []
131+
132+
def get_metadata(self) -> BenchmarkMetadata:
133+
return BenchmarkMetadata(
134+
type="benchmark",
135+
description=self.description(),
136+
notes=self.notes(),
137+
unstable=self.unstable(),
138+
tags=self.get_tags(),
139+
)
140+
90141

91142
class Suite:
92143
def benchmarks(self) -> list[Benchmark]:
@@ -97,3 +148,6 @@ def name(self) -> str:
97148

98149
def setup(self):
99150
return
151+
152+
def additionalMetadata(self) -> dict[str, BenchmarkMetadata]:
153+
return {}

0 commit comments

Comments
 (0)