aboutsummaryrefslogtreecommitdiff
path: root/src/mlia/api.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-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-08MLIA-591 Create interface for target profilesBenjamin Klimczak
New class 'TargetProfile' is used to load and verify target profiles. Change-Id: I76373a923e2e5f55c4e95860635afe9fc5627a5d
2023-02-08MLIA-590 Support path to custom target profilesAnnie Tallund
- Start using TOML format for target profile - Add support for loading custom target profile files Change-Id: I6be019d4341e93115440ccdbdb6dafdc1c85b966
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
2022-11-29Rename modulesDmitrii Agibov
- Rename module "mlia.devices" into "mlia.target" - Rename module "mlia.target.ethosu" into "mlia.target.ethos_u" - Rename module "mlia.target.cortexa" into "mlia.target.cortex_a" - Rename and update tests Change-Id: I6dca7c8646d881f739fb6b5914d1cc7e45e63dc2
2022-11-07MLIA-688 Fix --supported-ops-report flagRaul Farkas
* Add `api.generate_supported_operators_report` that calls a report generator based on given target profile. * Update `--supported-ops-report` cli flag help section and README.md info by specifying that it is currently only supported for Ethos-U. * Add tests for `generate_supported_operators_report` method. * Add stub methods `report` for Cortex-A and Tosa operators.py module that throw a "Not supported" exception. Change-Id: Iaf373fe48299d807e48fd6a0e6c029ce32203f4f
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-549 Integrate TOSA checker into MLIADmitrii Agibov
- Add new module for TOSA - Add advisor workflow components - Use TOSA checker for getting operators compatibility information Change-Id: I769e5e2a84e15779658f0895b4a347384def63bf
2022-08-19MLIA-549 Refactor API module to support several target profilesDmitrii Agibov
- Move target specific details out of API module - Move common logic for workflow event handler into a separate class Change-Id: Ic4a22657b722af1c1fead1d478f606ac57325788
2022-06-27MLIA-522 No 'perf' in mode 'all' for TFLite filesBenjamin Klimczak
Fix the issue that no performance information is shown for TFLite files when the mode 'all_tests' is used. Change-Id: I8b4df4ab84ba9783b582ad449a34bf6177037e14
2022-05-30Add MLIA codebase0.3.0-rc.1Diego Russo
Add MLIA codebase including sources and tests. Change-Id: Id41707559bd721edd114793618d12ccd188d8dbd