Skip to content

Commit 679e66d

Browse files
authored
[CI][Benchmarks] update to latest compute-benchmarks, add syclpreview (#18176)
This patch updates to the latest revision of compute-benchmarks and updates the scripts to match. There two important changes: - the addition of syclpreview SubmitKernel benchmarks - introduction of "eventless" variants of SubmitKernel for L0 and UR. These will now be grouped together for easy comparison. Signed-off-by: Piotr Balcer <[email protected]>
1 parent 5261637 commit 679e66d

File tree

2 files changed

+36
-26
lines changed

2 files changed

+36
-26
lines changed

devops/scripts/benchmarks/benches/compute.py

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414

1515

1616
class RUNTIMES(Enum):
17+
SYCL_PREVIEW = "syclpreview"
1718
SYCL = "sycl"
1819
LEVEL_ZERO = "l0"
1920
UR = "ur"
2021

2122

2223
def runtime_to_name(runtime: RUNTIMES) -> str:
2324
return {
25+
RUNTIMES.SYCL_PREVIEW: "SYCL Preview",
2426
RUNTIMES.SYCL: "SYCL",
2527
RUNTIMES.LEVEL_ZERO: "Level Zero",
2628
RUNTIMES.UR: "Unified Runtime",
@@ -29,6 +31,7 @@ def runtime_to_name(runtime: RUNTIMES) -> str:
2931

3032
def runtime_to_tag_name(runtime: RUNTIMES) -> str:
3133
return {
34+
RUNTIMES.SYCL_PREVIEW: "SYCL",
3235
RUNTIMES.SYCL: "SYCL",
3336
RUNTIMES.LEVEL_ZERO: "L0",
3437
RUNTIMES.UR: "UR",
@@ -46,7 +49,7 @@ def git_url(self) -> str:
4649
return "https://github.com/intel/compute-benchmarks.git"
4750

4851
def git_hash(self) -> str:
49-
return "420842fc3f0c01aac7b328bf192c25d3e7b9fd9e"
52+
return "9c1ed6fd59a7a40f8829251df4b5c0d847591183"
5053

5154
def setup(self):
5255
if options.sycl is None:
@@ -107,10 +110,16 @@ def additionalMetadata(self) -> dict[str, BenchmarkMetadata]:
107110
),
108111
}
109112

110-
def enabled_runtimes(self, supported_runtimes=None):
113+
def enabled_runtimes(self, supported_runtimes=None, extra_runtimes=None):
111114
# all runtimes in the RUNTIMES enum
112115
runtimes = supported_runtimes or list(RUNTIMES)
113116

117+
# filter out SYCL_PREVIEW which is not supported by default in all benchmarks
118+
runtimes = [r for r in runtimes if r != RUNTIMES.SYCL_PREVIEW]
119+
120+
if extra_runtimes is not None:
121+
runtimes.extend(extra_runtimes)
122+
114123
# Filter out UR if not available
115124
if options.ur is None:
116125
runtimes = [r for r in runtimes if r != RUNTIMES.UR]
@@ -131,21 +140,17 @@ def benchmarks(self) -> list[Benchmark]:
131140
benches = []
132141

133142
# Add SubmitKernel benchmarks using loops
134-
for runtime in self.enabled_runtimes():
143+
for runtime in self.enabled_runtimes(extra_runtimes=[RUNTIMES.SYCL_PREVIEW]):
135144
for in_order_queue in [0, 1]:
136145
for measure_completion in [0, 1]:
137-
for enqueue_functions in [0, 1]:
138-
# only SYCL backend supports enqueue functions
139-
if enqueue_functions == 1 and runtime != RUNTIMES.SYCL:
140-
continue
141-
146+
for use_events in [0, 1]:
142147
benches.append(
143148
SubmitKernel(
144149
self,
145150
runtime,
146151
in_order_queue,
147152
measure_completion,
148-
enqueue_functions,
153+
use_events,
149154
)
150155
)
151156

@@ -305,13 +310,11 @@ def teardown(self):
305310

306311

307312
class SubmitKernel(ComputeBenchmark):
308-
def __init__(
309-
self, bench, runtime: RUNTIMES, ioq, MeasureCompletion=0, EnqueueFunctions=0
310-
):
313+
def __init__(self, bench, runtime: RUNTIMES, ioq, MeasureCompletion=0, UseEvents=0):
311314
self.ioq = ioq
312315
self.runtime = runtime
313316
self.MeasureCompletion = MeasureCompletion
314-
self.EnqueueFunctions = EnqueueFunctions
317+
self.UseEvents = UseEvents
315318
super().__init__(
316319
bench, f"api_overhead_benchmark_{runtime.value}", "SubmitKernel"
317320
)
@@ -322,25 +325,30 @@ def get_tags(self):
322325
def name(self):
323326
order = "in order" if self.ioq else "out of order"
324327
completion_str = " with measure completion" if self.MeasureCompletion else ""
325-
enqueue_str = " using eventless SYCL enqueue" if self.EnqueueFunctions else ""
326-
return f"api_overhead_benchmark_{self.runtime.value} SubmitKernel {order}{completion_str}{enqueue_str}"
327328

328-
def explicit_group(self):
329-
# make eventless enqueue its own group, since only SYCL supports this mode
330-
if self.EnqueueFunctions:
331-
return "Submit Kernel using eventless SYCL enqueue"
329+
# this needs to be inversed (i.e., using events is empty string)
330+
# to match the existing already stored results
331+
events_str = " not using events" if not self.UseEvents else ""
332+
333+
return f"api_overhead_benchmark_{self.runtime.value} SubmitKernel {order}{completion_str}{events_str}"
332334

335+
def explicit_group(self):
333336
order = "In Order" if self.ioq else "Out Of Order"
334337
completion_str = " With Completion" if self.MeasureCompletion else ""
335-
return f"SubmitKernel {order}{completion_str}"
338+
339+
# this needs to be inversed (i.e., using events is empty string)
340+
# to match the existing already stored results
341+
events_str = " not using events" if not self.UseEvents else ""
342+
343+
return f"SubmitKernel {order}{completion_str}{events_str}"
336344

337345
def description(self) -> str:
338346
order = "in-order" if self.ioq else "out-of-order"
339347
runtime_name = runtime_to_name(self.runtime)
340348

341-
completion_desc = ""
342-
if self.runtime == RUNTIMES.UR:
343-
completion_desc = f", {'including' if self.MeasureCompletion else 'excluding'} kernel completion time"
349+
completion_desc = completion_desc = (
350+
f", {'including' if self.MeasureCompletion else 'excluding'} kernel completion time"
351+
)
344352

345353
return (
346354
f"Measures CPU time overhead of submitting {order} kernels through {runtime_name} API{completion_desc}. "
@@ -353,13 +361,12 @@ def range(self) -> tuple[float, float]:
353361
def bin_args(self) -> list[str]:
354362
return [
355363
f"--Ioq={self.ioq}",
356-
"--DiscardEvents=0",
357364
f"--MeasureCompletion={self.MeasureCompletion}",
358365
"--iterations=100000",
359366
"--Profiling=0",
360367
"--NumKernels=10",
361368
"--KernelExecTime=1",
362-
f"--EnqueueFunctions={self.EnqueueFunctions}",
369+
f"--UseEvents={self.UseEvents}",
363370
]
364371

365372

@@ -620,6 +627,9 @@ def bin_args(self) -> list[str]:
620627
]
621628

622629

630+
# TODO: once L0 SubmitGraph exists, this needs to be cleaned up split benchmarks into more groups,
631+
# set all the parameters (NoEvents 0/1, which should get inverted into UseEvents) and
632+
# unify the benchmark naming scheme with SubmitKernel.
623633
class GraphApiSubmitGraph(ComputeBenchmark):
624634
def __init__(
625635
self, bench, runtime: RUNTIMES, inOrderQueue, numKernels, measureCompletionTime
@@ -659,6 +669,7 @@ def bin_args(self) -> list[str]:
659669
f"--InOrderQueue={self.inOrderQueue}",
660670
"--Profiling=0",
661671
"--KernelExecutionTime=1",
672+
"--NoEvents=1", # not all implementations support NoEvents=0
662673
]
663674

664675

devops/scripts/benchmarks/history.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ def extract_timestamp(file_path: Path) -> str:
6060
self.runs = benchmark_runs
6161

6262
def create_run(self, name: str, results: list[Result]) -> BenchmarkRun:
63-
6463
def git_info_from_path(path: Path) -> (str, str):
6564
"""
6665
Derives git repo, commit information from git repo located in path.

0 commit comments

Comments
 (0)