diff options
Diffstat (limited to 'schema/tosa.fbs')
-rw-r--r-- | schema/tosa.fbs | 144 |
1 files changed, 72 insertions, 72 deletions
diff --git a/schema/tosa.fbs b/schema/tosa.fbs index 57440ef..79b83b1 100644 --- a/schema/tosa.fbs +++ b/schema/tosa.fbs @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2021, ARM Limited. +// Copyright (c) 2020-2024, ARM Limited. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,6 +20,9 @@ file_identifier "TOSA"; // File extension of any written files. file_extension "tosa"; +// NOTE: New values added to the schema should be placed +// at the end of the list in order to keep schema stable. + enum DType:uint32 { UNKNOWN = 0, BOOL, @@ -29,8 +32,13 @@ enum DType:uint32 { INT16, INT32, INT48, - FLOAT, + FP32, UINT16, + FP16, + BF16, + SHAPE, + FP8E4M3, + FP8E5M2, } enum ResizeMode:uint32 { @@ -41,8 +49,6 @@ enum ResizeMode:uint32 { enum Op:uint32 { UNKNOWN = 0, - - // Tensor Operator ARGMAX, AVG_POOL2D, CONV2D, @@ -52,14 +58,10 @@ enum Op:uint32 { MATMUL, MAX_POOL2D, TRANSPOSE_CONV2D, - - // Activation CLAMP, RESERVED, SIGMOID, TANH, - - // Elementwise-Binary ADD, ARITHMETIC_RIGHT_SHIFT, BITWISE_AND, @@ -77,8 +79,6 @@ enum Op:uint32 { POW, SUB, TABLE, - - // Elementwise-Unary ABS, BITWISE_NOT, CEIL, @@ -90,24 +90,16 @@ enum Op:uint32 { NEGATE, RECIPROCAL, RSQRT, - - // Elementwise-Ternary SELECT, - - // Logical EQUAL, GREATER, GREATER_EQUAL, - - // Reduction REDUCE_ANY, REDUCE_ALL, REDUCE_MAX, REDUCE_MIN, REDUCE_PRODUCT, REDUCE_SUM, - - // Data layout operation CONCAT, PAD, RESHAPE, @@ -115,28 +107,28 @@ enum Op:uint32 { SLICE, TILE, TRANSPOSE, - - // Gather/scatter operation GATHER, SCATTER, - - // Image RESIZE, - - // Type conversion CAST, RESCALE, - - // Data Nodes CONST, IDENTITY, - - // Custom operations CUSTOM, - - // Control flow operators COND_IF, WHILE_LOOP, + FFT2D, + RFFT2D, + ERF, + DIM, + CONST_SHAPE, + CONCAT_SHAPE, + ADD_SHAPE, + SUB_SHAPE, + MUL_SHAPE, + DIV_SHAPE, + COS, + SIN, } union Attribute { @@ -145,9 +137,6 @@ union Attribute { TransposeConvAttribute, PadAttribute, AxisAttribute, - ReshapeAttribute, - SliceAttribute, - TileAttribute, ResizeAttribute, ClampAttribute, RescaleAttribute, @@ -159,7 +148,10 @@ union Attribute { TableAttribute, MatMulAttribute, FullyConnectedAttribute, - NegateAttribute + NegateAttribute, + CustomAttribute, + FFTAttribute, + RFFTAttribute, } table PoolAttribute { @@ -168,6 +160,7 @@ table PoolAttribute { stride: [int32]; input_zp: int32; output_zp: int32; + acc_type: DType; } table ConvAttribute { @@ -176,6 +169,8 @@ table ConvAttribute { dilation: [int32]; input_zp: int32; weight_zp: int32; + local_bound: bool; + acc_type: DType; } table TransposeConvAttribute { @@ -184,56 +179,38 @@ table TransposeConvAttribute { output_shape: [int32]; input_zp: int32; weight_zp: int32; + local_bound: bool; + acc_type: DType; } table PadAttribute { - padding: [int32]; - pad_const_int: int32; - pad_const_fp: float; + pad_const: [ubyte] (force_align: 8); } table AxisAttribute { axis: int32; } -table ReshapeAttribute { - new_shape: [int32]; -} - -table SliceAttribute { - start: [int32]; - size: [int32]; -} - -table TileAttribute { - multiples: [int32]; -} - table ResizeAttribute { - output_size: [int32]; - stride: [int32]; - offset: [int32]; - shift: int32; - stride_fp: [float]; - offset_fp: [float]; + scale: [int16]; + offset: [int16]; + border: [int16]; mode: ResizeMode; } table ClampAttribute { - min_int: int32; - max_int: int32; - min_fp: float; - max_fp: float; + min_val: [ubyte] (force_align: 8); + max_val: [ubyte] (force_align: 8); } table RescaleAttribute { input_zp: int32; output_zp: int32; - multiplier: [int32]; - shift: [int32]; scale32: bool; double_round: bool; per_channel: bool; + input_unsigned: bool; + output_unsigned: bool; } table MulAttribute { @@ -245,13 +222,13 @@ table ArithmeticRightShiftAttribute { } table CondIfAttribute { - then_branch: string; - else_branch: string; + then_graph: string; + else_graph: string; } table WhileLoopAttribute { - cond_branch: string; - body_branch: string; + cond_graph: string; + body_graph: string; } table TransposeAttribute { @@ -277,10 +254,25 @@ table NegateAttribute { output_zp: int32; } +table CustomAttribute { + operator_name:string; + domain_name:string; + implementation_attrs:[ubyte]; +} + +table FFTAttribute { + inverse: bool; + local_bound: bool; +} + +table RFFTAttribute { + local_bound: bool; +} + table Version { - _major: int32 = 0; - _minor: int32 = 31; - _patch: int32 = 0; + _major: int32 = -1; + _minor: int32 = -1; + _patch: int32 = -1; _draft: bool = true; } @@ -289,11 +281,14 @@ table TosaTensor { shape:[int32]; // shape of the tensor type:DType; // data type of the tensor data: [ubyte] (force_align: 8); // raw data array if it's a constant tensor. + variable: bool; // is this a variable tensor + is_unranked: bool; // whether this is an unranked tensor + variable_name:string; // name for variable attribute } table TosaOperator { op:Op; // operator enum - attribute: Attribute; // union structure. operator attribute + attribute:Attribute; // union structure. operator attribute inputs:[string]; // list of input tensor names outputs:[string]; // list of output tensor names } @@ -306,9 +301,14 @@ table TosaBasicBlock { outputs:[string]; // name of graph outputs } +table TosaRegion { + name:string; // name of region + blocks:[TosaBasicBlock]; // basic blocks array +} + table TosaGraph { - version: Version; - blocks:[TosaBasicBlock]; // basic blocks array + version:Version (required); + regions:[TosaRegion]; // regions array } root_type TosaGraph; |