20 : ClBaseWorkload<QLstmQueueDescriptor>(descriptor,
info)
24 descriptor.m_Parameters,
28 arm_compute::LSTMParams<arm_compute::ICLTensor> qLstmParams;
31 m_InputToForgetWeightsTensor = std::make_unique<arm_compute::CLTensor>();
34 m_InputToCellWeightsTensor = std::make_unique<arm_compute::CLTensor>();
37 m_InputToOutputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
40 m_RecurrentToForgetWeightsTensor = std::make_unique<arm_compute::CLTensor>();
43 m_RecurrentToCellWeightsTensor = std::make_unique<arm_compute::CLTensor>();
46 m_RecurrentToOutputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
49 m_ForgetGateBiasTensor = std::make_unique<arm_compute::CLTensor>();
52 m_CellBiasTensor = std::make_unique<arm_compute::CLTensor>();
55 m_OutputGateBiasTensor = std::make_unique<arm_compute::CLTensor>();
61 m_CellToInputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
69 m_CellToForgetWeightsTensor = std::make_unique<arm_compute::CLTensor>();
72 m_CellToOutputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
76 qLstmParams.set_peephole_params(m_CellToForgetWeightsTensor.get(),
77 m_CellToOutputWeightsTensor.get());
82 m_ProjectionWeightsTensor = std::make_unique<arm_compute::CLTensor>();
85 m_ProjectionBiasTensor = std::make_unique<arm_compute::CLTensor>();
92 qLstmParams.set_projection_params(
93 m_ProjectionWeightsTensor.get(),
99 m_InputLayerNormWeightsTensor = std::make_unique<arm_compute::CLTensor>();
106 m_ForgetLayerNormWeightsTensor = std::make_unique<arm_compute::CLTensor>();
109 m_CellLayerNormWeightsTensor = std::make_unique<arm_compute::CLTensor>();
112 m_OutputLayerNormWeightsTensor = std::make_unique<arm_compute::CLTensor>();
116 qLstmParams.set_layer_normalization_params(
118 m_ForgetLayerNormWeightsTensor.get(),
119 m_CellLayerNormWeightsTensor.get(),
120 m_OutputLayerNormWeightsTensor.get());
125 m_InputToInputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
128 m_RecurrentToInputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
131 m_InputGateBiasTensor = std::make_unique<arm_compute::CLTensor>();
135 qLstmParams.set_cifg_params(
136 m_InputToInputWeightsTensor.get(),
137 m_RecurrentToInputWeightsTensor.get(),
139 m_InputGateBiasTensor.get());
143 const arm_compute::ICLTensor& input =
static_cast<IClTensorHandle*
>(
m_Data.
m_Inputs[0])->GetTensor();
144 arm_compute::ICLTensor& outputStateIn =
static_cast<IClTensorHandle*
>(
m_Data.
m_Inputs[1])->GetTensor();
145 arm_compute::ICLTensor& cellStateIn =
static_cast<IClTensorHandle*
>(
m_Data.
m_Inputs[2])->GetTensor();
147 arm_compute::ICLTensor& outputStateOut =
static_cast<IClTensorHandle*
>(
m_Data.
m_Outputs[0])->GetTensor();
148 arm_compute::ICLTensor& cellStateOut =
static_cast<IClTensorHandle*
>(
m_Data.
m_Outputs[1])->GetTensor();
149 arm_compute::ICLTensor& output =
static_cast<IClTensorHandle*
>(
m_Data.
m_Outputs[2])->GetTensor();
164 m_QLstmLayer.configure(clCompileContext,
166 m_InputToForgetWeightsTensor.get(),
167 m_InputToCellWeightsTensor.get(),
168 m_InputToOutputWeightsTensor.get(),
169 m_RecurrentToForgetWeightsTensor.get(),
170 m_RecurrentToCellWeightsTensor.get(),
171 m_RecurrentToOutputWeightsTensor.get(),
172 m_ForgetGateBiasTensor.get(),
173 m_CellBiasTensor.get(),
174 m_OutputGateBiasTensor.get(),
236 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
#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name)
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
#define ARMNN_REPORT_PROFILING_WORKLOAD_DESC(name, desc, infos, guid)
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.