aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnnie Tallund <annie.tallund@arm.com>2023-01-12 07:49:06 +0100
committerBenjamin Klimczak <benjamin.klimczak@arm.com>2023-02-08 15:23:29 +0000
commit836efd40317a397761ec8b66e3f4398faac43ad0 (patch)
tree5133ffd51d8d6772551333a4b337d36a501a8a91
parenta4fb8c72f15146c95df16c25e75f03344e9814fd (diff)
downloadmlia-836efd40317a397761ec8b66e3f4398faac43ad0.tar.gz
MLIA-770 List all available backends
- Rely on target and backend registry for support information - Make above information less Ethos(TM)-U specific Change-Id: I8dbfb84401016412a3d719a84eb592f21d79c46b
-rw-r--r--src/mlia/backend/corstone/performance.py4
-rw-r--r--src/mlia/backend/install.py24
-rw-r--r--src/mlia/backend/registry.py14
-rw-r--r--src/mlia/cli/command_validators.py4
-rw-r--r--src/mlia/cli/config.py25
-rw-r--r--src/mlia/target/ethos_u/performance.py10
-rw-r--r--src/mlia/target/registry.py24
-rw-r--r--tests/test_backend_corstone_performance.py66
-rw-r--r--tests/test_backend_install.py51
-rw-r--r--tests/test_cli_config.py12
10 files changed, 116 insertions, 118 deletions
diff --git a/src/mlia/backend/corstone/performance.py b/src/mlia/backend/corstone/performance.py
index 5aabfa5..531f0cd 100644
--- a/src/mlia/backend/corstone/performance.py
+++ b/src/mlia/backend/corstone/performance.py
@@ -1,4 +1,4 @@
-# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates.
+# SPDX-FileCopyrightText: Copyright 2022-2023, Arm Limited and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0
"""Module for backend integration."""
from __future__ import annotations
@@ -25,7 +25,7 @@ logger = logging.getLogger(__name__)
class DeviceInfo:
"""Device information."""
- device_type: Literal["ethos-u55", "ethos-u65"]
+ device_type: Literal["Ethos-U55", "Ethos-U65", "ethos-u55", "ethos-u65"]
mac: int
diff --git a/src/mlia/backend/install.py b/src/mlia/backend/install.py
index eea3403..37a277b 100644
--- a/src/mlia/backend/install.py
+++ b/src/mlia/backend/install.py
@@ -1,4 +1,4 @@
-# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates.
+# SPDX-FileCopyrightText: Copyright 2022-2023, Arm Limited and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0
"""Module for installation process."""
from __future__ import annotations
@@ -26,17 +26,20 @@ from mlia.utils.filesystem import temp_directory
from mlia.utils.filesystem import working_directory
from mlia.utils.py_manager import get_package_manager
-
logger = logging.getLogger(__name__)
# Mapping backend -> device_type -> system_name
_SUPPORTED_SYSTEMS = {
"Corstone-300": {
+ "Ethos-U55": "Corstone-300: Cortex-M55+Ethos-U55",
+ "Ethos-U65": "Corstone-300: Cortex-M55+Ethos-U65",
"ethos-u55": "Corstone-300: Cortex-M55+Ethos-U55",
"ethos-u65": "Corstone-300: Cortex-M55+Ethos-U65",
},
"Corstone-310": {
+ "Ethos-U55": "Corstone-310: Cortex-M85+Ethos-U55",
+ "Ethos-U65": "Corstone-310: Cortex-M85+Ethos-U65",
"ethos-u55": "Corstone-310: Cortex-M85+Ethos-U55",
"ethos-u65": "Corstone-310: Cortex-M85+Ethos-U65",
},
@@ -61,23 +64,6 @@ def get_application_name(system_name: str) -> str:
return _SYSTEM_TO_APP_MAP[system_name]
-def is_supported(backend: str, device_type: str | None = None) -> bool:
- """Check if the backend (and optionally device type) is supported."""
- if device_type is None:
- return backend in _SUPPORTED_SYSTEMS
-
- try:
- get_system_name(backend, device_type)
- return True
- except KeyError:
- return False
-
-
-def supported_backends() -> list[str]:
- """Get a list of all backends supported by the backend manager."""
- return list(_SUPPORTED_SYSTEMS.keys())
-
-
def get_all_system_names(backend: str) -> list[str]:
"""Get all systems supported by the backend."""
return list(_SUPPORTED_SYSTEMS.get(backend, {}).values())
diff --git a/src/mlia/backend/registry.py b/src/mlia/backend/registry.py
index 6a0da74..988c8c3 100644
--- a/src/mlia/backend/registry.py
+++ b/src/mlia/backend/registry.py
@@ -1,4 +1,4 @@
-# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates.
+# SPDX-FileCopyrightText: Copyright 2022-2023, Arm Limited and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0
"""Backend module."""
from mlia.backend.config import BackendConfiguration
@@ -6,3 +6,15 @@ from mlia.utils.registry import Registry
# All supported targets are required to be registered here.
registry = Registry[BackendConfiguration]()
+
+
+def get_supported_backends() -> list:
+ """Get a list of all backends supported by the backend manager."""
+ return sorted(list(registry.items.keys()))
+
+
+def get_supported_systems() -> dict:
+ """Get a list of all systems supported by the backend manager."""
+ return {
+ backend: config.supported_systems for backend, config in registry.items.items()
+ }
diff --git a/src/mlia/cli/command_validators.py b/src/mlia/cli/command_validators.py
index eb04192..8eb966b 100644
--- a/src/mlia/cli/command_validators.py
+++ b/src/mlia/cli/command_validators.py
@@ -7,7 +7,7 @@ import argparse
import logging
import sys
-from mlia.cli.config import get_default_backends
+from mlia.cli.config import get_default_backends_dict
from mlia.target.config import get_target
from mlia.target.registry import supported_backends
@@ -32,7 +32,7 @@ def validate_backend(
target = get_target(target_profile)
if not backend:
- return get_default_backends()[target]
+ return get_default_backends_dict()[target]
compatible_backends = supported_backends(target_map[target])
diff --git a/src/mlia/cli/config.py b/src/mlia/cli/config.py
index 680b4b6..0dac3e8 100644
--- a/src/mlia/cli/config.py
+++ b/src/mlia/cli/config.py
@@ -10,9 +10,9 @@ from typing import Optional
from typing import TypedDict
from mlia.backend.corstone.install import get_corstone_installations
-from mlia.backend.install import supported_backends
from mlia.backend.manager import DefaultInstallationManager
from mlia.backend.manager import InstallationManager
+from mlia.backend.registry import get_supported_backends
from mlia.backend.tosa_checker.install import get_tosa_backend_installation
logger = logging.getLogger(__name__)
@@ -32,25 +32,28 @@ def get_installation_manager(noninteractive: bool = False) -> InstallationManage
@lru_cache
def get_available_backends() -> list[str]:
"""Return list of the available backends."""
- available_backends = ["Vela", "tosa-checker", "armnn-tflitedelegate"]
-
# Add backends using backend manager
manager = get_installation_manager()
- available_backends.extend(
+ available_backends = [
backend
- for backend in supported_backends()
+ for backend in get_supported_backends()
if manager.backend_installed(backend)
- )
+ ]
return available_backends
# List of mutually exclusive Corstone backends ordered by priority
_CORSTONE_EXCLUSIVE_PRIORITY = ("Corstone-310", "Corstone-300")
-_NON_ETHOS_U_BACKENDS = ("tosa-checker", "armnn-tflitedelegate")
+_NON_ETHOS_U_BACKENDS = ("TOSA-Checker", "ArmNNTFLiteDelegate")
+
+
+def get_ethos_u_default_backends(backends: list[str]) -> list[str]:
+ """Get Ethos-U default backends for evaluation."""
+ return [x for x in backends if x not in _NON_ETHOS_U_BACKENDS]
-def get_ethos_u_default_backends() -> list[str]:
+def get_default_backends() -> list[str]:
"""Get default backends for evaluation."""
backends = get_available_backends()
@@ -64,8 +67,6 @@ def get_ethos_u_default_backends() -> list[str]:
]
break
- # Filter out non ethos-u backends
- backends = [x for x in backends if x not in _NON_ETHOS_U_BACKENDS]
return backends
@@ -86,9 +87,9 @@ BackendCompatibility = TypedDict(
)
-def get_default_backends() -> dict[str, list[str]]:
+def get_default_backends_dict() -> dict[str, list[str]]:
"""Return default backends for all targets."""
- ethos_u_defaults = get_ethos_u_default_backends()
+ ethos_u_defaults = get_ethos_u_default_backends(get_default_backends())
return {
"ethos-u55": ethos_u_defaults,
"ethos-u65": ethos_u_defaults,
diff --git a/src/mlia/target/ethos_u/performance.py b/src/mlia/target/ethos_u/performance.py
index e39f4d9..0d791a1 100644
--- a/src/mlia/target/ethos_u/performance.py
+++ b/src/mlia/target/ethos_u/performance.py
@@ -1,4 +1,4 @@
-# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates.
+# SPDX-FileCopyrightText: Copyright 2022-2023, Arm Limited and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0
"""Performance estimation."""
from __future__ import annotations
@@ -14,14 +14,14 @@ import mlia.backend.vela.performance as vela_perf
from mlia.backend.corstone.performance import DeviceInfo
from mlia.backend.corstone.performance import estimate_performance
from mlia.backend.corstone.performance import ModelInfo
-from mlia.backend.install import is_supported
-from mlia.backend.install import supported_backends
+from mlia.backend.registry import get_supported_backends
from mlia.core.context import Context
from mlia.core.performance import PerformanceEstimator
from mlia.nn.tensorflow.config import get_tflite_model
from mlia.nn.tensorflow.config import ModelConfiguration
from mlia.nn.tensorflow.optimizations.select import OptimizationSettings
from mlia.target.ethos_u.config import EthosUConfiguration
+from mlia.target.registry import is_supported
from mlia.utils.logging import log_action
@@ -226,7 +226,7 @@ class EthosUPerformanceEstimator(
if backend != "Vela" and not is_supported(backend):
raise ValueError(
f"Unsupported backend '{backend}'. "
- f"Only 'Vela' and {supported_backends()} "
+ f"Only 'Vela' and {get_supported_backends()} "
"are supported."
)
self.backends = set(backends)
@@ -246,7 +246,7 @@ class EthosUPerformanceEstimator(
if backend == "Vela":
vela_estimator = VelaPerformanceEstimator(self.context, self.device)
memory_usage = vela_estimator.estimate(tflite_model)
- elif backend in supported_backends():
+ elif backend in get_supported_backends():
corstone_estimator = CorstonePerformanceEstimator(
self.context, self.device, backend
)
diff --git a/src/mlia/target/registry.py b/src/mlia/target/registry.py
index 2d29f1b..325dd04 100644
--- a/src/mlia/target/registry.py
+++ b/src/mlia/target/registry.py
@@ -32,6 +32,30 @@ def supported_backends(target: str) -> list[str]:
return registry.items[target].filter_supported_backends(check_system=False)
+def get_backend_to_supported_targets() -> dict[str, list]:
+ """Get a dict that maps a list of supported targets given backend."""
+ targets = dict(registry.items)
+ supported_backends_dict: dict[str, list] = {}
+ for target, info in targets.items():
+ target_backends = info.supported_backends
+ for backend in target_backends:
+ supported_backends_dict.setdefault(backend, []).append(target)
+ return supported_backends_dict
+
+
+def is_supported(backend: str, target: str | None = None) -> bool:
+ """Check if the backend (and optionally target) is supported."""
+ backends = get_backend_to_supported_targets()
+ if target is None:
+ if backend in backends:
+ return True
+ return False
+ try:
+ return target in backends[backend]
+ except KeyError:
+ return False
+
+
def supported_targets(advice: AdviceCategory) -> list[str]:
"""Get a list of all targets supporting the given advice category."""
return [
diff --git a/tests/test_backend_corstone_performance.py b/tests/test_backend_corstone_performance.py
index 1734eb9..d41062f 100644
--- a/tests/test_backend_corstone_performance.py
+++ b/tests/test_backend_corstone_performance.py
@@ -1,4 +1,4 @@
-# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates.
+# SPDX-FileCopyrightText: Copyright 2022-2023, Arm Limited and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0
"""Tests for module backend/manager."""
from __future__ import annotations
@@ -25,9 +25,8 @@ from mlia.backend.executor.application import get_application
from mlia.backend.executor.execution import ExecutionContext
from mlia.backend.executor.output_consumer import Base64OutputConsumer
from mlia.backend.executor.system import get_system
-from mlia.backend.install import get_system_name
-from mlia.backend.install import is_supported
-from mlia.backend.install import supported_backends
+from mlia.backend.registry import get_supported_backends
+from mlia.target.registry import is_supported
def _mock_encode_b64(data: dict[str, int]) -> str:
@@ -150,14 +149,14 @@ def test_generic_inference_output_parser(
"device, system, application, backend, expected_error",
[
(
- DeviceInfo(device_type="ethos-u55", mac=32),
+ DeviceInfo(device_type="Ethos-U55", mac=32),
("Corstone-300: Cortex-M55+Ethos-U55", True),
("Generic Inference Runner: Ethos-U55", True),
"Corstone-300",
does_not_raise(),
),
(
- DeviceInfo(device_type="ethos-u55", mac=32),
+ DeviceInfo(device_type="Ethos-U55", mac=32),
("Corstone-300: Cortex-M55+Ethos-U55", False),
("Generic Inference Runner: Ethos-U55", False),
"Corstone-300",
@@ -167,7 +166,7 @@ def test_generic_inference_output_parser(
),
),
(
- DeviceInfo(device_type="ethos-u55", mac=32),
+ DeviceInfo(device_type="Ethos-U55", mac=32),
("Corstone-300: Cortex-M55+Ethos-U55", True),
("Generic Inference Runner: Ethos-U55", False),
"Corstone-300",
@@ -178,14 +177,14 @@ def test_generic_inference_output_parser(
),
),
(
- DeviceInfo(device_type="ethos-u55", mac=32),
+ DeviceInfo(device_type="Ethos-U55", mac=32),
("Corstone-310: Cortex-M85+Ethos-U55", True),
("Generic Inference Runner: Ethos-U55", True),
"Corstone-310",
does_not_raise(),
),
(
- DeviceInfo(device_type="ethos-u55", mac=32),
+ DeviceInfo(device_type="Ethos-U55", mac=32),
("Corstone-310: Cortex-M85+Ethos-U55", False),
("Generic Inference Runner: Ethos-U55", False),
"Corstone-310",
@@ -195,7 +194,7 @@ def test_generic_inference_output_parser(
),
),
(
- DeviceInfo(device_type="ethos-u55", mac=32),
+ DeviceInfo(device_type="Ethos-U55", mac=32),
("Corstone-310: Cortex-M85+Ethos-U55", True),
("Generic Inference Runner: Ethos-U55", False),
"Corstone-310",
@@ -206,14 +205,14 @@ def test_generic_inference_output_parser(
),
),
(
- DeviceInfo(device_type="ethos-u65", mac=512),
+ DeviceInfo(device_type="Ethos-U65", mac=512),
("Corstone-300: Cortex-M55+Ethos-U65", True),
("Generic Inference Runner: Ethos-U65", True),
"Corstone-300",
does_not_raise(),
),
(
- DeviceInfo(device_type="ethos-u65", mac=512),
+ DeviceInfo(device_type="Ethos-U65", mac=512),
("Corstone-300: Cortex-M55+Ethos-U65", False),
("Generic Inference Runner: Ethos-U65", False),
"Corstone-300",
@@ -223,7 +222,7 @@ def test_generic_inference_output_parser(
),
),
(
- DeviceInfo(device_type="ethos-u65", mac=512),
+ DeviceInfo(device_type="Ethos-U65", mac=512),
("Corstone-300: Cortex-M55+Ethos-U65", True),
("Generic Inference Runner: Ethos-U65", False),
"Corstone-300",
@@ -234,14 +233,14 @@ def test_generic_inference_output_parser(
),
),
(
- DeviceInfo(device_type="ethos-u65", mac=512),
+ DeviceInfo(device_type="Ethos-U65", mac=512),
("Corstone-310: Cortex-M85+Ethos-U65", True),
("Generic Inference Runner: Ethos-U65", True),
"Corstone-310",
does_not_raise(),
),
(
- DeviceInfo(device_type="ethos-u65", mac=512),
+ DeviceInfo(device_type="Ethos-U65", mac=512),
("Corstone-310: Cortex-M85+Ethos-U65", False),
("Generic Inference Runner: Ethos-U65", False),
"Corstone-310",
@@ -251,7 +250,7 @@ def test_generic_inference_output_parser(
),
),
(
- DeviceInfo(device_type="ethos-u65", mac=512),
+ DeviceInfo(device_type="Ethos-U65", mac=512),
("Corstone-310: Cortex-M85+Ethos-U65", True),
("Generic Inference Runner: Ethos-U65", False),
"Corstone-310",
@@ -349,7 +348,7 @@ def test_estimate_performance_insufficient_data(
with pytest.raises(
Exception, match="Unable to get performance metrics, insufficient data"
):
- device = DeviceInfo(device_type="ethos-u55", mac=32)
+ device = DeviceInfo(device_type="Ethos-U55", mac=32)
estimate_performance(ModelInfo(test_tflite_model), device, backend)
@@ -388,7 +387,7 @@ def test_estimate_performance_invalid_output(
with pytest.raises(Exception, match="Unable to get performance metrics"):
estimate_performance(
ModelInfo(test_tflite_model),
- DeviceInfo(device_type="ethos-u55", mac=256),
+ DeviceInfo(device_type="Ethos-U55", mac=256),
backend=backend,
)
@@ -396,7 +395,7 @@ def test_estimate_performance_invalid_output(
@pytest.mark.parametrize("backend", ("Corstone-300", "Corstone-310"))
def test_get_generic_runner(backend: str) -> None:
"""Test function get_generic_runner()."""
- device_info = DeviceInfo("ethos-u55", 256)
+ device_info = DeviceInfo("Ethos-U55", 256)
runner = get_generic_runner(device_info=device_info, backend=backend)
assert isinstance(runner, GenericInferenceRunnerEthosU)
@@ -408,9 +407,12 @@ def test_get_generic_runner(backend: str) -> None:
@pytest.mark.parametrize(
("backend", "device_type"),
(
- ("Corstone-300", "ethos-u55"),
- ("Corstone-300", "ethos-u65"),
- ("Corstone-310", "ethos-u55"),
+ ("Corstone-300", "Ethos-U55"),
+ ("Corstone-300", "Ethos-U65"),
+ ("Corstone-310", "Ethos-U55"),
+ ("ArmNNTFLiteDelegate", "Cortex-A"),
+ ("TOSA-Checker", "TOSA"),
+ ("Corstone-300", None),
),
)
def test_backend_support(backend: str, device_type: str) -> None:
@@ -418,9 +420,7 @@ def test_backend_support(backend: str, device_type: str) -> None:
assert is_supported(backend)
assert is_supported(backend, device_type)
- assert get_system_name(backend, device_type)
-
- assert backend in supported_backends()
+ assert backend in get_supported_backends()
class TestGenericInferenceRunnerEthosU:
@@ -431,25 +431,25 @@ class TestGenericInferenceRunnerEthosU:
"device, backend, expected_system, expected_app",
[
[
- DeviceInfo("ethos-u55", 256),
+ DeviceInfo("Ethos-U55", 256),
"Corstone-300",
"Corstone-300: Cortex-M55+Ethos-U55",
"Generic Inference Runner: Ethos-U55",
],
[
- DeviceInfo("ethos-u65", 256),
+ DeviceInfo("Ethos-U65", 256),
"Corstone-300",
"Corstone-300: Cortex-M55+Ethos-U65",
"Generic Inference Runner: Ethos-U65",
],
[
- DeviceInfo("ethos-u55", 256),
+ DeviceInfo("Ethos-U55", 256),
"Corstone-310",
"Corstone-310: Cortex-M85+Ethos-U55",
"Generic Inference Runner: Ethos-U55",
],
[
- DeviceInfo("ethos-u65", 256),
+ DeviceInfo("Ethos-U65", 256),
"Corstone-310",
"Corstone-310: Cortex-M85+Ethos-U65",
"Generic Inference Runner: Ethos-U65",
@@ -470,9 +470,9 @@ class TestGenericInferenceRunnerEthosU:
def test_artifact_resolver_unsupported_backend() -> None:
"""Test that it should be not possible to use unsupported backends."""
with pytest.raises(
- RuntimeError, match="Unsupported device ethos-u65 for backend test_backend"
+ RuntimeError, match="Unsupported device Ethos-U65 for backend test_backend"
):
- get_generic_runner(DeviceInfo("ethos-u65", 256), "test_backend")
+ get_generic_runner(DeviceInfo("Ethos-U65", 256), "test_backend")
@staticmethod
@pytest.mark.parametrize("backend", ("Corstone-300", "Corstone-310"))
@@ -482,7 +482,7 @@ class TestGenericInferenceRunnerEthosU:
"""Test that inference should fail if system is not installed."""
backend_runner.is_system_installed.return_value = False
- generic_runner = get_generic_runner(DeviceInfo("ethos-u55", 256), backend)
+ generic_runner = get_generic_runner(DeviceInfo("Ethos-U55", 256), backend)
with pytest.raises(
Exception,
match=r"System Corstone-3[01]0: Cortex-M[58]5\+Ethos-U55 is not installed",
@@ -498,7 +498,7 @@ class TestGenericInferenceRunnerEthosU:
backend_runner.is_system_installed.return_value = True
backend_runner.is_application_installed.return_value = False
- generic_runner = get_generic_runner(DeviceInfo("ethos-u55", 256), backend)
+ generic_runner = get_generic_runner(DeviceInfo("Ethos-U55", 256), backend)
with pytest.raises(
Exception,
match="Application Generic Inference Runner: Ethos-U55"
diff --git a/tests/test_backend_install.py b/tests/test_backend_install.py
index 024a833..c3efe09 100644
--- a/tests/test_backend_install.py
+++ b/tests/test_backend_install.py
@@ -1,4 +1,4 @@
-# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates.
+# SPDX-FileCopyrightText: Copyright 2022-2023, Arm Limited and/or its affiliates.
# SPDX-License-Identifier: Apache-2.0
"""Tests for common management functionality."""
from __future__ import annotations
@@ -9,11 +9,9 @@ import pytest
from mlia.backend.install import BackendInfo
from mlia.backend.install import get_all_application_names
-from mlia.backend.install import get_all_system_names
-from mlia.backend.install import get_system_name
-from mlia.backend.install import is_supported
from mlia.backend.install import StaticPathChecker
-from mlia.backend.install import supported_backends
+from mlia.backend.registry import get_supported_backends
+from mlia.target.registry import is_supported
@pytest.mark.parametrize(
@@ -49,7 +47,13 @@ def test_static_path_checker_invalid_path(tmp_path: Path) -> None:
def test_supported_backends() -> None:
"""Test function supported backends."""
- assert supported_backends() == ["Corstone-300", "Corstone-310"]
+ assert get_supported_backends() == [
+ "ArmNNTFLiteDelegate",
+ "Corstone-300",
+ "Corstone-310",
+ "TOSA-Checker",
+ "Vela",
+ ]
@pytest.mark.parametrize(
@@ -71,30 +75,6 @@ def test_is_supported(backend: str, expected_result: bool) -> None:
[
"Corstone-300",
[
- "Corstone-300: Cortex-M55+Ethos-U55",
- "Corstone-300: Cortex-M55+Ethos-U65",
- ],
- ],
- [
- "Corstone-310",
- [
- "Corstone-310: Cortex-M85+Ethos-U55",
- "Corstone-310: Cortex-M85+Ethos-U65",
- ],
- ],
- ],
-)
-def test_get_all_system_names(backend: str, expected_result: list[str]) -> None:
- """Test function get_all_system_names."""
- assert sorted(get_all_system_names(backend)) == expected_result
-
-
-@pytest.mark.parametrize(
- "backend, expected_result",
- [
- [
- "Corstone-300",
- [
"Generic Inference Runner: Ethos-U55",
"Generic Inference Runner: Ethos-U65",
],
@@ -111,14 +91,3 @@ def test_get_all_system_names(backend: str, expected_result: list[str]) -> None:
def test_get_all_application_names(backend: str, expected_result: list[str]) -> None:
"""Test function get_all_application_names."""
assert sorted(get_all_application_names(backend)) == expected_result
-
-
-def test_get_system_name() -> None:
- """Test function get_system_name."""
- assert (
- get_system_name("Corstone-300", "ethos-u55")
- == "Corstone-300: Cortex-M55+Ethos-U55"
- )
-
- with pytest.raises(KeyError):
- get_system_name("some_backend", "some_type")
diff --git a/tests/test_cli_config.py b/tests/test_cli_config.py
index b007052..1487f11 100644
--- a/tests/test_cli_config.py
+++ b/tests/test_cli_config.py
@@ -7,7 +7,7 @@ from unittest.mock import MagicMock
import pytest
-from mlia.cli.config import get_ethos_u_default_backends
+from mlia.cli.config import get_default_backends
from mlia.cli.config import is_corstone_backend
@@ -27,9 +27,15 @@ from mlia.cli.config import is_corstone_backend
["Vela", "Corstone-300", "New backend"],
["Vela", "Corstone-300", "New backend"],
],
+ [["ArmNNTFLiteDelegate"], ["ArmNNTFLiteDelegate"]],
+ [["TOSA-Checker"], ["TOSA-Checker"]],
+ [
+ ["ArmNNTFLiteDelegate", "Corstone-300"],
+ ["ArmNNTFLiteDelegate", "Corstone-300"],
+ ],
],
)
-def test_get_ethos_u_default_backends(
+def test_get_default_backends(
monkeypatch: pytest.MonkeyPatch,
available_backends: list[str],
expected_default_backends: list[str],
@@ -40,7 +46,7 @@ def test_get_ethos_u_default_backends(
MagicMock(return_value=available_backends),
)
- assert get_ethos_u_default_backends() == expected_default_backends
+ assert get_default_backends() == expected_default_backends
def test_is_corstone_backend() -> None: