Age | Commit message (Collapse) | Author |
|
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
|
|
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>
|
|
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
|
|
- 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
|
|
* 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 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 version dependencies in the tox.ini
- Fix linter issues
Change-Id: I04c3a841ee2646a865dab037701d66c28792f2a4
Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
|
|
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
|
|
- Add new error types for the TensorFlow Lite compatibility
check
- Try to detect custom operators in SavedModel/Keras models
- Add warning to the advice about models with custom operators
Change-Id: I2f65474eecf2788110acc43585fa300eda80e21b
|
|
- Update TensorFlow dependencies for x86_64
- Adapt unit tests to new TensorFlow version
- Update linters (including pre-commit hooks) and fix issues
- Use conditional import to fix tflite compat code for aarch64
Change-Id: I1a9b080b900ab65e38f7f2552562822bbfdcd259
|
|
Check input model for Arm NN TensorFlow Lite Delegate 22.08 support.
Change-Id: I1253c4c0b294c5283e08f0a39561b922ef0f62e6
|
|
- Add ability to intercept low level TensorFlow output
- Produce advice for the models that could not be
converted to the TensorFlow Lite format
- Refactor utility functions for TensorFlow Lite
conversion
- Add TensorFlow Lite compatibility checker
Change-Id: I47d120d2619ced7b143bc92c5184515b81c0220d
|
|
Use "TensorFlow Lite" instead of "TFLite" in
documentation and comments
Change-Id: Ie4450d72fb2e5261d152d72ab8bd94c3da914c46
|
|
- 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
|
|
- mypy issue: to make the comment #type: ignore platform specific,
flags like platform.machine() cannot be recognized by mypy, so we
cannot isolate the specific lines of code that fail mypy tests
- numpy issue: for numpy version < 1.20, the function np.unique
has not been type annotated, which caused mypy throwing the error
when we run our unit tests in aarch64
- because of the above two reasons, we use function decorator to
turn off type checking for entire functions to remove all
annotations so that the mypy error for certain lines can be silented
Change-Id: Id91e65ef7677b78b4c9c85b8412229e3672e3a66
|
|
Re-factoring the code base to further merge the old AIET code into MLIA.
- Remove last traces of the backend type 'tool'
- Controlled systems removed, including SSH protocol, controller,
RunningCommand, locks etc.
- Build command / build dir and deploy functionality removed from
Applications and Systems
- Moving working_dir()
- Replace module 'output_parser' with new module 'output_consumer' and
merge Base64 parsing into it
- Change the output consumption to optionally remove (i.e. actually
consume) lines
- Use Base64 parsing in GenericInferenceOutputParser, replacing the
regex-based parsing and remove the now unused regex parsing
- Remove AIET reporting
- Pre-install applications by moving them to src/mlia/resources/backends
- Rename aiet-config.json to backend-config.json
- Move tests from tests/mlia/ to tests/
- Adapt unit tests to code changes
- Dependencies removed: paramiko, filelock, psutil
- Fix bug in corstone.py: The wrong resource directory was used which
broke the functionality to download backends.
- Use f-string formatting.
- Use logging instead of print.
Change-Id: I768bc3bb6b2eda57d219ad01be4a8e0a74167d76
|
|
- Update TensorFlow to version 2.8 (now supported by Vela 3.4)
- Adapt existing codebase to preserve intermediary tensors in the interpreter in order to avoid errors when trying to print all of them in the future.
- Ignore types for numpy methods that do not have typing annotations in their definitions. This is needed because otherwise mypy would consider the calling function to also be untyped.
Change-Id: I943ac196fd4e378f5238949b15c23a2d628c8b5e
|
|
Upgrade Vela version from 3.3.0 to 3.4.0.
- Adapt code to use new typing notation by replacing `numpy.array` with `numpy.ndarray` where necessary.
Change-Id: I035e9564d448652aa09a52d79c71ef09663ea776
|
|
Use TFLITE_BUILTINS instead of TFLITE_BUILTINS_INT8 to make the
quantization non-strict.
Note: De facto this does not change the behavior of MLIA because the
TFLITE_BUILTINS_INT8 is not correctly applied with the new quantizer.
See: https://github.com/tensorflow/tensorflow/issues/56535
Change-Id: Ia0782ba22c5e9223fa10fec71c16aee60b79bb57
|
|
Add MLIA codebase including sources and tests.
Change-Id: Id41707559bd721edd114793618d12ccd188d8dbd
|