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/target/cortex_a/__init__.py | 5 +++-- src/mlia/target/cortex_a/events.py | 2 +- src/mlia/target/cortex_a/handlers.py | 2 +- src/mlia/target/cortex_a/reporters.py | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/mlia/target/cortex_a') diff --git a/src/mlia/target/cortex_a/__init__.py b/src/mlia/target/cortex_a/__init__.py index 87f268a..729dd30 100644 --- a/src/mlia/target/cortex_a/__init__.py +++ b/src/mlia/target/cortex_a/__init__.py @@ -9,9 +9,10 @@ from mlia.target.registry import TargetInfo registry.register( "cortex-a", TargetInfo( - supported_backends=["ArmNNTFLiteDelegate"], - default_backends=["ArmNNTFLiteDelegate"], + supported_backends=["armnn-tflite-delegate"], + default_backends=["armnn-tflite-delegate"], advisor_factory_func=configure_and_get_cortexa_advisor, target_profile_cls=CortexAConfiguration, ), + pretty_name="Cortex-A", ) diff --git a/src/mlia/target/cortex_a/events.py b/src/mlia/target/cortex_a/events.py index 76f17ba..675335d 100644 --- a/src/mlia/target/cortex_a/events.py +++ b/src/mlia/target/cortex_a/events.py @@ -14,7 +14,7 @@ class CortexAAdvisorStartedEvent(Event): """Event with Cortex-A advisor parameters.""" model: Path - target: CortexAConfiguration + target_config: CortexAConfiguration class CortexAAdvisorEventHandler(EventDispatcher): diff --git a/src/mlia/target/cortex_a/handlers.py b/src/mlia/target/cortex_a/handlers.py index d46197c..a952c39 100644 --- a/src/mlia/target/cortex_a/handlers.py +++ b/src/mlia/target/cortex_a/handlers.py @@ -35,4 +35,4 @@ class CortexAEventHandler(WorkflowEventsHandler, CortexAAdvisorEventHandler): def on_cortex_a_advisor_started(self, event: CortexAAdvisorStartedEvent) -> None: """Handle CortexAAdvisorStarted event.""" - self.reporter.submit(event.target) + self.reporter.submit(event.target_config) diff --git a/src/mlia/target/cortex_a/reporters.py b/src/mlia/target/cortex_a/reporters.py index e23bf4d..d214b09 100644 --- a/src/mlia/target/cortex_a/reporters.py +++ b/src/mlia/target/cortex_a/reporters.py @@ -23,13 +23,13 @@ from mlia.utils.console import style_improvement from mlia.utils.types import is_list_of -def report_target(target: CortexAConfiguration) -> Report: +def report_target(target_config: CortexAConfiguration) -> Report: """Generate report for the target.""" return NestedReport( "Target information", "target", [ - ReportItem("Target", alias="target", value=target.target), + ReportItem("Target", alias="target", value=target_config.target), ], ) -- cgit v1.2.1