diff options
author | Raul Farkas <raul.farkas@arm.com> | 2022-11-04 16:12:52 +0000 |
---|---|---|
committer | Raul Farkas <raul.farkas@arm.com> | 2022-11-07 11:56:49 +0000 |
commit | 27668f6837c4f0a7197d13baff7bffc11f652fba (patch) | |
tree | fc363c7538d8f62ea841a55ec7d912bf9f41d446 /src/mlia/api.py | |
parent | e356ab410ff9c1d36186cac57ca7457964ef97f2 (diff) | |
download | mlia-27668f6837c4f0a7197d13baff7bffc11f652fba.tar.gz |
MLIA-688 Fix --supported-ops-report flag
* Add `api.generate_supported_operators_report` that calls
a report generator based on given target profile.
* Update `--supported-ops-report` cli flag help section and README.md
info by specifying that it is currently only supported for Ethos-U.
* Add tests for `generate_supported_operators_report` method.
* Add stub methods `report` for Cortex-A
and Tosa operators.py module that throw a "Not supported" exception.
Change-Id: Iaf373fe48299d807e48fd6a0e6c029ce32203f4f
Diffstat (limited to 'src/mlia/api.py')
-rw-r--r-- | src/mlia/api.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/mlia/api.py b/src/mlia/api.py index fc61af0..6af7db2 100644 --- a/src/mlia/api.py +++ b/src/mlia/api.py @@ -13,11 +13,13 @@ from mlia.core.common import AdviceCategory from mlia.core.context import ExecutionContext from mlia.core.typing import PathOrFileLike from mlia.devices.cortexa.advisor import configure_and_get_cortexa_advisor +from mlia.devices.cortexa.operators import report as cortex_a_report from mlia.devices.ethosu.advisor import configure_and_get_ethosu_advisor +from mlia.devices.ethosu.operators import report as ethos_u_report from mlia.devices.tosa.advisor import configure_and_get_tosa_advisor +from mlia.devices.tosa.operators import report as tosa_report from mlia.utils.filesystem import get_target - logger = logging.getLogger(__name__) @@ -121,3 +123,17 @@ def get_advisor( output, **extra_args, ) + + +def generate_supported_operators_report(target_profile: str) -> None: + """Generate a supported operators report based on given target profile.""" + generators_map = { + "ethos-u55": ethos_u_report, + "ethos-u65": ethos_u_report, + "cortex-a": cortex_a_report, + "tosa": tosa_report, + } + + target = get_target(target_profile) + + generators_map[target]() |