diff options
author | Benjamin Klimczak <benjamin.klimczak@arm.com> | 2023-01-11 12:32:02 +0000 |
---|---|---|
committer | Benjamin Klimczak <benjamin.klimczak@arm.com> | 2023-02-08 15:23:29 +0000 |
commit | a4fb8c72f15146c95df16c25e75f03344e9814fd (patch) | |
tree | ce6d9cf39951a0c85d2773d436cc5010ecf78a8f /tests/test_backend_vela_performance.py | |
parent | 09ecc5c8acb758e8def33155feb746a34dd7b560 (diff) | |
download | mlia-a4fb8c72f15146c95df16c25e75f03344e9814fd.tar.gz |
MLIA-591 Create interface for target profiles
New class 'TargetProfile' is used to load and verify target profiles.
Change-Id: I76373a923e2e5f55c4e95860635afe9fc5627a5d
Diffstat (limited to 'tests/test_backend_vela_performance.py')
-rw-r--r-- | tests/test_backend_vela_performance.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_backend_vela_performance.py b/tests/test_backend_vela_performance.py index 34c11ab..569de61 100644 --- a/tests/test_backend_vela_performance.py +++ b/tests/test_backend_vela_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 vela/performance.""" from pathlib import Path @@ -14,7 +14,7 @@ from mlia.target.ethos_u.config import EthosUConfiguration def test_estimate_performance(test_tflite_model: Path) -> None: """Test getting performance estimations.""" - device = EthosUConfiguration("ethos-u55-256") + device = EthosUConfiguration.load_profile("ethos-u55-256") perf_metrics = estimate_performance(test_tflite_model, device.compiler_options) assert isinstance(perf_metrics, PerformanceMetrics) @@ -24,7 +24,7 @@ def test_estimate_performance_already_optimized( tmp_path: Path, test_tflite_model: Path ) -> None: """Test that performance estimation should fail for already optimized model.""" - device = EthosUConfiguration("ethos-u55-256") + device = EthosUConfiguration.load_profile("ethos-u55-256") optimized_model_path = tmp_path / "optimized_model.tflite" @@ -41,7 +41,7 @@ def test_read_invalid_model(test_tflite_invalid_model: Path) -> None: with pytest.raises( Exception, match=f"Unable to read model {test_tflite_invalid_model}" ): - device = EthosUConfiguration("ethos-u55-256") + device = EthosUConfiguration.load_profile("ethos-u55-256") estimate_performance(test_tflite_invalid_model, device.compiler_options) @@ -58,7 +58,7 @@ def test_compile_invalid_model( with pytest.raises( Exception, match="Model could not be optimized with Vela compiler" ): - device = EthosUConfiguration("ethos-u55-256") + device = EthosUConfiguration.load_profile("ethos-u55-256") optimize_model(test_tflite_model, device.compiler_options, model_path) assert not model_path.exists() |