Age | Commit message (Collapse) | Author |
|
Resolves: MLIA-1074
Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
Change-Id: Id23da33fefbe5ef61b2e507f6c7706e3ed3d0bef
|
|
Resolves: MLIA-1055, MLIA-1056, MLIA-1057
Signed-off-by: Nathan Bailey <nathan.bailey@arm.com>
Change-Id: Id573cec94e4a69117051dcd5175f383c0955d890
|
|
If a file has the right extension, MLIA previously tried
to load files with invalid content, resulting in confusing
errors. This patch adds better reporting for that scenario
Resolves: MLIA-1051
Signed-off-by: Annie Tallund <annie.tallund@arm.com>
Change-Id: I3f1fd578906a73a58367428f78409866f5da7836
|
|
The commit messages are checked against the Conventional Commits
(https://www.conventionalcommits.org) specification, along with minor
customizations (eg, capitalized header, some irrelevant commit types removed
Checking messages is integrated into `tox -e lint`.
Changelog generation is integrated into "tox -e changelog", which runs
`cz changelog` command underneath and incrementally updates RELEASES.md.
Change-Id: I86f21f6c78a166d3bb92450a027a2d7e71ce22cf
Signed-off-by: Gergely Nagy <gergely.nagy@arm.com>
|
|
TFLiteConverter was producing log messages in the output that was not
possible to capture and redirect to logging.
The solution/workaround is to run it as a subprocess.
This change required some refactoring around existing invocations of
the converter.
Change-Id: I394bd0d49d36e6686cfcb9d658e4aad05326cb87
Signed-off-by: Gergely Nagy <gergely.nagy@arm.com>
|
|
Updating to Vela 3.10 which requires TensorFlow 2.14 which requires
Python 3.9 (dropping support for Python 3.8).
Resolves: MLIA-997
Change-Id: Id60bd08f7156a8efa204ef71ba81590edf0e3b28
Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
|
|
- https://github.com/box/flaky
- Is set to re-run tests marked with @flaky
- Provides a report on failures
- Add flaky guard to tests/test_nn_tensorflow_optimizations_clustering.py
Signed-off-by: Annie Tallund <annie.tallund@arm.com>
Change-Id: I6795fd8bb2c38be6513f3689c3eeb805e7976add
|
|
Add a check to see if the default backends are installed when no backend
is provided via CLI.
Change-Id: I27dd9f35cfeec187f44cba06915d1be5a3a052b5
Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
|
|
Signed-off-by: Gergely Nagy <gergely.nagy@arm.com>
Change-Id: I6c8b0b74d6d35261eb0ff1a37b9577f9033be8f9
|
|
Signed-off-by: Annie Tallund <annie.tallund@arm.com>
Change-Id: I2b2383533578b815372e26f01d6066b4a9b39df0
|
|
- New overview on Arm MLIA
Signed-off-by: Annie Tallund <annie.tallund@arm.com>
Change-Id: I7da120aefb23ac6434c99c41e65a051f4a0bd8fa
|
|
Change-Id: I8a228cbab405b4d4112e5e38856b3cb92304cba7
Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
|
|
Rename 'TestTrainingParameters' to 'MockTrainingParameters' to avoid a
PytestCollectionWarning during test parsing
Change-Id: I26b52d46aa71bcc6748e38e92331be21a667e8c9
Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
|
|
Fixed an artifact that crept in during the upstream rebase process,
change a6ae703b6e41c73 was being taken out,
but 3cd84481fa25 reintroduced the first part of a try/except block
which caused a syntax error.
Change-Id: I7fc2e18a227a30ebaaee0763450ee68646611add
Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
|
|
If the input model for rewriting is quantized:
- Record de-quantized TFRecords
- enable writing de-quantized calibration data for the training
- re-generate augmented training data, if needed
- Use quantization-aware training (QAT) to train the replacement models
- Check if replacement model is quantized:
If source model is quantized, we make sure rewrite's output model
is quantized too. Right now, only int8 is supported so raising
an error if any other datatype is present in the output.
Resolves: MLIA-907, MLIA-908, MLIA-927
Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
Change-Id: Icb4070a9e6f1fdb5ce36120d73823986e89ac955
|
|
- 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>
|
|
- Fix input shape of rewrite replacement:
During and after training of the replacement model for a rewrite the
Keras model is converted and saved in TensorFlow Lite format. If the
input shape does not match the teacher model exactly, e.g. if the
batch size is undefined, the TFLiteConverter adds extra operators
during conversion.
- Fix rewritten model output
- Save the model output with the rewritten operator in the output dir
- Log MAE and NRMSE of the rewrite
- Remove 'verbose' flag from rewrite module and rely on the logging
mechanism to control verbose output.
- Re-factor utility classes for rewrites
- Merge the two TFLiteModel classes
- Move functionality to load/save TensorFlow Lite flatbuffers to
nn/tensorflow/tflite_graph
- Fix issue with unknown shape in datasets
After upgrading to TensorFlow 2.12 the unknown shape of the
TFRecordDataset is causing problems when training the replacement models
for rewrites. By explicitly setting the right shape of the tensors we
can work around the issue.
- Adapt default parameters for rewrites. The training steps especially
had to be increased significantly to be effective.
Resolves: MLIA-895, MLIA-907, MLIA-946, MLIA-979
Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
Change-Id: I887ad165aed0f2c6e5a0041f64cec5e6c5ab5c5c
|
|
* Define replacement function fully_connected layer
* Define RewriteConfiguration and Rewriter to integrate
rewrite module into mlia optimize command
* Fix a bug in the ethos_u/data_collection.py file
* Fix a bug in join.py
* Remove diff_stats and use diff instead, added related
changes around this to ensure e2e tests passing
* Add unit tests for all changes
* Fix bug in diff_stats function
* The bug was caused by a dividing by numpy array
of all zeros. The previous way of handling it
did not consider the all zeros case but only
dealt with partially zeros
* unit tests added.
* Fix the bug in rewrite/core/graph_edit/join.py
* Remove the possibility of passing None to append_relabel
function because it is immutable
* The bug happened when empty dictionary was passed in the
append_relabel function and the function overwrites the
reference of operator_map which caused the dictionary
was not updated after the function call
Resolves: MLIA-749, MLIA-864, MLIA-866
Change-Id: I1ab426996232f182345e6e98033d5dcb32aea08c
Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
|
|
- Fix imports
- Update variable names
- Refactor helper functions
- Add licence headers
- Add docstrings
- Use f-strings rather than % notation
- Create type annotations in rewrite module
- Migrate from tqdm to rich progress bar
- Use logging module in rewrite module: All print statements are
replaced with logging module
Resolves: MLIA-831, MLIA-842, MLIA-844, MLIA-846
Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
Change-Id: Idee37538d72b9f01128a894281a8d10155f7c17c
|
|
Note: The unit tests mostly call the main functions from the respective
modules only.
Change-Id: Ib2ce5c53d0c3eb222b8b8be42fba33ac8e007574
Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
|
|
* 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
|
|
- Add required files for rewriting of TensorFlow Lite graphs
- Adapt rewrite dependency paths and project name
- Add license headers
Change-Id: I19c5f63215fe2af2fa7d7d44af08144c6c5f911c
Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
|
|
The recent update to version 1.0.3 causes issues when building.
Change-Id: I74db3b419ece7b744cbb48c8e11096e99709a9cd
Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
|
|
- Add a PruningPolicy to skip layers that are not
supported by the Keras pruning API
- Make dataset generation more generic to support
use-cases beyond classification
Signed-off-by: Annie Tallund <annie.tallund@arm.com>
Change-Id: I198dae2b53860f449f2fdbc71575babceed1ffcf
|
|
- Update dependencies in .pre-commit.yaml
- Fix code issues with new linters
Change-Id: I36964ecf1a405dd8faac01b4470b56122a7cad17
Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
|
|
- Update version dependencies in the tox.ini
- Fix linter issues
Change-Id: I04c3a841ee2646a865dab037701d66c28792f2a4
Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
|
|
Update Vela, TensorFlow and other dependencies.
Change-Id: Id497084391d31548c2f307f5a4b7981981fa25a5
Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
|
|
Signed-off-by: Annie Tallund <annie.tallund@arm.com>
Change-Id: I3c3f458dab214a7be00dd50c640a62767389fd9b
|
|
Ignoring new 'Conv_hwcn_Weights' layer that is
named in TensorFlow 2.11.1 and used as buffer for float32
only.
Signed-off-by: Joseph Tummon <Joseph.Tummon@arm.com>
Change-Id: Iaa579c76013b1e0dc505466c46f5864a96af8c6d
|
|
Update the compatibility information of the backend for ArmNN TensorFlow
Lite Delegate (classic) to version 23.05.
Change-Id: I84693842d1a883f7083a6faf7d5ddcd5ecc34e5d
Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
|
|
Two warnings appear when running e2e tests from
where TensorFlow declares ranges of NumPy dtype,
but this shouldn't affect anything else in MLIA.
Change-Id: Idc22f1de352980c70d27cdcba35a51a1e1efaafc
Signed-off-by: Joseph Tummon <Joseph.Tummon@arm.com>
|
|
Signed-off-by: Anton Kachatkou <anton.kachatkou@arm.com>
Change-Id: Ie74d7f8e7a4df319b72b64dda85cc9b754769dc5
|
|
- Removed TOSA Checker dependency from setup.cfg
- Installation process calls directly the installation of TOSA Checker
instead of the extra dependency
Change-Id: I21e309b9316671959483bd2ef1ecaf644936a4cb
|
|
- Remove unused silencing of typing
- Amend None type hints where it is default
Change-Id: Id972b56dcdce865bf6c9d6aea88bc76baf39133e
|
|
Use the backend registry to manage installation routines for different
backends as well. This makes the process more generic and allows us
to move towards plug & play for backends (i.e. there should be no code
changes needed in the general MLIA code to add/support new backends).
Change-Id: Ib7c772ec52b2f4d857c2c9871e44dfff97e9d970
|
|
- JSON output now reports tosa_checker as attribute name, which
accurately represents its value as the version of TOSA Checker
Change-Id: I8ac5032fea5dae65382db76091d295595a644816
|
|
- Unify the TensorFlow Lite compatibility check across Cortex-A, TOSA
and Ethos-U targets
- Display tables/messages with parsed information
- Do not display raw TensorFlow Lite errors, and return with exit code 0
Change-Id: I9333fdb6cbe592f1ed7395d392412168492a1479
|
|
- 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
|
|
Change-Id: I68fb8c4e51046e9fc2d91ad8338718ba545209cd
|
|
There is an issue with Python 3.8.0 that makes it impossible to use
MLIA. It is fixed from Python 3.8.1 onwards.
https://github.com/python/cpython/issues/82019
Change-Id: I48c0a5f103fb29561be483875ba706928b7e77d1
|
|
Change-Id: I5eff40ac2050b77f580460c2d5233ed6e96adeb7
|
|
- If no output directory provided then create one
in the current working directory
- Update documentation and tests
Change-Id: Id1f2acef14e1bd2edffbfa6139a961a5c5018211
|
|
- Add operator compatibility data for Cortex-A via for ArmNN TensorFlow
Lite delegate 22.11
- Extend the Cortex-A target profile to include the version of the ArmNN
TensorFlow Lite delegate to be used.
- Some re-factoring work to support multiple versions and the new target
profile parameter.
Change-Id: Iae91bb0757ea3909be975af68b34d0ca2be47c43
|
|
- define Metadata base class with dictionary data and abstract method
- mlia, tosa, model and metadatadisplay classes are all inherited from base class
- update unit tests
- update function report_metadata into more generalized format
Change-Id: Id49e15283eebdca705045eda81db637d82f85453
|
|
- Create new CLI parser instance whenever needed as it contains
static data and could not be reused
Change-Id: I8a67bb585e95d972304eca809ff28b822a3151b6
|
|
- 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
|
|
Term 'device' can be ambiguous and is replaced with 'target'.
Change-Id: I5e5108d033a13b98e4c2997713e1c32bce63ae62
|
|
- Use the target/backend registries to avoid hard-coded names.
- Cache target profiles to avoid re-loading them
Change-Id: I474b7c9ef23894e1d8a3ea06d13a37652054c62e
|
|
Change-Id: I7dda9c2b99a1464d9682074245584d8c518a9c13
|
|
Save the target profile file in the output directory.
Change-Id: I886e52cb922c5425e749b154bd67a5d294ce0201
|