diff options
author | Jeremy Johnson <jeremy.johnson@arm.com> | 2021-12-14 16:34:05 +0000 |
---|---|---|
committer | Jeremy Johnson <jeremy.johnson@arm.com> | 2022-01-06 11:38:19 +0000 |
commit | 2ec3494060ffdafec072fe1b2099a8177b8eca6a (patch) | |
tree | fbe9d2dfdc4abeff9ba374a90065b7ed98e97509 /README.md | |
parent | a1d49853082f5454144209c1d95dc9203f510746 (diff) | |
download | reference_model-2ec3494060ffdafec072fe1b2099a8177b8eca6a.tar.gz |
Reorganize verif and create packages
Split generator and runner scripts
Add package setup
Add py-dev-env.sh/.bash to allow editing source files during dev
Update README.md with installation info
Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com>
Change-Id: I172fe426d99e2e9aeeacedc8b8f3b6a79c8bd39d
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 34 |
1 files changed, 24 insertions, 10 deletions
@@ -46,7 +46,7 @@ The testing infrastructure requires: Check out the required git submodules with: ``` bash -$ git submodule update --init --recursive +git submodule update --init --recursive ``` # Compilation @@ -54,16 +54,16 @@ $ git submodule update --init --recursive The *TOSA Reference Model* build can be prepared by creating makefiles using CMake: ``` bash -$ mkdir -p build -$ cd build -$ cmake .. +mkdir -p build +cd build +cmake .. ``` Optionally, `-DCMAKE_BUILD_MODE=Debug` can be used on the `cmake` command to create a debug build. Next compile using `make`: ``` bash -$ make +make ``` The resulting executable will be named: @@ -101,7 +101,7 @@ The JSON test descriptor must have the following field: type: int The expected return code of the reference model i (0 = VALID, 1 = ERROR, 2 = UNPREDICTABLE) - + Note by default, all the files specified by "tosa_file", "ifm_file", "ofm_file" are relative to desc.json. This could be overwritten by -Cflatbuffer_dir=, if desired. @@ -109,7 +109,7 @@ Note by default, all the files specified by "tosa_file", "ifm_file", An example command is shown below: ``` bash -$ ./build/reference_model/tosa_reference_model \ +./build/reference_model/tosa_reference_model \ -Ctest_desc=examples/test_add_1x4x4x4_f32/flatbuffer-tflite/desc.json ``` @@ -127,7 +127,7 @@ format into output tensors specified by "ofm_file". For example, you can generate new output .npy by: ``` bash -$ ./build/reference_model/tosa_reference_model \ +./build/reference_model/tosa_reference_model \ -Ctest_desc=examples/test_add_1x4x4x4_f32/flatbuffer-tflite/desc.json -Cofm_file=out.npy ``` @@ -193,10 +193,24 @@ tests on additional tools or frameworks. The reference output NumPy files are generated by this step and can be programatically compared with output of other tools. to validate those tools. +## Installation + +The test infrastructure needs installing before being used. It is recommended +to create a [python virtual environment](https://docs.python.org/3/library/venv.html) +and then install the TOSA Unit Test infrastruture from the root of the +reference model: + +``` bash +pip install . +``` + +When installing without a python virtual environment, use the pip +option `--user` to install it for the current user only. + ## Usage ### Unit Test Builder -The test builder is in ``verif/tosa_verif_build_tests.py``. The +The test builder is invoked by ``tosa_verif_build_tests``. The builder generates test outputs in ``./vtest/<operator_name>/`` by default. To restrict test generation to particular regular expression wildcard, use the ``--filter `` argument. The tool can be run with no @@ -222,7 +236,7 @@ parallel using the ``-j`` switch. For example, to run all of the add operator tests: ``` bash -$ ./verif/tosa_verif_run_ref.py -t vtest/add/add* -j 8 +tosa_verif_run_ref -t vtest/add/add* -j 8 ``` The test runner is quiet by default, so running a large number of |