aboutsummaryrefslogtreecommitdiff
path: root/reference_model
AgeCommit message (Collapse)Author
2023-10-20Fix AVG_POOL2D bad_alloc with large kernel sizesJames Ward
- Nested looping instead of using Eigen extract_image_patches to avoid OOM errors Signed-off-by: James Ward <james.ward@arm.com> Change-Id: Id4d78d5b5dd04a00134f29b1d29f814195515b1f
2023-10-17Add boolean input argument supportJack Frankland
Add support for tensors of booleans as input arguments to operators. Signed-off-by: Jack Frankland <jack.frankland@arm.com> Change-Id: I35bb5768cef11348c27ffbe5869c32c144485958
2023-10-16Data generator library python interface addedJeremy Johnson
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
2023-10-05Expand TOSA MI generator support for MATMULJeremy Johnson
Fixed PrimitiveGenerator starting point and added test sets 1-5. Fixed verify_test reduce_product missing data_type. Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com> Change-Id: Iaf080ce5c1adb5819f70d1a285d04baa36016092
2023-10-04Add initial TOSA MI generator supportJeremy Johnson
Add support for dot-product MatMul - test set 0 Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com> Change-Id: Ifd15b42570014b634f59c94a1fd1cd56bac79ea4 Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com>
2023-10-03Add reduce product verifierJack Frankland
* Add verifiers to validate the result of a reduce produce operation. * Add test cases for the new validator. Change-Id: I666d1a67f498e7893e0f224bc5408a4134f2ef6c Signed-off-by: Jack Frankland <jack.frankland@arm.com>
2023-10-02Support for compliance checking testingJeremy Johnson
Updated to conformance generator to not generate tests with results for compliance tests. Updated test runner to run compliance mode version (precise & abs mode) of reference model to create test results to use against SUT results. Updated reference model to enable abs_mode on correct desc.json flags. Updated test checker to support compliance checking using verifier lib. Seperated color printing from test checker. Change-Id: I7e2fbfc6883916caa5d94d4ece122c48bf45f530 Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com>
2023-10-02Update verifier library data-type supportJeremy Johnson
Make compliance meta-data data-type required for all. Add data-type checking for all verifier modes. Add initial enum support for new ROUND compliance mode. Improve print out information from library. Use numpy ctypes.data_as to get f16 support compared to ctypes_lib. Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com> Change-Id: Ie983ba4ea958a88556f30c09b3ebc19cd9ec96b7
2023-10-02Add ULP verification for fp32Jack Frankland
Add a verifier to check two results are correct within a certain ULP tolerance for IEEE-754 32-bit floating point values. Add a test to check the ULP verifier is correct. Signed-off-by: Jack Frankland <jack.frankland@arm.com> Change-Id: Iaf43069f300999479d998e7837746b247ca5177e
2023-09-28feat: Add exact verifierJack Frankland
Add a verifier to check that tensor results match exactly. Add a unit test to check the behavior of this new verifier. Change-Id: I9b80a6d57640fec67c6be80a97b3af484aeb935e Signed-off-by: Jack Frankland <jack.frankland@arm.com>
2023-09-25Pass parameter acc_size to AvgPool2d operatorDmitrii Agibov
Signed-off-by: Dmitrii Agibov <dmitrii.agibov@arm.com> Change-Id: I4cd818af0db5e6e8a96641246cd3263ba4878f56
2023-09-15Update reference model MAX_SCALE to match specEric Kunze
MAX_SCALE for the EIGHTK level is 256 now. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I6f3a3623d18ff238888d994c2a4129091f5a92fe
2023-09-15[reference_model] Support StatefulOps and the tests for CallOnceOpTai Ly
Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: I03cb878736ccd7e1f5e1f780d7171949a19a9de2
2023-09-14Change version to 0.90 draftEric Kunze
Include 0.90 draft serialization library Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I290360bfd1c147507e092868b5546c9be08682c2
2023-09-14Upgrade to latest version of TOSA specificationGrant Watson
- Updates TOSA specification to the latest version - Updates generate_api.py to generate the operator API correctly for ops with additional tensor inputs. - Removes default arguments for func_debug and func_config to make the API C compliant again. - Updates model_runner_tests.cpp for operators that have changed. - Adds a unit test for the Tile operator to check that generated code for additional tensor inputs works correctly. Signed-off-by: Grant Watson <grant.watson@arm.com> Change-Id: I1e26065c6ed333b2ca4b3da39972d30f896fa6e5
2023-09-13Build compliance verifier library with a python interface.Jeremy Johnson
Build steps to create tosa_reference_verify_lib.so New python class to handle loading and calling verifier with pytests. Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com> Change-Id: Id42c71c398ed7364742b4a039977412ef3081c4a
2023-09-13Add integer divide with floor for coordinate calculationTatWai Chong
Align with the change in the spec. Define idiv_floor to give equivalent behavior to the floating-point floor function for image coordinate calculation. Change-Id: Ice06d354d58b1bb0dfedab55c9cc9eac1598b50c Signed-off-by: TatWai Chong <tatwai.chong@arm.com>
2023-09-08Support new RESCALE attributesEric Kunze
input_unsigned and output_unsigned were added to the specification. Older TOSA files with uint data types are still supported. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I125886ffc92975d99971e56e2075dd5d96bdbdc4
2023-09-07Rework TOSA verification APIGeorgios Pinitas
Change verifier API to consume verification configuration in a JSON format and enable appropriate validation to be performed within the verifier code in the reference model. Also update to latest spec changes for main compliance but not yet including bias support. Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com> Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com> Change-Id: I0ceaa1714dd041b00b5b29cd937c8f05e701bc4c
2023-09-06Update TosaVersion compatibility check to match with serialization_libJerry Ge
Serialization_lib change: https://eu-gerrit-1.euhpc.arm.com/c/mltech/mirrors/tosa/serialization_lib/+/542261 Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: I59752a3ba7981c356634b911160cedf30fb2599e
2023-09-06fix: Conditionally include `prctl.h` on macosJack Frankland
MacOS does not have the `sys/prctl.h` header. This patch conditionally excludes `prctl.h` on MacOS and usage of its functionality in the same way we currently do for windows. Signed-off-by: Jack Frankland <jack.frankland@arm.com> Change-Id: Ic56ec358552126b3a10827d9c52db388a8acc214
2023-09-05Pass func_config to individual operator APIGrant Watson
Updates the generate_api.py script and associated templates to allow func_config and debug_config to be passed when running individual operators on the API. This will allow us, for example, to set precise_mode and abs_mode when running individual operators. Signed-off-by: Grant Watson <grant.watson@arm.com> Change-Id: Ia3e7ffc146f876daa307558433177c68285843b7
2023-08-23[reference model] Code cleanup for SHAPETai Ly
remove unnecessary change of tensor shape array for SHAPE data type Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I8e6ca98448188a1c30f9d29c22b3194d327b17ac
2023-08-21Remove unused struct to avoid warning messageWon Jeon
Signed-off-by: Won Jeon <won.jeon@arm.com> Change-Id: Id5820033bb3cc98b5e284237a91b22ffd54a80e3
2023-08-18Add DIM operator to reference modelWon Jeon
Signed-off-by: Won Jeon <won.jeon@arm.com> Change-Id: Iea11ee5d3d98773e9c5e9b827593c05afb41ce3b
2023-08-14Add support for bias broadcastingTai Ly
add support for bias broadcasting for operators: - conv2d - conv3d - depthwise_conv2d - transpose_conv2d - fully_connected could not add framework test for this because tf.nn.bias_add requires bias size to match channel dimension. manually tested reference model evaluation on tosa mlir with bias size of 1 Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I70d29d231a63fc03b10e3006cbd6b16b53cca1f2
2023-08-07Update formatting based on clang-format 14Eric Kunze
Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I22939e75a08349816a9c103eb7312edcec53855e
2023-08-02Fix compiler warnings (NFC)Eric Kunze
Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I8645382983c257e5102982d487283560088e2d2a
2023-07-31Fixed missing tensor inputs in fully_connected in model runnerJiacheng Liang
Signed-off-by: Jiacheng Liang <jiacheng.liang@arm.com> Change-Id: I473adc1525319b5574ee0e36d10a530277d9215d
2023-07-27Enable lazy tensor allocationJerry Ge
- The previous ref_model was allocating the memory for all tensors in the graph upfront which is unnecessary and wasteful. - This patch changes to only allocate initial input tensors on the entry point using the allocateInputTensor() function. - The output tensors are ensured to have been allocated before executing a node. The output tenosrs are the inputs for the next node. - When a node's evaluation is finished, its input tensors will be freed if they will no longer be used by anyone else. Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: Ibb3e8c9e6344f6cd9eb20532a03b2097b93247f9
2023-07-25Run clang-format and update copyrightJerry Ge
- Also added run clang-format to pre-commit runs Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: I4e59ac0afbaa30dce0773aa63d92a1a3b119e2f3
2023-07-17Update tensor allocation loggingEric Kunze
Also move a large amount of redundant code to a macro Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: Ib1dcb2ce15e56076e444a4739c4d1292389c4a78
2023-07-14Add support for int32 tensor datatype in model runnerJiacheng Liang
Signed-off-by: Jiacheng Liang <jiacheng.liang@arm.com> Change-Id: Ie31041cbcd01f6290be06eabfe5c619123ae989f
2023-06-29Fix missing template instantiationsEric Kunze
Would cause unresolved symbols to appear when building in release mode. There are a couple of minor compiler warning fixes as well. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I0f7e9a8771442a6e3c848edfe034ef534d0d8ca7
2023-06-29Add support for ERF operator to reference modelWon Jeon
Signed-off-by: Won Jeon <won.jeon@arm.com> Change-Id: Ib42b867287b83a183a0d0fb1f1eb29974f58fae4
2023-06-26Upgrade to latest version of TOSA specificationGrant Watson
Signed-off-by: Grant Watson <grant.watson@arm.com> Change-Id: I1296f968baca335ea88691bc973e2d01b2aa2c5b
2023-06-20Make verifiers to operate on const pointersGeorgios Pinitas
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com> Change-Id: I45287af6b33cf07383250dc962a97728e65697a7
2023-06-15Add ERROR_IF to incorrect broadcast shapesJerry Ge
Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: I7460ad9eed3ed5c7cec6e855a0303753ed28eb1c
2023-06-15Add TOSA MI verification methodsGeorgios Pinitas
Adds utility functions that enable compliance verification of TOSA MI operators; as per section 1.8.2 in the TOSA specification. Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com> Change-Id: I0cced0ff8875ac8d78b1943211438713d1c51b88
2023-06-12Correctly identify "axis" attributes.Grant Watson
- Allows axis attributes to be treated differently to other arguments in attribute.def Signed-off-by: Grant Watson <grant.watson@arm.com> Change-Id: I1be2595c24bf22e5391a2911a5283391d310df37
2023-06-02Add support for boolean outputs in model runnerJiacheng Liang
Comparison operators produce boolean outputs, which need to be written into client data Allow subgraph traverser to use main block to look for tensors when serialization handler is missing Signed-off-by: Jiacheng Liang <jiacheng.liang@arm.com> Change-Id: I6f9af470185541fa6466b3f7786c48f1555fa6f6
2023-06-02Update version to 0.80 draftEric Kunze
Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I175ef0acc6a6633c3e351b935a04db16de1bfbd5
2023-05-25Remove draft tag for 0.70 releasev0.70.0v0.70Eric Kunze
Update serialization library submodule Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I1d6e2700ac55f429de742931627b07c9a4a46f14
2023-05-18Add abs calculations under precise_modeTai Ly
This adds a second run of reference model under precise_mode when test_desc.json contains a "compliance" dictionary which contains a "mode" entry with value "dot product". In this second run, abs_mode will be set to true, which causes: 1. evaluation will take absolute values of inputs for these operators: conv2d, conv3d, depthwise_conv2d, fully_connected, matmul, transpose_conv2d, fft2d, rfft2d reduce_sum, avg_pool2d 2. output files will have prefix "bounds_" prepended to them Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I7070ecc7ead2d2ea3375c44663d653c6772b88e0
2023-05-17Add support for one dimension of size -1 in ReshapeOpJerry Ge
Signed-off-by: Jerry Ge <jerry.ge@arm.com> Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com> Change-Id: I0ef7607f4266296a1204c5cccdb5be36f345b5ba
2023-05-10Refactor ref_model rank checking and add level check to argmaxJerry Ge
Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: Iad035b31d5e5e83040068e6311501490765bfff7
2023-05-05[reference model] Add precise modeTai Ly
This adds --precise_mode=1 option to tosa_referece_model, which will cause reference model to convert all floating point tensors to FP64 tensors and compute all operators accordingly. Also adds optional -p arguments to test runners tosa_verif_run_tests.py and tosa_verif_framework_compiler_runner.py to run tests in precise mode Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I156055216ad61710096497a8fa1a653be2a602a3
2023-04-24AVG_POOL2D - Fix for stride renaming mistakeJeremy Johnson
Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com> Change-Id: I6deb355998ce88714b41eedc8170acbd7875f519
2023-04-20Add level checking to TOSA Ref modelJerry Ge
Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: I5689d7c6b902a319a68fa4628b59e0bcc23aeca4
2023-04-11revert to GetBlockByName "main"Tai Ly
Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: Icefa594b25739ebaa331af2352bdcae1aaf81cf5