77import csv
88import io
99from utils .utils import run , git_clone , create_build_path
10- from .base import Benchmark , Suite
10+ from .base import Benchmark , Suite , translate_tags
1111from utils .result import BenchmarkMetadata , Result
1212from options import options
1313from enum import Enum
@@ -26,6 +26,13 @@ def runtime_to_name(runtime: RUNTIMES) -> str:
2626 RUNTIMES .UR : "Unified Runtime" ,
2727 }[runtime ]
2828
29+ def runtime_to_tag_name (runtime : RUNTIMES ) -> str :
30+ return {
31+ RUNTIMES .SYCL : "sycl" ,
32+ RUNTIMES .LEVEL_ZERO : "L0" ,
33+ RUNTIMES .UR : "ur" ,
34+ }[runtime ]
35+
2936
3037class ComputeBench (Suite ):
3138 def __init__ (self , directory ):
@@ -77,10 +84,12 @@ def additionalMetadata(self) -> dict[str, BenchmarkMetadata]:
7784 "The first layer is the Level Zero API, the second is the Unified Runtime API, and the third is the SYCL API.\n "
7885 "The UR v2 adapter noticeably reduces UR layer overhead, also improving SYCL performance.\n "
7986 "Work is ongoing to reduce the overhead of the SYCL API\n " ,
87+ tags = translate_tags (['submit' , 'micro' ])
8088 ),
8189 "SinKernelGraph" : BenchmarkMetadata (
8290 type = "group" ,
8391 unstable = "This benchmark combines both eager and graph execution, and may not be representative of real use cases." ,
92+ tags = translate_tags (['submit' , 'micro' ])
8493 ),
8594 }
8695
@@ -265,6 +274,9 @@ def __init__(self, bench, runtime: RUNTIMES, ioq, measure_completion=0):
265274 bench , f"api_overhead_benchmark_{ runtime .value } " , "SubmitKernel"
266275 )
267276
277+ def get_tags (self ):
278+ return ['submit' , runtime_to_tag_name (self .runtime ), 'micro' ]
279+
268280 def name (self ):
269281 order = "in order" if self .ioq else "out of order"
270282 completion_str = " with measure completion" if self .measure_completion else ""
@@ -327,6 +339,9 @@ def description(self) -> str:
327339 f"{ self .destination } memory with { self .size } bytes. Tests immediate execution overheads."
328340 )
329341
342+ def get_tags (self ):
343+ return ['memory' , 'sycl' , 'micro' ]
344+
330345 def bin_args (self ) -> list [str ]:
331346 return [
332347 "--iterations=100000" ,
@@ -357,6 +372,9 @@ def description(self) -> str:
357372 f"{ self .source } to { self .destination } with { self .size } bytes, executed 100 times per iteration."
358373 )
359374
375+ def get_tags (self ):
376+ return ['memory' , 'sycl' , 'micro' ]
377+
360378 def bin_args (self ) -> list [str ]:
361379 return [
362380 "--iterations=10000" ,
@@ -384,6 +402,9 @@ def description(self) -> str:
384402 f"{ self .destination } with { self .size } bytes per operation."
385403 )
386404
405+ def get_tags (self ):
406+ return ['memory' , 'sycl' , 'micro' ]
407+
387408 def bin_args (self ) -> list [str ]:
388409 return [
389410 "--iterations=10000" ,
@@ -413,6 +434,9 @@ def description(self) -> str:
413434 def lower_is_better (self ):
414435 return False
415436
437+ def get_tags (self ):
438+ return ['memory' , 'sycl' , 'micro' ]
439+
416440 def bin_args (self ) -> list [str ]:
417441 return [
418442 "--iterations=10000" ,
@@ -439,6 +463,9 @@ def description(self) -> str:
439463 "using SYCL."
440464 )
441465
466+ def get_tags (self ):
467+ return ['math' , 'sycl' , 'micro' ]
468+
442469 def bin_args (self ) -> list [str ]:
443470 return [
444471 "--iterations=1000" ,
@@ -485,6 +512,9 @@ def description(self) -> str:
485512 f"from { src_type } to { dst_type } memory { events } events."
486513 )
487514
515+ def get_tags (self ):
516+ return ['memory' , 'ur' , 'micro' ]
517+
488518 def bin_args (self ) -> list [str ]:
489519 return [
490520 "--Ioq=1" ,
@@ -525,6 +555,9 @@ def name(self):
525555 def unstable (self ) -> str :
526556 return "This benchmark combines both eager and graph execution, and may not be representative of real use cases."
527557
558+ def get_tags (self ):
559+ return ['graph' , runtime_to_tag_name (self .runtime ), 'proxy' , 'submit' , 'memory' ]
560+
528561 def bin_args (self ) -> list [str ]:
529562 return [
530563 "--iterations=10000" ,
@@ -557,6 +590,9 @@ def description(self) -> str:
557590 def name (self ):
558591 return f"graph_api_benchmark_{ self .runtime .value } SubmitGraph numKernels:{ self .numKernels } ioq { self .inOrderQueue } measureCompletion { self .measureCompletionTime } "
559592
593+ def get_tags (self ):
594+ return ['graph' , runtime_to_tag_name (self .runtime ), 'micro' , 'submit' ]
595+
560596 def bin_args (self ) -> list [str ]:
561597 return [
562598 "--iterations=10000" ,
@@ -584,6 +620,9 @@ def description(self) -> str:
584620 def name (self ):
585621 return f"ulls_benchmark_{ self .runtime .value } EmptyKernel wgc:{ self .wgc } , wgs:{ self .wgs } "
586622
623+ def get_tags (self ):
624+ return [runtime_to_tag_name (self .runtime ), 'micro' ]
625+
587626 def bin_args (self ) -> list [str ]:
588627 return [
589628 "--iterations=10000" ,
@@ -622,6 +661,9 @@ def description(self) -> str:
622661 def name (self ):
623662 return f"ulls_benchmark_{ self .runtime .value } KernelSwitch count { self .count } kernelTime { self .kernelTime } "
624663
664+ def get_tags (self ):
665+ return [runtime_to_tag_name (self .runtime ), 'micro' ]
666+
625667 def bin_args (self ) -> list [str ]:
626668 return [
627669 "--iterations=1000" ,
0 commit comments