Skip to content

Commit 8a9e847

Browse files
authored
[UR][PERF] add L0, UR, and SYCL Sin Kernel Graph benchmark (#17087)
``` running graph_api_benchmark_sycl SinKernelGraph graphs:0, numKernels:5, iteration 0... complete (graph_api_benchmark_sycl SinKernelGraph graphs:0, numKernels:5: 28.533 μs). running graph_api_benchmark_sycl SinKernelGraph graphs:1, numKernels:5, iteration 0... complete (graph_api_benchmark_sycl SinKernelGraph graphs:1, numKernels:5: 45.884 μs). running graph_api_benchmark_sycl SinKernelGraph graphs:0, numKernels:100, iteration 0... complete (graph_api_benchmark_sycl SinKernelGraph graphs:0, numKernels:100: 353.814 μs). running graph_api_benchmark_sycl SinKernelGraph graphs:1, numKernels:100, iteration 0... complete (graph_api_benchmark_sycl SinKernelGraph graphs:1, numKernels:100: 386.979 μs). running graph_api_benchmark_l0 SinKernelGraph graphs:0, numKernels:5, iteration 0... complete (graph_api_benchmark_l0 SinKernelGraph graphs:0, numKernels:5: 25.278 μs). running graph_api_benchmark_l0 SinKernelGraph graphs:1, numKernels:5, iteration 0... complete (graph_api_benchmark_l0 SinKernelGraph graphs:1, numKernels:5: 20.202 μs). running graph_api_benchmark_l0 SinKernelGraph graphs:0, numKernels:100, iteration 0... complete (graph_api_benchmark_l0 SinKernelGraph graphs:0, numKernels:100: 235.466 μs). running graph_api_benchmark_l0 SinKernelGraph graphs:1, numKernels:100, iteration 0... complete (graph_api_benchmark_l0 SinKernelGraph graphs:1, numKernels:100: 222.501 μs). ```
1 parent 63d688c commit 8a9e847

File tree

1 file changed

+31
-12
lines changed
  • unified-runtime/scripts/benchmarks/benches

1 file changed

+31
-12
lines changed

unified-runtime/scripts/benchmarks/benches/compute.py

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from .base import Benchmark, Suite
1111
from .result import Result
1212
from options import options
13-
13+
from enum import Enum
1414

1515
class ComputeBench(Suite):
1616
def __init__(self, directory):
@@ -27,7 +27,7 @@ def setup(self):
2727
self.directory,
2828
"compute-benchmarks-repo",
2929
"https://github.com/intel/compute-benchmarks.git",
30-
"578a7ac6f9bc48f6c2b408ef64a19a2ef9a216e7",
30+
"9369275026229b182bc4a555b73c2ec995a9e2b7",
3131
)
3232
build_path = create_build_path(self.directory, "compute-benchmarks-build")
3333

@@ -80,10 +80,14 @@ def benchmarks(self) -> list[Benchmark]:
8080
MemcpyExecute(self, 10, 16, 1024, 10000, 0, 1, 1),
8181
MemcpyExecute(self, 4096, 1, 1024, 10, 0, 1, 0),
8282
MemcpyExecute(self, 4096, 4, 1024, 10, 0, 1, 0),
83-
GraphApiSinKernelGraphSYCL(self, 0, 10),
84-
GraphApiSinKernelGraphSYCL(self, 1, 10),
85-
GraphApiSinKernelGraphSYCL(self, 0, 100),
86-
GraphApiSinKernelGraphSYCL(self, 1, 100),
83+
GraphApiSinKernelGraph(self, RUNTIMES.SYCL, 0, 5),
84+
GraphApiSinKernelGraph(self, RUNTIMES.SYCL, 1, 5),
85+
GraphApiSinKernelGraph(self, RUNTIMES.SYCL, 0, 100),
86+
GraphApiSinKernelGraph(self, RUNTIMES.SYCL, 1, 100),
87+
GraphApiSinKernelGraph(self, RUNTIMES.LEVEL_ZERO, 0, 5),
88+
GraphApiSinKernelGraph(self, RUNTIMES.LEVEL_ZERO, 1, 5),
89+
GraphApiSinKernelGraph(self, RUNTIMES.LEVEL_ZERO, 0, 100),
90+
GraphApiSinKernelGraph(self, RUNTIMES.LEVEL_ZERO, 1, 100),
8791
# Submit
8892
GraphApiSubmitExecGraph(self, 0, 1, 10),
8993
GraphApiSubmitExecGraph(self, 1, 1, 10),
@@ -99,6 +103,10 @@ def benchmarks(self) -> list[Benchmark]:
99103
SubmitKernelUR(self, 0, 0),
100104
SubmitKernelUR(self, 1, 0),
101105
SubmitKernelUR(self, 1, 1),
106+
GraphApiSinKernelGraph(self, RUNTIMES.UR, 0, 5),
107+
GraphApiSinKernelGraph(self, RUNTIMES.UR, 1, 5),
108+
GraphApiSinKernelGraph(self, RUNTIMES.UR, 0, 100),
109+
GraphApiSinKernelGraph(self, RUNTIMES.UR, 1, 100),
102110
]
103111

104112
return benches
@@ -420,23 +428,34 @@ def bin_args(self) -> list[str]:
420428
]
421429

422430

423-
class GraphApiSinKernelGraphSYCL(ComputeBenchmark):
424-
def __init__(self, bench, withGraphs, numKernels):
431+
class RUNTIMES(Enum):
432+
SYCL = "sycl"
433+
LEVEL_ZERO = "l0"
434+
UR = "ur"
435+
436+
437+
class GraphApiSinKernelGraph(ComputeBenchmark):
438+
def __init__(self, bench, runtime: RUNTIMES, withGraphs, numKernels):
425439
self.withGraphs = withGraphs
426440
self.numKernels = numKernels
427-
super().__init__(bench, "graph_api_benchmark_sycl", "SinKernelGraph")
441+
self.runtime = runtime
442+
super().__init__(
443+
bench, f"graph_api_benchmark_{runtime.value}", "SinKernelGraph"
444+
)
428445

429446
def explicit_group(self):
430-
return "SinKernelGraph"
447+
return f"SinKernelGraph {self.numKernels}"
431448

432449
def name(self):
433-
return f"graph_api_benchmark_sycl SinKernelGraph graphs:{self.withGraphs}, numKernels:{self.numKernels}"
450+
return f"graph_api_benchmark_{self.runtime.value} SinKernelGraph graphs:{self.withGraphs}, numKernels:{self.numKernels}"
434451

435452
def bin_args(self) -> list[str]:
436453
return [
437-
"--iterations=100",
454+
"--iterations=10000",
438455
f"--numKernels={self.numKernels}",
439456
f"--withGraphs={self.withGraphs}",
457+
"--withCopyOffload=1",
458+
"--immediateAppendCmdList=0",
440459
]
441460

442461

0 commit comments

Comments
 (0)