Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions ci/data_extractor/src/benchmark_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def from_str(backend_name):
case "hpu":
return Backend.HPU
case _:
raise NotImplementedError
raise NotImplementedError(f"backend '{backend_name}' not supported")


class Layer(enum.StrEnum):
Expand Down Expand Up @@ -248,7 +248,12 @@ def from_param_name(name):
if not part.startswith("2M"):
continue

match int(part.lstrip("2M")):
try:
pfail_int_value = int(part.lstrip("2M"))
except ValueError:
raise ValueError(f"Could not parse p-fail value as integer in '{name}'")

match pfail_int_value:
case 40:
return ErrorFailureProbability.TWO_MINUS_40
case 64:
Expand Down Expand Up @@ -291,7 +296,7 @@ def from_str(bench_type):
case "throughput":
return BenchType.Throughput
case _:
raise ValueError(f"BenchType '{bench_type}' not supported")
raise NotImplementedError(f"BenchType '{bench_type}' not supported")


class ParamsDefinition:
Expand Down Expand Up @@ -529,14 +534,14 @@ def parse_test_name(self, name) -> None:
self.operation_name = parts[2] if parts[1] == "cuda" else parts[1]
case Layer.HLApi:
if parts[1] in ["cuda", "hpu"]:
if "_PARAM_" in parts[-2]:
if "PARAM_" in parts[-2]:
# Case for arithmetic operations (add, sub, mul,...)
self.operation_name = "::".join(parts[2:-2])
else:
# Case for higher-level operation (erc20 transfer, dex,...)
self.operation_name = "::".join(parts[2:-1])
else:
if "_PARAM_" in parts[-2]:
if "PARAM_" in parts[-2]:
# Case for arithmetic operations (add, sub, mul,...)
self.operation_name = "::".join(parts[1:-2])
else:
Expand Down
6 changes: 6 additions & 0 deletions ci/data_extractor/src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def convert_latency_value_to_readable_text(value: int, max_digits: int = 3) -> s

power_of_10 = math.floor(math.log10(converted_parts[0]))
rounding_digit = max_digits - (power_of_10 + 1)
if rounding_digit <= 0:
rounding_digit = None

if converted_parts[0] >= 100.0:
rounding_digit = None

Expand Down Expand Up @@ -68,6 +71,9 @@ def convert_throughput_value_to_readable_text(value: int, max_digits: int = 3):
else:
rounding_digit = None

if rounding_digit <= 0:
rounding_digit = None

if converted_parts[0] >= 100.0:
rounding_digit = None

Expand Down
7 changes: 7 additions & 0 deletions ci/data_extractor/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import os.path
import sys

# Add data_extractor sources to the Python path.
path = os.path.abspath(os.path.join(os.path.dirname(__file__), "../src"))
if path not in sys.path:
sys.path.insert(0, path)
Loading
Loading