Skip to content

Commit ba3078b

Browse files
committed
Refactor compute bench metadata
Simplify SubmitGraph and SubmitKernel benchmarks metadata creation.
1 parent 4201956 commit ba3078b

File tree

1 file changed

+21
-36
lines changed

1 file changed

+21
-36
lines changed

devops/scripts/benchmarks/benches/compute.py

Lines changed: 21 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -100,71 +100,56 @@ def setup(self) -> None:
100100

101101
def additional_metadata(self) -> dict[str, BenchmarkMetadata]:
102102
metadata = {
103-
"SubmitKernel": BenchmarkMetadata(
104-
type="group",
105-
description="Measures CPU time overhead of submitting kernels through different APIs.",
106-
notes="Each layer builds on top of the previous layer, adding functionality and overhead.\n"
107-
"The first layer is the Level Zero API, the second is the Unified Runtime API, and the third is the SYCL API.\n"
108-
"The UR v2 adapter noticeably reduces UR layer overhead, also improving SYCL performance.\n"
109-
"Work is ongoing to reduce the overhead of the SYCL API\n",
110-
tags=["submit", "micro", "SYCL", "UR", "L0"],
111-
range_min=0.0,
112-
),
113103
"SinKernelGraph": BenchmarkMetadata(
114104
type="group",
115105
unstable="This benchmark combines both eager and graph execution, and may not be representative of real use cases.",
116106
tags=["submit", "memory", "proxy", "SYCL", "UR", "L0", "graph"],
117107
),
118-
"SubmitGraph": BenchmarkMetadata(
119-
type="group", tags=["submit", "micro", "SYCL", "UR", "L0", "graph"]
120-
),
121108
"FinalizeGraph": BenchmarkMetadata(
122109
type="group", tags=["finalize", "micro", "SYCL", "graph"]
123110
),
124111
}
125112

126113
# Add metadata for all SubmitKernel group variants
127-
base_metadata = metadata["SubmitKernel"]
128-
114+
submit_kernel_metadata = BenchmarkMetadata(
115+
type="group",
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+
)
129123
for order in ["in order", "out of order"]:
130124
for completion in ["", " with completion"]:
131125
for events in ["", " using events"]:
132126
group_name = f"SubmitKernel {order}{completion}{events} long kernel"
133-
metadata[group_name] = BenchmarkMetadata(
134-
type="group",
135-
description=f"Measures CPU time overhead of submitting {order} kernels with longer execution times through different APIs.",
136-
notes=base_metadata.notes,
137-
tags=base_metadata.tags,
138-
range_min=base_metadata.range_min,
127+
metadata[group_name] = copy.deepcopy(submit_kernel_metadata)
128+
metadata[group_name].description = (
129+
f"Measures CPU time overhead of submitting {order} kernels with longer execution times through different APIs."
139130
)
140-
141131
# CPU count variants
142132
cpu_count_group = f"{group_name}, CPU count"
143-
metadata[cpu_count_group] = 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,
133+
metadata[cpu_count_group] = copy.deepcopy(submit_kernel_metadata)
134+
metadata[cpu_count_group].description = (
135+
f"Measures CPU instructions count overhead of submitting {order} kernels with longer execution times through different APIs."
149136
)
150137

151138
# Add metadata for all SubmitGraph group variants
152-
base_metadata = metadata["SubmitGraph"]
139+
submit_graph_metadata = BenchmarkMetadata(
140+
type="group", tags=["submit", "micro", "SYCL", "UR", "L0", "graph"]
141+
)
153142
for order in ["in order", "out of order"]:
154143
for completion in ["", " with completion"]:
155144
for events in ["", " using events"]:
156145
for num_kernels in self.submit_graph_num_kernels:
157146
for host_tasks in ["", " use host tasks"]:
158147
group_name = f"SubmitGraph {order}{completion}{events}{host_tasks}, {num_kernels} kernels"
159-
metadata[group_name] = BenchmarkMetadata(
160-
type="group",
161-
tags=base_metadata.tags,
162-
)
148+
metadata[group_name] = copy.deepcopy(submit_graph_metadata)
163149
# CPU count variants
164150
cpu_count_group = f"{group_name}, CPU count"
165-
metadata[cpu_count_group] = BenchmarkMetadata(
166-
type="group",
167-
tags=base_metadata.tags,
151+
metadata[cpu_count_group] = copy.deepcopy(
152+
submit_graph_metadata
168153
)
169154
return metadata
170155

0 commit comments

Comments
 (0)