diff options
author | Jeremy Johnson <jeremy.johnson@arm.com> | 2022-02-23 12:15:03 +0000 |
---|---|---|
committer | Jeremy Johnson <jeremy.johnson@arm.com> | 2022-03-02 16:45:28 +0000 |
commit | 015c3550301fdc6d37606995322e144df0940ba2 (patch) | |
tree | f51448044ea8262f36aa964ce4b769406bb2cb7e /README.md | |
parent | c0fe04d4105884b61b5eeca4c0a932846a77b6e2 (diff) | |
download | reference_model-015c3550301fdc6d37606995322e144df0940ba2.tar.gz |
Add framework unit test generation scripts
And fixes in tosa_verif_run_tests:
* support for no-color printing
* stop double printing of error messages on verbose
* differentiate result code pass from results check
Change-Id: I26e957013a8d18f7d3d3691067dfb778008a1eea
Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com>
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 41 |
1 files changed, 40 insertions, 1 deletions
@@ -179,7 +179,7 @@ file using the `-o` switch. ## TOSA Unit Test Infrastructure -The TOSA Unit Test infrastruture builds and runs self-contained tests +The TOSA Unit Test infrastructure builds and runs self-contained tests for implementations of the *Tensor Operator Set Architecture (TOSA) Specification*. These tools directly generate TOSA operators for verification of the TOSA reference model against existing frameworks @@ -374,6 +374,45 @@ For an example of how to read these arguments in your SUT module, please see the `tosa_mock_sut_run.py` file. +### TOSA Framework Unit Tests + +Included in the TOSA Unit Test infrastructure are scripts to enable the creation +of TOSA unit tests for example frameworks. Included at the moment is support for +TensorFlow and TensorFlow Lite. + +#### Setup + +Installation (via `pip install`) of the following python package is required to +generate the tests: + +* `tensorflow` + +A built copy of the tensorflow framework from source is required to compile the +tests to TOSA - see the online documentation <https://www.tensorflow.org/install/source> +on how to do this. +The following tools are used from this build: + +* `tensorflow/basel-bin/tensorflow/compiler/mlir/lite/flatbuffer_translate` +* `tensorflow/basel-bin/tensorflow/compiler/mlir/tf-opt` + +#### Usage + +The command to generate the unit test framework models: + +```bash +tosa_verif_framework_generator -o tests +``` + +Next to convert these models to TOSA and then run them on the reference model: + +```bash +tosa_verif_framework_compiler_runner \ + --tf-base-dir tensorflow \ + --tools-base-dir reference_model \ + --recursive \ + --test tests +``` + ## Other tools Included in this repository are some support utilities used by the test runner: |