diff options
author | Jeremy Johnson <jeremy.johnson@arm.com> | 2023-10-09 16:31:13 +0100 |
---|---|---|
committer | Jeremy Johnson <jeremy.johnson@arm.com> | 2023-10-16 15:08:36 +0100 |
commit | 65ba809d7a8b4ddd0a51f6c76ad0afc5f417de07 (patch) | |
tree | 249926aeeccfb0dac60f27967e5d01001adc5e33 /verif/tests/test_tosa_refmodel.py | |
parent | 9c2fe6e129e4d176c3e14f172b92efe985af7c78 (diff) | |
download | reference_model-65ba809d7a8b4ddd0a51f6c76ad0afc5f417de07.tar.gz |
Data generator library python interface added
Added support for using generate library in tosa_verif_build_tests
and tosa_verif_run_tests tosa tool scripts.
Reduced scope of compliance test creation and verification to
the supported type of FP32.
Fix missing virtual destructor warning in generate_dot_product.h and
add config file for generate library.
Simple pytests included to check python interface.
Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com>
Change-Id: I6cdad9b00660d6ddc8bd07fdea813937fb48626a
Diffstat (limited to 'verif/tests/test_tosa_refmodel.py')
-rw-r--r-- | verif/tests/test_tosa_refmodel.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/verif/tests/test_tosa_refmodel.py b/verif/tests/test_tosa_refmodel.py index 675a534..24ee9e2 100644 --- a/verif/tests/test_tosa_refmodel.py +++ b/verif/tests/test_tosa_refmodel.py @@ -6,6 +6,7 @@ import re from pathlib import Path from shutil import rmtree +import conformance.model_files as cmf import numpy as np import pytest from checker.tosa_result_checker import test_check as tosa_check @@ -17,9 +18,13 @@ from runner.run_command import RunShCommandError # Note: Must rename imports (like test_check) so that pytest doesn't assume its a test function/class # Location of reference model binaries -REF_MODEL_BUILD_PATH = Path(__file__).resolve().parents[2] / "build" / "reference_model" -REF_MODEL_EXE = "tosa_reference_model" -REF_MODEL_EXE_PATH = REF_MODEL_BUILD_PATH / REF_MODEL_EXE +REF_MODEL_DIR = Path(__file__).resolve().parents[2] +REF_MODEL_EXE_PATH = cmf.find_tosa_file( + cmf.TosaFileType.REF_MODEL, REF_MODEL_DIR, False +) +GENERATE_LIB_PATH = cmf.find_tosa_file( + cmf.TosaFileType.GENERATE_LIBRARY, REF_MODEL_EXE_PATH +) # Set this to False if you want ot preserve the test directories after running CLEAN_UP_TESTS = True @@ -51,7 +56,9 @@ REF_MODEL_TYPE_TO_OUT = { "bf16": "bf16", } -# NOTE: These tests are set to POST COMMIT - so will only run on the CI +# NOTE: These tests are marked as POST COMMIT +# To run them, please build the reference_model in a local "build" directory +# (as per the README) and run them using: pytest -m "postcommit" @pytest.mark.postcommit @@ -83,6 +90,8 @@ class BuildTosaTest: # Generate tests without any zero-point build_args = [ + "--generate-lib-path", + str(GENERATE_LIB_PATH), "--filter", self.op_name, "--target-shape", |