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 ConstCpuTensorHandle * m_CellToForgetWeights
const ConstCpuTensorHandle * m_ProjectionWeights
void InitializeArmComputeClTensorData(arm_compute::CLTensor &clTensor, const ConstCpuTensorHandle *handle)
bool m_PeepholeEnabled
Enable/disable peephole.
const ConstCpuTensorHandle * m_ProjectionBias
float m_HiddenStateScale
Hidden State quantization scale.
const ConstCpuTensorHandle * m_ForgetLayerNormWeights
const QLstmQueueDescriptor m_Data
float m_OutputIntermediateScale
Output intermediate quantization scale.
const ConstCpuTensorHandle * m_CellLayerNormWeights
const ConstCpuTensorHandle * m_RecurrentToCellWeights
const ConstCpuTensorHandle * m_RecurrentToInputWeights
const ConstCpuTensorHandle * m_OutputGateBias
const ConstCpuTensorHandle * m_CellBias
LayerDescriptor m_Parameters
const ConstCpuTensorHandle * m_CellToOutputWeights
const ConstCpuTensorHandle * m_OutputLayerNormWeights
bool m_LayerNormEnabled
Enable/disable layer normalization.
const ConstCpuTensorHandle * m_InputToForgetWeights
float m_ProjectionClip
Clipping threshold value for the projection.
float m_InputIntermediateScale
Input intermediate quantization scale.
float m_ForgetIntermediateScale
Forget intermediate quantization scale.
const ConstCpuTensorHandle * m_CellToInputWeights
float m_CellClip
Clipping threshold value for the cell state.
const ConstCpuTensorHandle * m_RecurrentToOutputWeights
std::vector< ITensorHandle * > m_Outputs
bool m_ProjectionEnabled
Enable/disable the projection layer.
const ConstCpuTensorHandle * m_InputGateBias
std::vector< ITensorHandle * > m_Inputs
const ConstCpuTensorHandle * m_InputLayerNormWeights
const ConstCpuTensorHandle * m_RecurrentToForgetWeights
const ConstCpuTensorHandle * m_ForgetGateBias
float m_CellIntermediateScale
Cell intermediate quantization scale.
const ConstCpuTensorHandle * m_InputToOutputWeights
bool m_CifgEnabled
Enable/disable CIFG (coupled input & forget gate).
const TensorInfo & GetTensorInfo() const
const ConstCpuTensorHandle * m_InputToInputWeights
int32_t m_HiddenStateZeroPoint
Hidden State zero point.
const ConstCpuTensorHandle * m_InputToCellWeights