diff options
author | Dmitrii Agibov <dmitrii.agibov@arm.com> | 2023-02-15 14:58:37 +0000 |
---|---|---|
committer | Dmitrii Agibov <dmitrii.agibov@arm.com> | 2023-02-16 10:44:22 +0000 |
commit | a01e0e1229e30f9e2ebf3cd921ffe0dbef1cbea9 (patch) | |
tree | 811585649f513c2182f26a64751c986c7a66be83 /src | |
parent | df856cc9f20670ade3e84511f0fcbcc11425705d (diff) | |
download | mlia-a01e0e1229e30f9e2ebf3cd921ffe0dbef1cbea9.tar.gz |
MLIA-812 Show error message for unsupported functionality0.6.0-rc.2
Change-Id: I68fb8c4e51046e9fc2d91ad8338718ba545209cd
Diffstat (limited to 'src')
-rw-r--r-- | src/mlia/target/cortex_a/advisor.py | 10 | ||||
-rw-r--r-- | src/mlia/target/ethos_u/advisor.py | 4 | ||||
-rw-r--r-- | src/mlia/target/tosa/advisor.py | 8 |
3 files changed, 20 insertions, 2 deletions
diff --git a/src/mlia/target/cortex_a/advisor.py b/src/mlia/target/cortex_a/advisor.py index 5c077fb..3c127ec 100644 --- a/src/mlia/target/cortex_a/advisor.py +++ b/src/mlia/target/cortex_a/advisor.py @@ -44,6 +44,16 @@ class CortexAInferenceAdvisor(DefaultInferenceAdvisor): if context.category_enabled(AdviceCategory.COMPATIBILITY): collectors.append(CortexAOperatorCompatibility(model, target_config)) + if context.category_enabled(AdviceCategory.PERFORMANCE): + raise Exception( + "Performance estimation is currently not supported for Cortex-A." + ) + + if context.category_enabled(AdviceCategory.OPTIMIZATION): + raise Exception( + "Model optimizations are currently not supported for Cortex-A." + ) + return collectors def get_analyzers(self, context: Context) -> list[DataAnalyzer]: diff --git a/src/mlia/target/ethos_u/advisor.py b/src/mlia/target/ethos_u/advisor.py index 0eec6aa..714d6a4 100644 --- a/src/mlia/target/ethos_u/advisor.py +++ b/src/mlia/target/ethos_u/advisor.py @@ -53,9 +53,9 @@ class EthosUInferenceAdvisor(DefaultInferenceAdvisor): # Decide which one to use (taking into account the model format). if is_tflite_model(model): # TensorFlow Lite models do not support optimization (only performance)! - if context.advice_category == AdviceCategory.OPTIMIZATION: + if context.category_enabled(AdviceCategory.OPTIMIZATION): raise Exception( - "Command 'optimization' is not supported for TensorFlow Lite files." + "Optimizations are not supported for TensorFlow Lite files." ) if context.category_enabled(AdviceCategory.PERFORMANCE): collectors.append(EthosUPerformance(model, target_config, backends)) diff --git a/src/mlia/target/tosa/advisor.py b/src/mlia/target/tosa/advisor.py index 7666df4..7859eca 100644 --- a/src/mlia/target/tosa/advisor.py +++ b/src/mlia/target/tosa/advisor.py @@ -43,6 +43,14 @@ class TOSAInferenceAdvisor(DefaultInferenceAdvisor): if context.category_enabled(AdviceCategory.COMPATIBILITY): collectors.append(TOSAOperatorCompatibility(model)) + if context.category_enabled(AdviceCategory.PERFORMANCE): + raise Exception( + "Performance estimation is currently not supported for TOSA." + ) + + if context.category_enabled(AdviceCategory.OPTIMIZATION): + raise Exception("Model optimizations are currently not supported for TOSA.") + return collectors def get_analyzers(self, context: Context) -> list[DataAnalyzer]: |