diff options
author | Gergely Nagy <gergely.nagy@arm.com> | 2023-06-22 14:35:21 +0100 |
---|---|---|
committer | Benjamin Klimczak <benjamin.klimczak@arm.com> | 2023-10-11 16:16:11 +0100 |
commit | baaf4de286762c1955c874f78cd802d4703a8ba5 (patch) | |
tree | 3b80f906672f91e7e24723720b2d164d360f3edf /tests/test_target_cortex_a_advisor.py | |
parent | 3cd84481fa25e64c29e57396d4bf32d7a3ca490a (diff) | |
download | mlia-baaf4de286762c1955c874f78cd802d4703a8ba5.tar.gz |
Re-factoring of rewrite management & added metrics
- List available rewrites
- Refactor/rename 'Rewrite' class to 'RewritingOptimizer'
- Introduce a registry for rewrite functions
- Refactor 'Rewriter' to use the registry to look up rewrite functions
- Remove mentions of hardcoded "fully_connected" from CLI help and
error messages, using the registry instead
- Add unit tests
- Enable rewrites for all targets:
Extract optimization (including rewrite specific code) from the
Ethos-U-specific data collector into OptimizingDataCollector.
This is reused in other targets' collectors, such as TOSA
and Cortex-A.
- Add more logging for rewrite
- add display of MAE and NRMSE values for the trained result
- add total model MAE and NRMSE metric
Resolves: MLIA-891, MLIA-899, MLIA-906
Change-Id: Ie798749e1ed60cab14fdb6d9c2271c833960e93f
Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
Diffstat (limited to 'tests/test_target_cortex_a_advisor.py')
-rw-r--r-- | tests/test_target_cortex_a_advisor.py | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/tests/test_target_cortex_a_advisor.py b/tests/test_target_cortex_a_advisor.py index 9e0082f..6e370d6 100644 --- a/tests/test_target_cortex_a_advisor.py +++ b/tests/test_target_cortex_a_advisor.py @@ -31,7 +31,23 @@ def test_configure_and_get_cortex_a_advisor(test_tflite_model: Path) -> None: "cortex_a_inference_advisor": { "model": str(test_tflite_model), "target_profile": "cortex-a", - } + }, + "common_optimizations": { + "optimizations": [ + [ + { + "layers_to_optimize": None, + "optimization_target": 0.5, + "optimization_type": "pruning", + }, + { + "layers_to_optimize": None, + "optimization_target": 32, + "optimization_type": "clustering", + }, + ] + ] + }, } assert isinstance(workflow, DefaultWorkflowExecutor) @@ -43,11 +59,7 @@ def test_configure_and_get_cortex_a_advisor(test_tflite_model: Path) -> None: [ AdviceCategory.PERFORMANCE, "Performance estimation is currently not supported for Cortex-A.", - ], - [ - AdviceCategory.OPTIMIZATION, - "Model optimizations are currently not supported for Cortex-A.", - ], + ] ], ) def test_unsupported_advice_categories( |