Skip to content

Commit 89fd5ad

Browse files
committed
Refactor compute bench metadata
Simplify SubmitGraph and SubmitKernel benchmarks metadata creation.
1 parent 61bb39e commit 89fd5ad

File tree

1 file changed

+18
-39
lines changed

1 file changed

+18
-39
lines changed

devops/scripts/benchmarks/benches/compute.py

Lines changed: 18 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -110,72 +110,51 @@ def setup(self) -> None:
110110

111111
def additional_metadata(self) -> dict[str, BenchmarkMetadata]:
112112
metadata = {
113-
"SubmitKernel": BenchmarkMetadata(
114-
type="group",
115-
description="Measures CPU time overhead of submitting kernels through different APIs.",
116-
notes="Each layer builds on top of the previous layer, adding functionality and overhead.\n"
117-
"The first layer is the Level Zero API, the second is the Unified Runtime API, and the third is the SYCL API.\n"
118-
"The UR v2 adapter noticeably reduces UR layer overhead, also improving SYCL performance.\n"
119-
"Work is ongoing to reduce the overhead of the SYCL API\n",
120-
tags=["submit", "micro", "SYCL", "UR", "L0"],
121-
range_min=0.0,
122-
),
123113
"SinKernelGraph": BenchmarkMetadata(
124114
type="group",
125115
unstable="This benchmark combines both eager and graph execution, and may not be representative of real use cases.",
126116
tags=["submit", "memory", "proxy", "SYCL", "UR", "L0", "graph"],
127117
),
128-
"SubmitGraph": BenchmarkMetadata(
129-
type="group", tags=["submit", "micro", "SYCL", "UR", "L0", "graph"]
130-
),
131118
"FinalizeGraph": BenchmarkMetadata(
132119
type="group", tags=["finalize", "micro", "SYCL", "graph"]
133120
),
134121
}
135122

136123
# Add metadata for all SubmitKernel group variants
137-
base_metadata = metadata["SubmitKernel"]
138-
124+
submit_kernel_metadata = BenchmarkMetadata(
125+
type="group",
126+
notes="Each layer builds on top of the previous layer, adding functionality and overhead.\n"
127+
"The first layer is the Level Zero API, the second is the Unified Runtime API, and the third is the SYCL API.\n"
128+
"The UR v2 adapter noticeably reduces UR layer overhead, also improving SYCL performance.\n"
129+
"Work is ongoing to reduce the overhead of the SYCL API\n",
130+
tags=["submit", "micro", "SYCL", "UR", "L0"],
131+
range_min=0.0,
132+
)
139133
for order in ["in order", "out of order"]:
140134
for completion in ["", " with completion"]:
141135
for events in ["", " using events"]:
142136
group_name = f"SubmitKernel {order}{completion}{events} long kernel"
143-
metadata[group_name] = BenchmarkMetadata(
144-
type="group",
145-
description=f"Measures CPU time overhead of submitting {order} kernels with longer execution times through different APIs.",
146-
notes=base_metadata.notes,
147-
tags=base_metadata.tags,
148-
range_min=base_metadata.range_min,
149-
)
150-
137+
metadata[group_name] = copy.deepcopy(submit_kernel_metadata)
138+
metadata[group_name].description = f"Measures CPU time overhead of submitting {order} kernels with longer execution times through different APIs."
151139
# CPU count variants
152140
cpu_count_group = f"{group_name}, CPU count"
153-
metadata[cpu_count_group] = BenchmarkMetadata(
154-
type="group",
155-
description=f"Measures CPU time overhead of submitting {order} kernels with longer execution times through different APIs.",
156-
notes=base_metadata.notes,
157-
tags=base_metadata.tags,
158-
range_min=base_metadata.range_min,
159-
)
141+
metadata[cpu_count_group] = copy.deepcopy(submit_kernel_metadata)
142+
metadata[cpu_count_group].description = f"Measures CPU instructions count overhead of submitting {order} kernels with longer execution times through different APIs."
160143

161144
# Add metadata for all SubmitGraph group variants
162-
base_metadata = metadata["SubmitGraph"]
145+
submit_graph_metadata = BenchmarkMetadata(
146+
type="group", tags=["submit", "micro", "SYCL", "UR", "L0", "graph"]
147+
)
163148
for order in ["in order", "out of order"]:
164149
for completion in ["", " with completion"]:
165150
for events in ["", " using events"]:
166151
for num_kernels in self.submit_graph_num_kernels:
167152
for host_tasks in ["", " use host tasks"]:
168153
group_name = f"SubmitGraph {order}{completion}{events}{host_tasks}, {num_kernels} kernels"
169-
metadata[group_name] = BenchmarkMetadata(
170-
type="group",
171-
tags=base_metadata.tags,
172-
)
154+
metadata[group_name] = copy.deepcopy(submit_graph_metadata)
173155
# CPU count variants
174156
cpu_count_group = f"{group_name}, CPU count"
175-
metadata[cpu_count_group] = BenchmarkMetadata(
176-
type="group",
177-
tags=base_metadata.tags,
178-
)
157+
metadata[cpu_count_group] = copy.deepcopy(submit_graph_metadata)
179158
return metadata
180159

181160
def benchmarks(self) -> list[Benchmark]:

0 commit comments

Comments
 (0)