From 718277eaece76902c4950f18d428907b39a18ef1 Mon Sep 17 00:00:00 2001 From: Benjamin Klimczak Date: Fri, 10 Feb 2023 13:12:57 +0000 Subject: 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 --- src/mlia/backend/corstone/__init__.py | 8 ++++++-- src/mlia/backend/corstone/install.py | 4 ++-- src/mlia/backend/corstone/performance.py | 14 +++++++------- 3 files changed, 15 insertions(+), 11 deletions(-) (limited to 'src/mlia/backend/corstone') 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)] -- cgit v1.2.1