aboutsummaryrefslogtreecommitdiff
path: root/src/mlia/backend
diff options
context:
space:
mode:
authorBenjamin Klimczak <benjamin.klimczak@arm.com>2023-02-10 13:12:57 +0000
committerBenjamin Klimczak <benjamin.klimczak@arm.com>2023-02-10 14:56:43 +0000
commit718277eaece76902c4950f18d428907b39a18ef1 (patch)
tree6fda1b8f8c2c0151f3697a2e9f31c2f5551cc2ff /src/mlia/backend
parentfa1fad9332e2912f12a44a1b07716ee434174308 (diff)
downloadmlia-718277eaece76902c4950f18d428907b39a18ef1.tar.gz
MLIA-769 Add "pretty names" for targets / backends
- Provide "pretty names" to print information for targets and backends. - Use 'target_config' instead of 'target' if a target profile is used. - Fix minor issue in output regarding the output directory. Change-Id: Ib38231f30b4d609a0d1e8f9c52b2fb547c69cb6a
Diffstat (limited to 'src/mlia/backend')
-rw-r--r--src/mlia/backend/armnn_tflite_delegate/__init__.py4
-rw-r--r--src/mlia/backend/corstone/__init__.py8
-rw-r--r--src/mlia/backend/corstone/install.py4
-rw-r--r--src/mlia/backend/corstone/performance.py14
-rw-r--r--src/mlia/backend/tosa_checker/__init__.py1
-rw-r--r--src/mlia/backend/vela/__init__.py3
6 files changed, 21 insertions, 13 deletions
diff --git a/src/mlia/backend/armnn_tflite_delegate/__init__.py b/src/mlia/backend/armnn_tflite_delegate/__init__.py
index ccb7e38..4fe8639 100644
--- a/src/mlia/backend/armnn_tflite_delegate/__init__.py
+++ b/src/mlia/backend/armnn_tflite_delegate/__init__.py
@@ -1,16 +1,18 @@
# SPDX-FileCopyrightText: Copyright 2022-2023, Arm Limited and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0
"""Arm NN TensorFlow Lite delegate backend module."""
+from mlia.backend.armnn_tflite_delegate.compat import ARMNN_TFLITE_DELEGATE
from mlia.backend.config import BackendConfiguration
from mlia.backend.config import BackendType
from mlia.backend.registry import registry
from mlia.core.common import AdviceCategory
registry.register(
- "ArmNNTFLiteDelegate",
+ "armnn-tflite-delegate",
BackendConfiguration(
supported_advice=[AdviceCategory.COMPATIBILITY],
supported_systems=None,
backend_type=BackendType.BUILTIN,
),
+ pretty_name=ARMNN_TFLITE_DELEGATE["metadata"]["backend"],
)
diff --git a/src/mlia/backend/corstone/__init__.py b/src/mlia/backend/corstone/__init__.py
index b59ab65..5aa688b 100644
--- a/src/mlia/backend/corstone/__init__.py
+++ b/src/mlia/backend/corstone/__init__.py
@@ -12,15 +12,19 @@ CORSTONE_PRIORITY = ("Corstone-310", "Corstone-300")
for corstone_name in CORSTONE_PRIORITY:
registry.register(
- corstone_name,
+ corstone_name.lower(),
BackendConfiguration(
supported_advice=[AdviceCategory.PERFORMANCE, AdviceCategory.OPTIMIZATION],
supported_systems=[System.LINUX_AMD64],
backend_type=BackendType.CUSTOM,
),
+ pretty_name=corstone_name,
)
def is_corstone_backend(backend_name: str) -> bool:
"""Check if backend belongs to Corstone."""
- return backend_name in CORSTONE_PRIORITY
+ return any(
+ name in CORSTONE_PRIORITY
+ for name in (backend_name, registry.pretty_name(backend_name))
+ )
diff --git a/src/mlia/backend/corstone/install.py b/src/mlia/backend/corstone/install.py
index c57a47b..35976cf 100644
--- a/src/mlia/backend/corstone/install.py
+++ b/src/mlia/backend/corstone/install.py
@@ -62,7 +62,7 @@ def get_corstone_300_installation() -> Installation:
"""Get Corstone-300 installation."""
corstone_300 = BackendInstallation(
# pylint: disable=line-too-long
- name="Corstone-300",
+ name="corstone-300",
description="Corstone-300 FVP",
fvp_dir_name="corstone_300",
download_artifact=DownloadArtifact(
@@ -102,7 +102,7 @@ def get_corstone_300_installation() -> Installation:
def get_corstone_310_installation() -> Installation:
"""Get Corstone-310 installation."""
corstone_310 = BackendInstallation(
- name="Corstone-310",
+ name="corstone-310",
description="Corstone-310 FVP",
fvp_dir_name="corstone_310",
download_artifact=None,
diff --git a/src/mlia/backend/corstone/performance.py b/src/mlia/backend/corstone/performance.py
index 8fd3e40..5012821 100644
--- a/src/mlia/backend/corstone/performance.py
+++ b/src/mlia/backend/corstone/performance.py
@@ -95,7 +95,7 @@ def get_generic_inference_app_path(fvp: str, target: str) -> Path:
"""Return path to the generic inference runner binary."""
apps_path = get_mlia_resources() / "backends/applications"
- fvp_mapping = {"Corstone-300": "300", "Corstone-310": "310"}
+ fvp_mapping = {"corstone-300": "300", "corstone-310": "310"}
target_mapping = {"ethos-u55": "U55", "ethos-u65": "U65"}
fvp_version = f"sse-{fvp_mapping[fvp]}"
@@ -108,12 +108,12 @@ def get_generic_inference_app_path(fvp: str, target: str) -> Path:
def get_executable_name(fvp: str, profile: str, target: str) -> str:
"""Return name of the executable for selected FVP and profile."""
executable_name_mapping = {
- ("Corstone-300", "AVH", "ethos-u55"): "VHT_Corstone_SSE-300_Ethos-U55",
- ("Corstone-300", "AVH", "ethos-u65"): "VHT_Corstone_SSE-300_Ethos-U65",
- ("Corstone-300", "default", "ethos-u55"): "FVP_Corstone_SSE-300_Ethos-U55",
- ("Corstone-300", "default", "ethos-u65"): "FVP_Corstone_SSE-300_Ethos-U65",
- ("Corstone-310", "AVH", "ethos-u55"): "VHT_Corstone_SSE-310",
- ("Corstone-310", "AVH", "ethos-u65"): "VHT_Corstone_SSE-310_Ethos-U65",
+ ("corstone-300", "AVH", "ethos-u55"): "VHT_Corstone_SSE-300_Ethos-U55",
+ ("corstone-300", "AVH", "ethos-u65"): "VHT_Corstone_SSE-300_Ethos-U65",
+ ("corstone-300", "default", "ethos-u55"): "FVP_Corstone_SSE-300_Ethos-U55",
+ ("corstone-300", "default", "ethos-u65"): "FVP_Corstone_SSE-300_Ethos-U65",
+ ("corstone-310", "AVH", "ethos-u55"): "VHT_Corstone_SSE-310",
+ ("corstone-310", "AVH", "ethos-u65"): "VHT_Corstone_SSE-310_Ethos-U65",
}
return executable_name_mapping[(fvp, profile, target)]
diff --git a/src/mlia/backend/tosa_checker/__init__.py b/src/mlia/backend/tosa_checker/__init__.py
index e11034f..d2364cb 100644
--- a/src/mlia/backend/tosa_checker/__init__.py
+++ b/src/mlia/backend/tosa_checker/__init__.py
@@ -14,4 +14,5 @@ registry.register(
supported_systems=[System.LINUX_AMD64],
backend_type=BackendType.WHEEL,
),
+ pretty_name="TOSA Checker",
)
diff --git a/src/mlia/backend/vela/__init__.py b/src/mlia/backend/vela/__init__.py
index 68fbcba..7325630 100644
--- a/src/mlia/backend/vela/__init__.py
+++ b/src/mlia/backend/vela/__init__.py
@@ -8,7 +8,7 @@ from mlia.backend.registry import registry
from mlia.core.common import AdviceCategory
registry.register(
- "Vela",
+ "vela",
BackendConfiguration(
supported_advice=[
AdviceCategory.COMPATIBILITY,
@@ -23,4 +23,5 @@ registry.register(
],
backend_type=BackendType.BUILTIN,
),
+ pretty_name="Vela",
)