aboutsummaryrefslogtreecommitdiff
path: root/chapters/data_layout.adoc
AgeCommit message (Collapse)Author
2024-04-12Move DIM to Shape operator sectionEric Kunze
Is more appropriate than the Data Layout section Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I5427d867b13a69dc0d66e268db4c64e047c65c7f
2024-01-31Add section of shape operatorsv0.90.0Eric Kunze
Rework of the shape operations. Shape operations are now done in shape specific operators rather than being based on type. shape_t is reworked to a list of size_t values. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I2fca0728f9caa6a6fc34a8ce9e389bb581eea959
2024-01-15Move operator pseudocode to separate filesKevin Petit
This makes it easier to process the pseudocode automatically. Change-Id: I84394192598e589de07d43a7af60b96788e14f86 Signed-off-by: Kevin Petit <kevin.petit@arm.com>
2023-08-16Add DIM operator and operations on shape_t valuesDominic Symes
Shape inference derives the shape of tensors in the graph from input shapes. Operations such as RESHAPE may need calculations to derive the new tensor shape. This patch: - Adds a DIM operator to get the size of a tensor in a given axis as a rank 0 tensor of type shape_t - Allows RESHAPE to take a 1D shape tensor as input for the new shape - Allows RESIZE, TILE, PAD to take input sizes based on shape tensors. - Allows ADD, SUB, MUL, INTDIV to operate on rank 0 shape_t tensors - Allows CONCAT to concatenate 0D shape_t tensors to a 1D shape_t tensor - Adds CONST support for shape_t tensors In this version of the specification shape tensors must be resolvable to constants at backend compile time. Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: I484bd44452453b5e05d0d8a82689564587b224e4
2023-02-24Fix rank limits for various data layout operationsLuke Hutton
This commit removes the maximum rank 4 restriction from REVERSE, SLICE and TILE operations so that the new maximum is now MAX_RANK. In doing so some rank inconsistencies were also cleaned up, including: * Adding a minimum rank to the PAD op description * Adding level limit checks to SLICE and TILE ops * Adding checks for rank(shape1) == rank(shape) for TILE and TRANSPOSE ops * Add tensor_size(shape1) == tensor_size(shape) check for TRANSPOSE * Replace tensor name with shape name in pesudo code where necessary Change-Id: I94bb8ee0b6b720b2ba5a884ce9300dca6281245a Signed-off-by: Luke Hutton <luke.hutton@arm.com>
2022-12-05Add Levels defintionDominic Symes
Add definition of Level 1.0. Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: I1b34ae22396f273cc5ecdf99198fdbece6e2809c
2022-11-30SLICE: remove the mention of an axis in the descriptionKevin Petit
No such attribute. Signed-off-by: Kevin Petit <kevin.petit@arm.com> Change-Id: If1b1ece15589e9bf07971542783f51294a05aab9
2022-10-19Define the index type for tensor co-ordinatesDominic Symes
Tensor co-ordinate indices are signed 32-bit values in this version of the specification. Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: I6b8dde500ef9c4c4c5688c1a43f8d658863e4a49
2022-08-19Machine parsable specificationEric Kunze
This converts portions of the asciidoc specification into an xml document and schema. For the html and pdf outputs, the xml is converted to asciidoc files that are included into the existing specification. The xml allows future automated uses of the tosa specification while maintaining rough compatibility with the existing document. No significant functional changes are included in this change. Change-Id: I7f1f95c527638e270c157d58fcdec6a3510daea5 Signed-off-by: Eric Kunze <eric.kunze@arm.com>
2022-08-15PAD: Check output shapeDominic Symes
Check output shape matches the padded input shape. Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: I8e335ce9b086a36d9e38aa332ecc88782e040cc6
2022-06-17Initial work on floating-point type definitionEric Kunze
Define operations in terms of common floating-point data types. Definitions for the data types are in the introduction. Added a section to describe status of the different profiles. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: Iac57026806acfb7913f40af61176322fb02b7cc1
2022-06-17Rework the introductionEric Kunze
The information on quantization and numerics was out of date. The tensor access helpers were also consolidated and moved into their own section in the pseudocode chapter. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I472e674ed88f4a3ef379010cf50b13cf8afa5f17
2022-05-26Update RESHAPE pseudocodeEric Kunze
Remove the calculation of a -1 dimension from the operator. Calculates the new coordinates, and adds the proper tensor_read/tensor_write for the data. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: Iad1d83c170732bdfb3652dead9044809168b23d2
2022-05-24Fix typo in TILE operatorEric Kunze
Replicates multiples times, not multiplies. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I78c19013d08295171a20fead17661a8f9ea68ac8
2022-05-03Specify width of integer typesDominic Symes
Clarify for types previously definded as int the width assumed by the specification. Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: Ied62d4803a4323a600d33cff09752a76ca48f18d
2022-03-16Update TRANSPOSE argument descriptionEric Kunze
Define the perms argument more clearly Change-Id: I9ea695ef38c2a8160ba0fc2020fa28150942e39e Signed-off-by: Eric Kunze <eric.kunze@arm.com>
2022-01-10Simplify shape checking for TRANSPOSEEric Kunze
Have a simple outer check for proper size rather than checking during the inner loop. Change-Id: I20312c5f6b4aacbb630a2df0f901d8586caa04c0 Signed-off-by: Eric Kunze <eric.kunze@arm.com>
2021-11-12Use in_out_t when a type is used for input and outputEric Kunze
Also change acc_t to out_t when the value is being used as an output. This should make the argument tables easier to follow. Change-Id: I2a57f3c4eaf937f29da785ff5c11576663a39494
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-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-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-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-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-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-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
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-05Clean input argument rank limitationsEric Kunze
Comparison ops, similar to the other elementwise ops, can operate on tensors of any rank. For those operators with rank limitations, make them consistent and remove "dims". Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I33eb00122cec4c6625f080f9ed640f1d874fae87
2020-10-22Make rank() consistent across filesDominic Symes
Complete the function naming change from dimensions() to rank(). Fix MATMUL to use apply_add() for additions, consistent with the other operations. Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: I6ba84cf8b016505e8477b04dd00f2a2bf3194492
2020-10-14Updates to reduction and reverse operationsDominic Symes
Simplify the reduction and reverse reference by apply one axis at a time and default to keep_dims. (Changes to shape can be done separately with RESHAPE) Signed-off-by: Dominic Symes <dominic.symes@arm.com> Change-Id: I590bdb6bc05b1c673f86e3f45f0a43536d8f362a
2020-10-01TOSA spec 0.20.0, initial public versionv0.20.0Eric Kunze
Change-Id: I7c528ebf7e78759ada4bb951b2471c367d3f4525