20 : BaseWorkload<QLstmQueueDescriptor>(descriptor,
info)
22 arm_compute::LSTMParams<arm_compute::ICLTensor> qLstmParams;
25 m_InputToForgetWeightsTensor = std::make_unique<arm_compute::CLTensor>();
28 m_InputToCellWeightsTensor = std::make_unique<arm_compute::CLTensor>();
31 m_InputToOutputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
34 m_RecurrentToForgetWeightsTensor = std::make_unique<arm_compute::CLTensor>();
37 m_RecurrentToCellWeightsTensor = std::make_unique<arm_compute::CLTensor>();
40 m_RecurrentToOutputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
43 m_ForgetGateBiasTensor = std::make_unique<arm_compute::CLTensor>();
46 m_CellBiasTensor = std::make_unique<arm_compute::CLTensor>();
49 m_OutputGateBiasTensor = std::make_unique<arm_compute::CLTensor>();
55 m_CellToInputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
63 m_CellToForgetWeightsTensor = std::make_unique<arm_compute::CLTensor>();
66 m_CellToOutputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
70 qLstmParams.set_peephole_params(m_CellToForgetWeightsTensor.get(),
71 m_CellToOutputWeightsTensor.get());
76 m_ProjectionWeightsTensor = std::make_unique<arm_compute::CLTensor>();
79 m_ProjectionBiasTensor = std::make_unique<arm_compute::CLTensor>();
86 qLstmParams.set_projection_params(
87 m_ProjectionWeightsTensor.get(),
93 m_InputLayerNormWeightsTensor = std::make_unique<arm_compute::CLTensor>();
100 m_ForgetLayerNormWeightsTensor = std::make_unique<arm_compute::CLTensor>();
103 m_CellLayerNormWeightsTensor = std::make_unique<arm_compute::CLTensor>();
106 m_OutputLayerNormWeightsTensor = std::make_unique<arm_compute::CLTensor>();
110 qLstmParams.set_layer_normalization_params(
112 m_ForgetLayerNormWeightsTensor.get(),
113 m_CellLayerNormWeightsTensor.get(),
114 m_OutputLayerNormWeightsTensor.get());
119 m_InputToInputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
122 m_RecurrentToInputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
125 m_InputGateBiasTensor = std::make_unique<arm_compute::CLTensor>();
129 qLstmParams.set_cifg_params(
130 m_InputToInputWeightsTensor.get(),
131 m_RecurrentToInputWeightsTensor.get(),
133 m_InputGateBiasTensor.get());
137 const arm_compute::ICLTensor& input =
static_cast<IClTensorHandle*
>(
m_Data.
m_Inputs[0])->GetTensor();
138 arm_compute::ICLTensor& outputStateIn =
static_cast<IClTensorHandle*
>(
m_Data.
m_Inputs[1])->GetTensor();
139 arm_compute::ICLTensor& cellStateIn =
static_cast<IClTensorHandle*
>(
m_Data.
m_Inputs[2])->GetTensor();
141 arm_compute::ICLTensor& outputStateOut =
static_cast<IClTensorHandle*
>(
m_Data.
m_Outputs[0])->GetTensor();
142 arm_compute::ICLTensor& cellStateOut =
static_cast<IClTensorHandle*
>(
m_Data.
m_Outputs[1])->GetTensor();
143 arm_compute::ICLTensor& output =
static_cast<IClTensorHandle*
>(
m_Data.
m_Outputs[2])->GetTensor();
156 m_QLstmLayer.configure(clCompileContext,
158 m_InputToForgetWeightsTensor.get(),
159 m_InputToCellWeightsTensor.get(),
160 m_InputToOutputWeightsTensor.get(),
161 m_RecurrentToForgetWeightsTensor.get(),
162 m_RecurrentToCellWeightsTensor.get(),
163 m_RecurrentToOutputWeightsTensor.get(),
164 m_ForgetGateBiasTensor.get(),
165 m_CellBiasTensor.get(),
166 m_OutputGateBiasTensor.get(),
227 m_QLstmLayer.prepare();
const ConstTensorHandle * m_CellLayerNormWeights
const ConstTensorHandle * m_ProjectionWeights
const ConstTensorHandle * m_ForgetGateBias
const ConstTensorHandle * m_InputToOutputWeights
bool m_PeepholeEnabled
Enable/disable peephole.
float m_HiddenStateScale
Hidden State quantization scale.
const ConstTensorHandle * m_InputToInputWeights
const ConstTensorHandle * m_CellToOutputWeights
float m_OutputIntermediateScale
Output intermediate quantization scale.
const ConstTensorHandle * m_CellToInputWeights
LayerDescriptor m_Parameters
const ConstTensorHandle * m_ForgetLayerNormWeights
const TensorInfo & GetTensorInfo() const
bool m_LayerNormEnabled
Enable/disable layer normalization.
QLstmQueueDescriptor m_Data
float m_ProjectionClip
Clipping threshold value for the projection.
const ConstTensorHandle * m_InputToForgetWeights
float m_InputIntermediateScale
Input intermediate quantization scale.
const ConstTensorHandle * m_CellBias
const ConstTensorHandle * m_InputLayerNormWeights
float m_ForgetIntermediateScale
Forget intermediate quantization scale.
const ConstTensorHandle * m_InputToCellWeights
float m_CellClip
Clipping threshold value for the cell state.
const ConstTensorHandle * m_CellToForgetWeights
const ConstTensorHandle * m_ProjectionBias
std::vector< ITensorHandle * > m_Outputs
const ConstTensorHandle * m_RecurrentToCellWeights
bool m_ProjectionEnabled
Enable/disable the projection layer.
const ConstTensorHandle * m_InputGateBias
const ConstTensorHandle * m_OutputGateBias
void InitializeArmComputeClTensorData(arm_compute::CLTensor &clTensor, const ConstTensorHandle *handle)
std::vector< ITensorHandle * > m_Inputs
const ConstTensorHandle * m_OutputLayerNormWeights
float m_CellIntermediateScale
Cell intermediate quantization scale.
const ConstTensorHandle * m_RecurrentToOutputWeights
const ConstTensorHandle * m_RecurrentToInputWeights
bool m_CifgEnabled
Enable/disable CIFG (coupled input & forget gate).
const ConstTensorHandle * m_RecurrentToForgetWeights
int32_t m_HiddenStateZeroPoint
Hidden State zero point.