aboutsummaryrefslogtreecommitdiff
path: root/src/mlia/cli/main.py
AgeCommit message (Collapse)Author
2024-03-14feat: Enable rewrite parameterisationNathan Bailey
Enables user to provide a toml or default profile to change training settings for rewrite optimization Resolves: MLIA-1004 Signed-off-by: Nathan Bailey <nathan.bailey@arm.com> Change-Id: I3bf9f44b9a2062fb71ef36eb32c9a69edcc48061
2023-10-11Add a CLI component to enable rewritesRuomei Yan
* Add flags for rewrite (--rewrite, --rewrite-start, --rewrite-end, --rewrite-target) * Refactor CLI interfaces to accept tflite models with optimize for rewrite, keras models with optimize for clustering and pruning * Refactor and move common.py and select.py out of the folder nn/tensorflow/optimizations * Add file nn/rewrite/core/rewrite.py as placeholder * Update/add unit tests * Refactor OptimizeModel in ethos_u/data_collection.py for accepting tflite model case * Extend the logic so that if "--rewrite" is specified, we don't add pruning to also accept TFLite models. * Update README.md Resolves: MLIA-750, MLIA-854, MLIA-865 Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com> Change-Id: I67d85f71fa253d2bad4efe304ad8225970b9622c
2023-02-21MLIA-813 Change default output directory0.6.0-rc.30.6.0Dmitrii Agibov
- Use directory mlia-output as output directory for MLIA - If parameter --output-dir provided then place directory mlia-output under specified path or otherwise create it in the current working directory Change-Id: I298088c4aa8dbe9f35dee69ecb9ff6e9ea3cac0a
2023-02-10MLIA-769 Add "pretty names" for targets / backendsBenjamin Klimczak
- Provide "pretty names" to print information for targets and backends. - Use 'target_config' instead of 'target' if a target profile is used. - Fix minor issue in output regarding the output directory. Change-Id: Ib38231f30b4d609a0d1e8f9c52b2fb547c69cb6a
2023-02-10MLIA-769 Expand use of target/backend registriesBenjamin Klimczak
- Use the target/backend registries to avoid hard-coded names. - Cache target profiles to avoid re-loading them Change-Id: I474b7c9ef23894e1d8a3ea06d13a37652054c62e
2023-02-10MLIA-594 Save target profile configurationAnnie Tallund
Save the target profile file in the output directory. Change-Id: I886e52cb922c5425e749b154bd67a5d294ce0201
2023-02-08MLIA-595 Remove old backend configuration mechanismDmitrii Agibov
- Remove old backend configuration code - Install backends into directory ~/.mlia - Rename targets/backends in registry to make it consistent across codebase. Change-Id: I9c8b012fe863280f1c692940c0dcad3ef638aaae
2023-02-08MLIA-737 Show connection between target / backendBenjamin Klimczak
- The help text of MLIA now shows a table of supported targets, backends and advice. - The table is only shown with the help message and not when MLIA is run normally. Change-Id: I3234ce91e943de4b08b9471bd95a474df34755f7
2023-02-06MLIA-461 Add parameter for the output directoryDmitrii Agibov
- Add CLI parameter --output-dir - Rename ExecutionContext property working_dir into output_dir - Remove logic for default command as it is no longer needed Change-Id: I6387f6b688520ba1fc69a80167587297353620f6
2023-02-03MLIA-782 Remove --output parameterDiego Russo
* Remove --output parameter from argument parser * Remove FormattedFilePath class and its presence across the codebase * Move logging module from cli to core * The output format is now injected in the execution context and used across MLIA * Depending on the output format, TextReporter and JSONReporter have been created and used accordingly. * The whole output to standard output and/or logfile is driven via the logging module: the only case where the print is used is when the --json parameter is specified. This is needed becase all output (including third party application as well) needs to be disabled otherwise it might corrupt the json output in the standard output. * Debug information is logged into the log file and printed to stdout when the output format is plain_text. * Update E2E test and config to cope with the new mechanism of outputting json data to standard output. Change-Id: I4395800b0b1af4d24406a828d780bdeef98cd413
2023-01-10MLIA-650 Implement new CLI changesRaul Farkas
Breaking change in the CLI and API: Sub-commands "optimization", "operators", and "performance" were replaced by "check", which incorporates compatibility and performance checks, and "optimize" which is used for optimization. "get_advice" API was adapted to these CLI changes. API changes: * Remove previous advice category "all" that would perform all three operations (when possible). Replace them with the ability to pass a set of the advice categories. * Update api.get_advice method docstring to reflect new changes. * Set default advice category to COMPATIBILITY * Update core.common.AdviceCategory by changing the "OPERATORS" advice category to "COMPATIBILITY" and removing "ALL" enum type. Update all subsequent methods that previously used "OPERATORS" to use "COMPATIBILITY". * Update core.context.ExecutionContext to have "COMPATIBILITY" as default advice_category instead of "ALL". * Remove api.generate_supported_operators_report and all related functions from cli.commands, cli.helpers, cli.main, cli.options, core.helpers * Update tests to reflect new API changes. CLI changes: * Update README.md to contain information on the new CLI * Remove the ability to generate supported operators support from MLIA CLI * Replace `mlia ops` and `mlia perf` with the new `mlia check` command that can be used to perform both operations. * Replace `mlia opt` with the new `mlia optimize` command. * Replace `--evaluate-on` flag with `--backend` flag * Replace `--verbose` flag with `--debug` flag (no behaviour change). * Remove the ability for the user to select MLIA working directory. Create and use a temporary directory in /temp instead. * Change behaviour of `--output` flag to not format the content automatically based on file extension anymore. Instead it will simply redirect to a file. * Add the `--json` flag to specfy that the format of the output should be json. * Add command validators that are used to validate inter-dependent flags (e.g. backend validation based on target_profile). * Add support for selecting built-in backends for both `check` and `optimize` commands. * Add new unit tests and update old ones to test the new CLI changes. * Update RELEASES.md * Update copyright notice Change-Id: Ia6340797c7bee3acbbd26601950e5a16ad5602db
2023-01-04MLIA-589 Create an API to get target informationBenjamin Klimczak
Change-Id: Ieeaa9188ea1e29e2ccaad7475d457bce71e3140d
2022-12-16MLIA-460 Revisit backend managementDmitrii Agibov
- Provide command for backend installation in case if backend is not available - Fix issue with connection timeout during downloading - Show installation tools output only in verbose mode Change-Id: Ic0e495ba19879cc2cda4fd0bce20b57ba896cfeb
2022-11-21Improve the CLI outputBenjamin Klimczak
Resolves: MLIA-719, MLIA-720 Change-Id: Ib697046f5090260437f3b1ab5fe8c5b4975abae2
2022-11-16MLIA-649 Support tosa-checker as a backendDmitrii Agibov
- Add new type of the backend based on python packages - Add installation class for TOSA checker - Update documentation - Extend support of the parameter "force" in the "install" command Change-Id: I95567b75e1cfe85daa1f1c3d359975bb67b2504e
2022-11-15MLIA-649 Strip mlia backend management into a new commandRuomei Yan
* add entry point for mlia-backend in setup.cfg and main.py * add --force option for install from path: uninstall existing backend in ML Inference Advisor and install from given path * add uninstall and list program parameters: uninstall has backend_name as input arg, install has backend_name as a mandatory argument * add unit tests in test_cli_commands.py, test_cli_main.py, test_tools_metadata_common.py, test_tools_metadata_corstone.py * updated README.md * remove --download option for installing backend * add new lines for the display section when we do mlia-backen list * add case insensitive support for backend names in command line argument Change-Id: Icb89d8957fa6be4b767710e24fa074f26472674b
2022-11-10MLIA-411 Report Cortex-A operator compatibilityBenjamin Klimczak
Check input model for Arm NN TensorFlow Lite Delegate 22.08 support. Change-Id: I1253c4c0b294c5283e08f0a39561b922ef0f62e6
2022-10-18MLIA-409 Create new Cortex-A device skeletonRaul Farkas
* Add Cortex-A device skeleton * Add unit tests for the Cortex-A device skeleton * Update profiles.json by adding the new "cortex-a" profile * Add new cortex-a factory to the get_advisor method in api.py * Disable performance and optimization commands for the cortex-a profile. * Update trademarks section in README.md * Update pyproject.toml to not run similarity check in imports Change-Id: I2e228aaada1e2d3c5cc329d70572b51962ff517f
2022-09-09MLIA-386 Simplify typing in the source codeDmitrii Agibov
- Enable deferred annotations evaluation - Use builtin types for type hints whenever possible - Use | syntax for union types - Rename mlia.core._typing into mlia.core.typing Change-Id: I3f6ffc02fa069c589bdd9e8bddbccd504285427a
2022-08-19MLIA-550 Enable TOSA checker in the CLIDmitrii Agibov
Change-Id: I9dfa9f17a93ac24be0aa9ad68e4a72b79aecfb9d
2022-05-30Add MLIA codebase0.3.0-rc.1Diego Russo
Add MLIA codebase including sources and tests. Change-Id: Id41707559bd721edd114793618d12ccd188d8dbd