aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-10-29Remove draft tag from 0.23 specificationv0.23.0v0.23Eric Kunze
Change-Id: Id45f95bb06f314dff893a790cac4377d95f7c565 Signed-off-by: Eric Kunze <eric.kunze@arm.com>
2021-10-28Readability fixes for pseudocodeEric Kunze
Avoid use of acc for variables when they are not convolution accumulators. Use argument types appropriately. Add missing pseudocode for some MI operators Change-Id: I9113f9228dbcafb85206bcc39310e9599cb12c08
2021-10-28Clarify CLAMP pseudocodeEric Kunze
CLAMP does not do any zero point modification of its clamp limits. Callers to CLAMP should provide values with the zero-point accounted for in the arguments. Change-Id: I27ee468ecd5ab53e33dcbac9c91b705b39e49f96
2021-10-28Remove zp subtraction from tensor_read pseudocodeEric Kunze
Operators which use the zero-point functionalty for 8-bit integer processing are updated to do the zero-point subtract in their pseudocode. Note that the PAD operator no longer takes a zero point argument, and instead requires callers to account for the zero point in the pad_const argument. Change-Id: I3bca1cae85aa2093000c420f0433633c347a29de
2021-10-20Remove rank upper limit on TRANSPOSE operatorEric Kunze
Change-Id: I8935624362b3b8d1b125ccb801d039b97e88a2ef
2021-10-18Fix typo int_t to in_tEric Kunze
Change-Id: I495ed97896d8f560b9eb9ed7b05dd2ca1c564c73 Signed-off-by: Eric Kunze <eric.kunze@arm.com>
2021-10-15Add ERROR_IF checks to CONCAT operatorMatthew Haddon
* Add ERROR_IF checks to ensure that inputs have the correct rank, dimension lengths, and a suitable axis value * Make REVERSE REQUIRES check into an ERROR_IF * Some minor typo/formatting fixes Change-Id: Ie133788ca7e1deab194ba5ef97e47c39cdd170b6 Signed-off-by: Matthew Haddon <matthew.haddon@arm.com>
2021-10-12refactor SLICE error_if checksMatthew Haddon
* refactored error_if checks to avoid logic overlap * Added check to ensure that size dimensions match output dimension * Defined the rank() function in pseudocode helpers Change-Id: I56bf06252d9149d449c984126e8f2025a07d6034 Signed-off-by: Matthew Haddon <matthew.haddon@arm.com>
2021-10-08Force output shape to be correct for pooling operationsMatthew Haddon
The avg_pool2d and max_pool2d operators trigger an error_if statement if the output shape provided does not match the output shape generated by the operation given the input arguments. * Add pseudocode for floor operation * Fixed type in RESCALE op Signed-off-by: Matthew Haddon <matthew.haddon@arm.com> Change-Id: I087faa331c30becc05719cd1261f436019dcdeb5
2021-10-04Move quantization parameters into argument tablesEric Kunze
The TOSA specification doesn't have quantized types. Without those types, it is cleaner to move effects of quantization such as the zero points into the standard list of arguments, rather than existing as a separate table. Change-Id: I18ea2959e9d3e4a3e9a0ead7a8ca319bb4426a47
2021-09-29Allow PAD operator to pad with non-zeroEric Kunze
PAD now takes an additional attribute, with the padding value. Will generally be zero, but other values are allowed. tensor_read now requires the coordinates to be within the given tensor, with unpredictable behavior occurring if an access outside of the tensor occurs. Callers of tensor_read are expected to check the coordinates and take the appropriate action. The primary impact of this is to move the responsibility for padding to each operator. In practice, this is expected to not be a functional change, but a cleanup to make the behavior more clear. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I4f21ca9a13d82d422bbd66c400f23aa9a0bd2aa0
2021-09-27Change TABLE operator table to be an attribute for BI/MIEric Kunze
Use cases for BI/MI profiles show that the table argument for the TABLE operator will be known at compile time. Make it an attribute in that case. If a dynamic table is needed, the GATHER op is available. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: Icb54eaa443ed7896d5010c7a30af88b02c8a83ad
2021-09-24Don't allow pooling ops with excessive paddingEric Kunze
Padding larger than the kernel size leads to the odd effect where no values from the input tensor are used. This leads to a divide by 0 in AVG_POOL2D, as it only divides by the number of valid input values used, not padding. Change MAX_POOL2D to have the same limitation for consistency. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I9cd0c0619f88f570d30c83053280460ae3d1cbfb
2021-09-24CAST: Correct profile for floating point castsDominic Symes
Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: I91098ef7e18d18263f7b909f75b9df4460417725
2021-09-16Clarify range limitations for tensorsEric Kunze
Catch zero and negative sized tensors. Clarify configuration of bool_t in the reference model. int4_t limitations on -8 to stay symmetric around 0. Pad values must be >= 0. Stride,dilation values must be >= 1. Change-Id: Idb6ef740f855912a8340475ba319816f90c9b051 Signed-off-by: Eric Kunze <eric.kunze@arm.com>
2021-09-03MAX_POOL2D: Fix padding behaviourDominic Symes
Change-Id: Idcf4b99161ce05e56391fbc9107a19617cb1ad21 Signed-off-by: Dominic Symes <dominic.symes@arm.com>
2021-08-23Fix pooling argument tablesEric Kunze
Make the input tensor shape dimensions correct for the pseudocode. Clarify the count used for average pooling only includes valid elements. Remove stale reference to PLACEHOLDER nodes. Change-Id: Ia0b9f0aa404008c6a36671da12188cb0999712d4 Signed-off-by: Eric Kunze <eric.kunze@arm.com>
2021-07-13Add definition of TOSA complianceDominic Symes
Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: I2e25d0467843adb078d5ab9fd681af40b2ffa52e
2021-06-24Replace assert with REQUIRE()Eric Kunze
REQUIRE is a direct replacement for the asserts, and uses the unpredictable() function in pseudocode to describe the required conditions for operators Change-Id: I35dc81e083d8e41f16728d992bdb8b06b0271226 Signed-off-by: Eric Kunze <eric.kunze@arm.com>
2021-06-17RESIZE: Clarify dimension limitsDominic Symes
X and Y dimensions of image limited to 16-bit for integer data types so that the position * stride calculations do not overflow an int32_t (both position and stride are then 16-bit) Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: I24d15b1f2991a18da15493bef478d5ee9c65dba3
2021-05-26Rename and clarify the divide operator.Dominic Symes
Name changed from DIV to INTDIV. Usage clarified. Change-Id: I493b8ace7a63e4c80caac1674c767c1ad468dd83 Signed-off-by: Dominic Symes <dominic.symes@arm.com>
2021-05-21Removed IDENTITYN and PLACEHOLDERSuraj Sudhir
Signed-off-by: Suraj Sudhir <suraj.sudhir@arm.com> Change-Id: I33bb90ccc778a5cd5fa3ece28880cf484d9f8e3c
2021-05-20Fix typo in RESIZE argumentsDominic Symes
The missing column prevented later rows of arguments being rendered correctly in html Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: Ifa4edd38dc49f2ce6a182ec8cb44f8773a5bfa05
2021-04-14RESIZE: Clarify the valid range of stride values.Dominic Symes
Clarify stride ranges so that the range of valid scales is independent of the shift value. Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: I56b4dd3b39df19da35fb2c6fe3035e2de42f4860
2021-04-01Remove RELUN operationDominic Symes
The operation can be implemented directly with CLAMP for int8, int16 or MIN,MAX for int32. Change-Id: I872ec5ee4ee30bb69353f39be12a65307c9b8d0a Signed-off-by: Dominic Symes <dominic.symes@arm.com>
2021-03-23Update revision to 0.23.0 draftEric Kunze
Change-Id: I5387f0b17cbe45c7871dbe3e3e6036fded6cbc8c Signed-off-by: Eric Kunze <eric.kunze@arm.com>
2021-03-23Remove draft tag from 0.22 specificationv0.22.0Eric Kunze
Update copyright to include 2021. Change-Id: Iced31530f7f86faa2efa95441bcbacf1c37f126f Signed-off-by: Eric Kunze <eric.kunze@arm.com>
2021-03-18Add integer DIV operatorEric Kunze
Integer divide is not commonly used, but would have been difficult to implement using the existing operators. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I8fb3919cd7a0f1a1fa95074d921d200d23e2f249
2021-03-16Add 8-bit support to TABLEEric Kunze
It is challenging to work back from the RESCALE->TABLE->RESCALE for a simple 8-bit lookup. This adds support to TOSA for a simple direct 256 entry 8-bit lookup table for the TABLE operator. The 16-bit interpolated table is still required for a conformant implementation. Change-Id: I0ef218444f0b57b880aa8d1c7e96efedae72eb53 Signed-off-by: Eric Kunze <eric.kunze@arm.com>
2021-03-16Note limits on axis parameterEric Kunze
This also adds a restriction on CONCAT to have all inputs be the same rank. Update the ARGMAX pseudocode to handle corner cases properly and use axis/rank consistent with other operators. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I941ac172ee79424ac04d562cedebb75da76659a5
2021-03-11Make pseudocode block tags consistentEric Kunze
They are all now [source,c++] and use ---- as the delimiter. Also made the pseudocode indentation consistent (4 spaces) in the introduction sections. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I1287a60cfeae8b7e3c63b9fc8885b1ebf3d3386d
2021-03-11Adjust pseudocode types to account for zero pointEric Kunze
When reading tensor values with zero point, the returned value has one more bit than the original to account for zero point. Update cases of apply_clip to properly represent the types involved. Change-Id: I60c17b1b244c34b4f04f042807936ae0f282ce93
2021-03-08Consistency cleanupEric Kunze
Attempt to get consistent across the pseudocode. Change the data types to all be intN_t instead of some cases of intN. Use float_t as the general floating point data type. Be consistent on use of the term "floating-point" Move general pseudocode helpers to their own section. Change-Id: Ie77666cd3ee438c71f39c62b9c424fe687b0bb51 Signed-off-by: Eric Kunze <eric.kunze@arm.com>
2021-03-03Change CONCAT to allow a list of input tensorsEric Kunze
Originally only a pair of input tensors were allowed. This aligns with what the frameworks do, and simplifies the translation of frameworks into TOSA and allows compilers to view the output as a whole. Change-Id: Id4461abdf0cc763e84e086142222e87d28cd8afc Signed-off-by: Eric Kunze <eric.kunze@arm.com>
2021-02-09Add batch dimension to MatMulDominic Symes
Add batch dimension for consistency with other operators. Change-Id: I9b1734a1a60304f46a14a6cda1bd6be6678f1037 Signed-off-by: Dominic Symes <dominic.symes@arm.com>
2021-02-05Clarify control flow operationsDominic Symes
Add pseudo-code for the control flow operations in terms of TOSA sub-graphs. Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: I1712e8297a0010a4e68a34df16fcbcf47fc41dd2
2021-01-26Update elementwise operator overviewEric Kunze
Elementwise operators no longer scale their inputs to a common range. The elementwise introductory section reflected the old behavior. Also clear up some language on the unary functions. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I86bf9da8b51e9a64e4fe6766e01f0c35d43d805a
2021-01-26Update revision to 0.22.0 draftEric Kunze
Change-Id: I5903ccd3edbd5c28bf8282ff39aadd648613f072 Signed-off-by: Eric Kunze <eric.kunze@arm.com>
2021-01-25Remove aint8 typeEric Kunze
The aint8 type represented an asymmetrically quantized range. With the change to move scaling fully into the RESCALE operator, the aint8 and int8 types didn't have significant differences in their use with operators. Unifying to a single data type makes things simpler. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I3ee89cbdafdc61293ef1f1bec52398d744e716a1
2021-01-13SCATTER: Clarify behaviourDominic Symes
This clarifies that repeated updates to the same output index are not permitted in TOSA SCATTER. Change-Id: Ib188a434d0d4ad4742ee37373491c8a53d501bf0 Signed-off-by: Dominic Symes <dominic.symes@arm.com>
2020-12-16Disambiguate scale_t in RESIZE commandEric Kunze
scale_t is already defined globally for the rescaling. Move pseudocode for count_leading_zeros to introduction, and use it in the implementation of CLZ. Change-Id: I2453bce93b6dd25e870b8a010fc62af4c001cbf9
2020-11-29Fix minor spec issuesEric Kunze
Profile for EXP operator TANH table formatting Remove dilation from TRANSPOSE_CONV2D Change-Id: I2a265fecfb25ad997fdc992ad8542000014ac7c0
2020-11-13Replace proprietary notice with the full TOSA Specification LicenseTom Cooksey
The new license grants the rights needed to create a completely independent implementation of the specification. Signed-off-by: Tom Cooksey <tom.cooksey@arm.com> Change-Id: I1ca2cedf83c3f31df49096ecb6faaae060c3dc91
2020-11-10Update revision to 0.21.0v0.21.0Eric Kunze
Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: Ie2d83c66600cb01f39992c6b0c168fea2917330c
2020-11-10Update introduction sectionsEric Kunze
Bring the overview and goals up to date. Incorporate a section on finding the source to the spec and building it. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I8c862f8e58b01091d5561296702bcae83a8517e9
2020-11-10Update RESIZE descriptionEric Kunze
Try to make the different modes clearer, especially the integer BILINEAR mode. Change-Id: I6a2ab6ee4ed9e6a76d13bec4498e213a7f20b91f Signed-off-by: Eric Kunze <eric.kunze@arm.com>
2020-11-10SCATTER: Add operationDominic Symes
Add the scatter operation to the gather/scatter section. Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: I9baaef91bf70eae3b13e6e585df6c4821a0c1a93
2020-11-06GATHER: Add operation codeDominic Symes
Add the operation code for GATHER and reduce number of arguments. Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: I51b6ede43dcae1e1aec7a11a75a1e4bf6c668673
2020-11-06Operator argument consistency improvement.Eric Kunze
Add values attribute to CONST operator. Remove stale references to input tensor 0 and 1. Remove out_t types where in and out are guaranteed to be the same type. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I75a8eb4dee67afbee3652d9e937aa0b82318dbd0
2020-11-05Fix output argument type for convolutionsEric Kunze
Was out_t, which wasn't in the data types table. Switch to acc_t, the size of the accumulator, which is the output type for the convolutions. Also added some types into the pseudocode to clarify what types variables are. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I210220199c2d39b16938094022339286df040545