diff options
-rw-r--r-- | chapters/introduction.adoc | 10 | ||||
-rw-r--r-- | tools/tosa.py | 1 | ||||
-rw-r--r-- | tosa.xml | 4 | ||||
-rw-r--r-- | tosa.xsd | 2 |
4 files changed, 11 insertions, 6 deletions
diff --git a/chapters/introduction.adoc b/chapters/introduction.adoc index b1d92d9..f3a6454 100644 --- a/chapters/introduction.adoc +++ b/chapters/introduction.adoc @@ -331,11 +331,13 @@ Tensor elements are addressed using dim_t values, where each element of the vect ==== Tensor size limit -The tensor overall size in elements is limited by the data type size_t. -In this version of the specification, size_t is defined as an unsigned 32-bit integer representing size from 1 to (1<<32) - 1. +The tensor overall size is limited by the data type size_t. +This type must be able to hold integers in the range 0 to (1++<<++(MAX_LOG2_SIZE+1)) - 1 where MAX_LOG2_SIZE is defined in <<Levels>>. +For each tensor, the number of tensor elements multiplied by the element size in bytes (which is taken to be 1 for elements smaller than a 8-bit) must be less than or equal to (1<<(MAX_LOG2_SIZE+1)) - 1. + The size of tensors along each of their dimensions is limited by the data type index_t. -In this version of the specification, index_t is defined as a signed 32-bit integer. -This means that the maximum size of a tensor along each dimension is (1<<31) - 1 and therefore the maximum coordinate value is (1<<31) - 2. +This type must be able to hold integers in the range 0 to (1++<<++MAX_LOG2_SIZE) - 1 where MAX_LOG2_SIZE is defined in <<Levels>>. +This means that the maximum size of a tensor along each dimension is (1<<MAX_LOG2_SIZE) - 1 and therefore the maximum coordinate value is (1<<MAX_LOG2_SIZE) - 2. Indices used to access tensors must be non-negative. ==== Data Layouts diff --git a/tools/tosa.py b/tools/tosa.py index 265d5f6..52fda3e 100644 --- a/tools/tosa.py +++ b/tools/tosa.py @@ -86,6 +86,7 @@ class TOSASpec: 'MAX_KERNEL': level.get("max_kernel"), 'MAX_STRIDE': level.get("max_stride"), 'MAX_SCALE': level.get("max_scale"), + 'MAX_LOG2_SIZE' : level.get("max_log2_size"), } return TOSALevel(name, desc, maximums) @@ -8,8 +8,8 @@ <profile name="MT">Main Training</profile> </profiles> <levels> - <level name="none" max_rank="32" max_kernel="2147483647" max_stride="2147483647" max_scale="2048">No level</level> - <level name="8K" max_rank="6" max_kernel="8192" max_stride="8192" max_scale="64" >Level 8K</level> + <level name="none" max_rank="32" max_kernel="2147483647" max_stride="2147483647" max_scale="2048" max_log2_size="63">No level</level> + <level name="8K" max_rank="6" max_kernel="8192" max_stride="8192" max_scale="64" max_log2_size="31">Level 8K</level> </levels> <operators> <operatorgroup name="tensor"> @@ -24,6 +24,7 @@ <xs:enumeration value="MAX_STRIDE"/> <xs:enumeration value="MAX_SCALE"/> <xs:enumeration value="MAX_RANK"/> + <xs:enumeration value="MAX_LOG2_SIZE"/> </xs:restriction> </xs:simpleType> @@ -95,6 +96,7 @@ <xs:attribute name="max_kernel" type="xs:int" use="required"/> <xs:attribute name="max_stride" type="xs:int" use="required"/> <xs:attribute name="max_scale" type="xs:int" use="required"/> + <xs:attribute name="max_log2_size" type="xs:int" use="required"/> </xs:extension> </xs:simpleContent> </xs:complexType> |