aboutsummaryrefslogtreecommitdiff
path: root/src/armnnSerializer/ArmnnSchema.fbs
diff options
context:
space:
mode:
authorJames Conroy <james.conroy@arm.com>2020-05-13 10:27:58 +0100
committerJames Conroy <james.conroy@arm.com>2020-05-13 23:06:38 +0000
commit8d33318a7ac33d90ed79701ff717de8d9940cc67 (patch)
tree2cf4140ec37b5b0a43b9618bab7f4f8076b5f4ab /src/armnnSerializer/ArmnnSchema.fbs
parent5061601fb6833dda20a6097af6a92e5e07310f25 (diff)
downloadarmnn-8d33318a7ac33d90ed79701ff717de8d9940cc67.tar.gz
IVGCVSW-4777 Add QLstm serialization support
* Adds serialization/deserilization for QLstm. * 3 unit tests: basic, layer norm and advanced. Signed-off-by: James Conroy <james.conroy@arm.com> Change-Id: I97d825e06b0d4a1257713cdd71ff06afa10d4380
Diffstat (limited to 'src/armnnSerializer/ArmnnSchema.fbs')
-rw-r--r--src/armnnSerializer/ArmnnSchema.fbs93
1 files changed, 77 insertions, 16 deletions
diff --git a/src/armnnSerializer/ArmnnSchema.fbs b/src/armnnSerializer/ArmnnSchema.fbs
index ff79f6cffe..6e5ee3f3d3 100644
--- a/src/armnnSerializer/ArmnnSchema.fbs
+++ b/src/armnnSerializer/ArmnnSchema.fbs
@@ -155,7 +155,8 @@ enum LayerType : uint {
Comparison = 52,
StandIn = 53,
ElementwiseUnary = 54,
- Transpose = 55
+ Transpose = 55,
+ QLstm = 56
}
// Base layer table to be used as part of other layers
@@ -666,37 +667,96 @@ table LstmInputParams {
outputLayerNormWeights:ConstTensor;
}
-table QuantizedLstmInputParams {
- inputToInputWeights:ConstTensor;
+table LstmDescriptor {
+ activationFunc:uint;
+ clippingThresCell:float;
+ clippingThresProj:float;
+ cifgEnabled:bool = true;
+ peepholeEnabled:bool = false;
+ projectionEnabled:bool = false;
+ layerNormEnabled:bool = false;
+}
+
+table LstmLayer {
+ base:LayerBase;
+ descriptor:LstmDescriptor;
+ inputParams:LstmInputParams;
+}
+
+table QLstmInputParams {
+ // Mandatory
inputToForgetWeights:ConstTensor;
inputToCellWeights:ConstTensor;
inputToOutputWeights:ConstTensor;
- recurrentToInputWeights:ConstTensor;
recurrentToForgetWeights:ConstTensor;
recurrentToCellWeights:ConstTensor;
recurrentToOutputWeights:ConstTensor;
- inputGateBias:ConstTensor;
forgetGateBias:ConstTensor;
cellBias:ConstTensor;
outputGateBias:ConstTensor;
+
+ // CIFG
+ inputToInputWeights:ConstTensor;
+ recurrentToInputWeights:ConstTensor;
+ inputGateBias:ConstTensor;
+
+ // Projection
+ projectionWeights:ConstTensor;
+ projectionBias:ConstTensor;
+
+ // Peephole
+ cellToInputWeights:ConstTensor;
+ cellToForgetWeights:ConstTensor;
+ cellToOutputWeights:ConstTensor;
+
+ // Layer norm
+ inputLayerNormWeights:ConstTensor;
+ forgetLayerNormWeights:ConstTensor;
+ cellLayerNormWeights:ConstTensor;
+ outputLayerNormWeights:ConstTensor;
}
-table LstmDescriptor {
- activationFunc:uint;
- clippingThresCell:float;
- clippingThresProj:float;
- cifgEnabled:bool = true;
- peepholeEnabled:bool = false;
+table QLstmDescriptor {
+ cifgEnabled:bool = true;
+ peepholeEnabled:bool = false;
projectionEnabled:bool = false;
- layerNormEnabled:bool = false;
+ layerNormEnabled:bool = false;
+
+ cellClip:float;
+ projectionClip:float;
+
+ inputIntermediateScale:float;
+ forgetIntermediateScale:float;
+ cellIntermediateScale:float;
+ outputIntermediateScale:float;
+
+ hiddenStateZeroPoint:int;
+ hiddenStateScale:float;
}
-table LstmLayer {
+table QLstmLayer {
base:LayerBase;
- descriptor:LstmDescriptor;
- inputParams:LstmInputParams;
+ descriptor:QLstmDescriptor;
+ inputParams:QLstmInputParams;
+}
+
+table QuantizedLstmInputParams {
+ inputToInputWeights:ConstTensor;
+ inputToForgetWeights:ConstTensor;
+ inputToCellWeights:ConstTensor;
+ inputToOutputWeights:ConstTensor;
+
+ recurrentToInputWeights:ConstTensor;
+ recurrentToForgetWeights:ConstTensor;
+ recurrentToCellWeights:ConstTensor;
+ recurrentToOutputWeights:ConstTensor;
+
+ inputGateBias:ConstTensor;
+ forgetGateBias:ConstTensor;
+ cellBias:ConstTensor;
+ outputGateBias:ConstTensor;
}
table QuantizedLstmLayer {
@@ -836,7 +896,8 @@ union Layer {
ComparisonLayer,
StandInLayer,
ElementwiseUnaryLayer,
- TransposeLayer
+ TransposeLayer,
+ QLstmLayer
}
table AnyLayer {