blob: d7c7af7e107bf7e295ae8824d1a28ad8957da42e [file] [log] [blame]
Ryan OShea2323af42020-05-13 16:36:19 +01001//
2// Copyright © 2020 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "ClQLstmWorkload.hpp"
7#include "ClWorkloadUtils.hpp"
8
9#include "aclCommon/ArmComputeTensorUtils.hpp"
10
11#include "cl/ClTensorHandle.hpp"
12
13namespace armnn
14{
15using namespace armcomputetensorutils;
16
Sadik Armagane9444752020-12-02 11:28:58 +000017ClQLstmWorkload::ClQLstmWorkload(const QLstmQueueDescriptor& descriptor,
18 const WorkloadInfo& info,
19 const arm_compute::CLCompileContext& clCompileContext)
Ryan OShea2323af42020-05-13 16:36:19 +010020 : BaseWorkload<QLstmQueueDescriptor>(descriptor, info)
21{
Keith Davisbcd860a2021-08-05 14:20:33 +010022 // Report Profiling Details
23 ARMNN_REPORT_PROFILING_WORKLOAD_DESC("ClQLstmWorkload_Construct",
24 descriptor.m_Parameters,
25 info,
26 this->GetGuid());
27
Ryan OShea2323af42020-05-13 16:36:19 +010028 arm_compute::LSTMParams<arm_compute::ICLTensor> qLstmParams;
29
30 // Mandatory params
31 m_InputToForgetWeightsTensor = std::make_unique<arm_compute::CLTensor>();
32 BuildArmComputeTensor(*m_InputToForgetWeightsTensor, m_Data.m_InputToForgetWeights->GetTensorInfo());
33
34 m_InputToCellWeightsTensor = std::make_unique<arm_compute::CLTensor>();
35 BuildArmComputeTensor(*m_InputToCellWeightsTensor, m_Data.m_InputToCellWeights->GetTensorInfo());
36
37 m_InputToOutputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
38 BuildArmComputeTensor(*m_InputToOutputWeightsTensor, m_Data.m_InputToOutputWeights->GetTensorInfo());
39
40 m_RecurrentToForgetWeightsTensor = std::make_unique<arm_compute::CLTensor>();
41 BuildArmComputeTensor(*m_RecurrentToForgetWeightsTensor, m_Data.m_RecurrentToForgetWeights->GetTensorInfo());
42
43 m_RecurrentToCellWeightsTensor = std::make_unique<arm_compute::CLTensor>();
44 BuildArmComputeTensor(*m_RecurrentToCellWeightsTensor, m_Data.m_RecurrentToCellWeights->GetTensorInfo());
45
46 m_RecurrentToOutputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
47 BuildArmComputeTensor(*m_RecurrentToOutputWeightsTensor, m_Data.m_RecurrentToOutputWeights->GetTensorInfo());
48
49 m_ForgetGateBiasTensor = std::make_unique<arm_compute::CLTensor>();
50 BuildArmComputeTensor(*m_ForgetGateBiasTensor, m_Data.m_ForgetGateBias->GetTensorInfo());
51
52 m_CellBiasTensor = std::make_unique<arm_compute::CLTensor>();
53 BuildArmComputeTensor(*m_CellBiasTensor, m_Data.m_CellBias->GetTensorInfo());
54
55 m_OutputGateBiasTensor = std::make_unique<arm_compute::CLTensor>();
56 BuildArmComputeTensor(*m_OutputGateBiasTensor, m_Data.m_OutputGateBias->GetTensorInfo());
57
58 // Create tensors for optional params if they are enabled
59 if (m_Data.m_Parameters.m_PeepholeEnabled)
60 {
61 m_CellToInputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
62
63 if (!m_Data.m_Parameters.m_CifgEnabled)
64 {
65 // In ACL this is categorised as a CIFG param and not a Peephole param
66 BuildArmComputeTensor(*m_CellToInputWeightsTensor, m_Data.m_CellToInputWeights->GetTensorInfo());
67 }
68
69 m_CellToForgetWeightsTensor = std::make_unique<arm_compute::CLTensor>();
70 BuildArmComputeTensor(*m_CellToForgetWeightsTensor, m_Data.m_CellToForgetWeights->GetTensorInfo());
71
72 m_CellToOutputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
73 BuildArmComputeTensor(*m_CellToOutputWeightsTensor, m_Data.m_CellToOutputWeights->GetTensorInfo());
74
75 // Set Peephole params
76 qLstmParams.set_peephole_params(m_CellToForgetWeightsTensor.get(),
77 m_CellToOutputWeightsTensor.get());
78 }
79
80 if (m_Data.m_Parameters.m_ProjectionEnabled)
81 {
82 m_ProjectionWeightsTensor = std::make_unique<arm_compute::CLTensor>();
83 BuildArmComputeTensor(*m_ProjectionWeightsTensor, m_Data.m_ProjectionWeights->GetTensorInfo());
84
85 m_ProjectionBiasTensor = std::make_unique<arm_compute::CLTensor>();
86 if (m_Data.m_ProjectionBias != nullptr)
87 {
88 BuildArmComputeTensor(*m_ProjectionBiasTensor, m_Data.m_ProjectionBias->GetTensorInfo());
89 }
90
91 // Set projection params
92 qLstmParams.set_projection_params(
93 m_ProjectionWeightsTensor.get(),
94 m_Data.m_ProjectionBias != nullptr ? m_ProjectionBiasTensor.get() : nullptr);
95 }
96
97 if (m_Data.m_Parameters.m_LayerNormEnabled)
98 {
99 m_InputLayerNormWeightsTensor = std::make_unique<arm_compute::CLTensor>();
100
101 if (!m_Data.m_Parameters.m_CifgEnabled)
102 {
103 BuildArmComputeTensor(*m_InputLayerNormWeightsTensor, m_Data.m_InputLayerNormWeights->GetTensorInfo());
104 }
105
106 m_ForgetLayerNormWeightsTensor = std::make_unique<arm_compute::CLTensor>();
107 BuildArmComputeTensor(*m_ForgetLayerNormWeightsTensor, m_Data.m_ForgetLayerNormWeights->GetTensorInfo());
108
109 m_CellLayerNormWeightsTensor = std::make_unique<arm_compute::CLTensor>();
110 BuildArmComputeTensor(*m_CellLayerNormWeightsTensor, m_Data.m_CellLayerNormWeights->GetTensorInfo());
111
112 m_OutputLayerNormWeightsTensor = std::make_unique<arm_compute::CLTensor>();
113 BuildArmComputeTensor(*m_OutputLayerNormWeightsTensor, m_Data.m_OutputLayerNormWeights->GetTensorInfo());
114
Teresa Charlinbe727be2020-09-25 15:08:21 +0100115 // Set layer norm params
Ryan OShea2323af42020-05-13 16:36:19 +0100116 qLstmParams.set_layer_normalization_params(
117 m_Data.m_InputLayerNormWeights != nullptr ? m_InputLayerNormWeightsTensor.get() : nullptr,
118 m_ForgetLayerNormWeightsTensor.get(),
119 m_CellLayerNormWeightsTensor.get(),
120 m_OutputLayerNormWeightsTensor.get());
121 }
122
123 if (!m_Data.m_Parameters.m_CifgEnabled)
124 {
125 m_InputToInputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
126 BuildArmComputeTensor(*m_InputToInputWeightsTensor, m_Data.m_InputToInputWeights->GetTensorInfo());
127
128 m_RecurrentToInputWeightsTensor = std::make_unique<arm_compute::CLTensor>();
129 BuildArmComputeTensor(*m_RecurrentToInputWeightsTensor, m_Data.m_RecurrentToInputWeights->GetTensorInfo());
130
131 m_InputGateBiasTensor = std::make_unique<arm_compute::CLTensor>();
132 BuildArmComputeTensor(*m_InputGateBiasTensor, m_Data.m_InputGateBias->GetTensorInfo());
133
Teresa Charlinbe727be2020-09-25 15:08:21 +0100134 // Set CIFG params
Ryan OShea2323af42020-05-13 16:36:19 +0100135 qLstmParams.set_cifg_params(
136 m_InputToInputWeightsTensor.get(),
137 m_RecurrentToInputWeightsTensor.get(),
Teresa Charlinbe727be2020-09-25 15:08:21 +0100138 m_Data.m_CellToInputWeights != nullptr ? m_CellToInputWeightsTensor.get() : nullptr,
Ryan OShea2323af42020-05-13 16:36:19 +0100139 m_InputGateBiasTensor.get());
140 }
141
142 // Input/Output tensors
143 const arm_compute::ICLTensor& input = static_cast<IClTensorHandle*>(m_Data.m_Inputs[0])->GetTensor();
Nikhil Rajf3c27182020-09-24 17:58:34 +0100144 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();
Ryan OShea2323af42020-05-13 16:36:19 +0100146
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();
150
151 // Set scalar descriptor params
152 qLstmParams.set_cell_clip_params(m_Data.m_Parameters.m_CellClip);
153 qLstmParams.set_projection_clip_params(m_Data.m_Parameters.m_ProjectionClip);
154 qLstmParams.set_hidden_state_params(m_Data.m_Parameters.m_HiddenStateZeroPoint,
155 m_Data.m_Parameters.m_HiddenStateScale);
156 qLstmParams.set_matmul_scale_params(m_Data.m_Parameters.m_InputIntermediateScale,
157 m_Data.m_Parameters.m_ForgetIntermediateScale,
158 m_Data.m_Parameters.m_CellIntermediateScale,
159 m_Data.m_Parameters.m_OutputIntermediateScale);
160
Sadik Armagane9444752020-12-02 11:28:58 +0000161 // QLSTM CL configure
162 m_QLstmLayer.configure(clCompileContext,
163 &input,
Ryan OShea2323af42020-05-13 16:36:19 +0100164 m_InputToForgetWeightsTensor.get(),
165 m_InputToCellWeightsTensor.get(),
166 m_InputToOutputWeightsTensor.get(),
167 m_RecurrentToForgetWeightsTensor.get(),
168 m_RecurrentToCellWeightsTensor.get(),
169 m_RecurrentToOutputWeightsTensor.get(),
170 m_ForgetGateBiasTensor.get(),
171 m_CellBiasTensor.get(),
172 m_OutputGateBiasTensor.get(),
173 &cellStateIn,
174 &outputStateIn,
175 &cellStateOut,
176 &outputStateOut,
177 &output,
178 qLstmParams);
179
Teresa Charlinbe727be2020-09-25 15:08:21 +0100180 // Initialise ACL tensor data for mandatory params
Ryan OShea2323af42020-05-13 16:36:19 +0100181 InitializeArmComputeClTensorData(*m_InputToForgetWeightsTensor, m_Data.m_InputToForgetWeights);
182 InitializeArmComputeClTensorData(*m_InputToCellWeightsTensor, m_Data.m_InputToCellWeights);
183 InitializeArmComputeClTensorData(*m_InputToOutputWeightsTensor, m_Data.m_InputToOutputWeights);
184
185 InitializeArmComputeClTensorData(*m_RecurrentToForgetWeightsTensor, m_Data.m_RecurrentToForgetWeights);
186 InitializeArmComputeClTensorData(*m_RecurrentToCellWeightsTensor, m_Data.m_RecurrentToCellWeights);
187 InitializeArmComputeClTensorData(*m_RecurrentToOutputWeightsTensor, m_Data.m_RecurrentToOutputWeights);
188
189 InitializeArmComputeClTensorData(*m_ForgetGateBiasTensor, m_Data.m_ForgetGateBias);
190 InitializeArmComputeClTensorData(*m_CellBiasTensor, m_Data.m_CellBias);
191 InitializeArmComputeClTensorData(*m_OutputGateBiasTensor, m_Data.m_OutputGateBias);
192
Teresa Charlinbe727be2020-09-25 15:08:21 +0100193 // Initialise ACL tensor data for optional params
Ryan OShea2323af42020-05-13 16:36:19 +0100194 if (!m_Data.m_Parameters.m_CifgEnabled)
195 {
196 InitializeArmComputeClTensorData(*m_InputToInputWeightsTensor, m_Data.m_InputToInputWeights);
197 InitializeArmComputeClTensorData(*m_RecurrentToInputWeightsTensor, m_Data.m_RecurrentToInputWeights);
198 InitializeArmComputeClTensorData(*m_InputGateBiasTensor, m_Data.m_InputGateBias);
199 }
200
201 if (m_Data.m_Parameters.m_ProjectionEnabled)
202 {
203 InitializeArmComputeClTensorData(*m_ProjectionWeightsTensor, m_Data.m_ProjectionWeights);
204
205 if (m_Data.m_ProjectionBias != nullptr)
206 {
207 InitializeArmComputeClTensorData(*m_ProjectionBiasTensor, m_Data.m_ProjectionBias);
208 }
209 }
210
211 if (m_Data.m_Parameters.m_PeepholeEnabled)
212 {
213 if (!m_Data.m_Parameters.m_CifgEnabled)
214 {
215 InitializeArmComputeClTensorData(*m_CellToInputWeightsTensor, m_Data.m_CellToInputWeights);
216 }
217
218 InitializeArmComputeClTensorData(*m_CellToForgetWeightsTensor, m_Data.m_CellToForgetWeights);
219 InitializeArmComputeClTensorData(*m_CellToOutputWeightsTensor, m_Data.m_CellToOutputWeights);
220 }
221
222 if (m_Data.m_Parameters.m_LayerNormEnabled)
223 {
224 if (!m_Data.m_Parameters.m_CifgEnabled)
225 {
226 InitializeArmComputeClTensorData(*m_InputLayerNormWeightsTensor, m_Data.m_InputLayerNormWeights);
227 }
228 InitializeArmComputeClTensorData(*m_ForgetLayerNormWeightsTensor, m_Data.m_ForgetLayerNormWeights);
229 InitializeArmComputeClTensorData(*m_CellLayerNormWeightsTensor, m_Data.m_CellLayerNormWeights);
230 InitializeArmComputeClTensorData(*m_OutputLayerNormWeightsTensor, m_Data.m_OutputLayerNormWeights);
231 }
232
233 m_QLstmLayer.prepare();
234
235 FreeUnusedTensors();
236}
237
238void ClQLstmWorkload::Execute() const
239{
Keith Davisbcd860a2021-08-05 14:20:33 +0100240 ARMNN_SCOPED_PROFILING_EVENT_CL_GUID("ClQuantizedLstmWorkload_Execute", this->GetGuid());
Ryan OShea2323af42020-05-13 16:36:19 +0100241 m_QLstmLayer.run();
242}
243
244arm_compute::Status ClQLstmWorkloadValidate(const TensorInfo& input,
245 const TensorInfo& cellStateIn,
246 const TensorInfo& outputStateIn,
247 const TensorInfo& cellStateOut,
248 const TensorInfo& outputStateOut,
249 const TensorInfo& output,
250 const QLstmDescriptor& descriptor,
251 const LstmInputParamsInfo& paramsInfo)
252{
253 arm_compute::LSTMParams<arm_compute::ITensorInfo> aclParamsInfo;
254
Teresa Charlinbe727be2020-09-25 15:08:21 +0100255 // Input/Output tensor info
Ryan OShea2323af42020-05-13 16:36:19 +0100256 const arm_compute::TensorInfo aclInputInfo = BuildArmComputeTensorInfo(input);
257 const arm_compute::TensorInfo aclOutputStateInInfo = BuildArmComputeTensorInfo(outputStateIn);
258 const arm_compute::TensorInfo aclCellStateInInfo = BuildArmComputeTensorInfo(cellStateIn);
259
260 const arm_compute::TensorInfo aclOutputStateOutInfo = BuildArmComputeTensorInfo(outputStateOut);
261 const arm_compute::TensorInfo aclCellStateOutInfo = BuildArmComputeTensorInfo(cellStateOut);
262 const arm_compute::TensorInfo aclOutputInfo = BuildArmComputeTensorInfo(output);
263
264 // Mandatory tensor info
265 const arm_compute::TensorInfo aclInputToForgetWeightsInfo
266 = BuildArmComputeTensorInfo(paramsInfo.GetInputToForgetWeights());
267 const arm_compute::TensorInfo aclInputToCellWeightsInfo
268 = BuildArmComputeTensorInfo(paramsInfo.GetInputToCellWeights());
269 const arm_compute::TensorInfo aclInputToOutputWeightsInfo
270 = BuildArmComputeTensorInfo(paramsInfo.GetInputToOutputWeights());
271 const arm_compute::TensorInfo aclRecurrentToForgetWeightsInfo
272 = BuildArmComputeTensorInfo(paramsInfo.GetRecurrentToForgetWeights());
273 const arm_compute::TensorInfo aclRecurrentToCellWeightsInfo
274 = BuildArmComputeTensorInfo(paramsInfo.GetRecurrentToCellWeights());
275 const arm_compute::TensorInfo aclRecurrentToOutputWeightsInfo
276 = BuildArmComputeTensorInfo(paramsInfo.GetRecurrentToOutputWeights());
277 const arm_compute::TensorInfo aclForgetGateBiasInfo
278 = BuildArmComputeTensorInfo(paramsInfo.GetForgetGateBias());
279 const arm_compute::TensorInfo aclCellBiasInfo
280 = BuildArmComputeTensorInfo(paramsInfo.GetCellBias());
281 const arm_compute::TensorInfo aclOutputGateBiasInfo
282 = BuildArmComputeTensorInfo(paramsInfo.GetOutputGateBias());
283
284 // Optional tensor info
285 arm_compute::TensorInfo aclInputToInputWeightsInfo;
286 arm_compute::TensorInfo aclRecurrentToInputWeightsInfo;
Teresa Charlinbe727be2020-09-25 15:08:21 +0100287
Ryan OShea2323af42020-05-13 16:36:19 +0100288 arm_compute::TensorInfo aclCellToInputWeightsInfo;
289 arm_compute::TensorInfo aclCellToForgetWeightsInfo;
290 arm_compute::TensorInfo aclCellToOutputWeightsInfo;
Teresa Charlinbe727be2020-09-25 15:08:21 +0100291
Ryan OShea2323af42020-05-13 16:36:19 +0100292 arm_compute::TensorInfo aclInputGateBiasInfo;
Teresa Charlinbe727be2020-09-25 15:08:21 +0100293
Ryan OShea2323af42020-05-13 16:36:19 +0100294 arm_compute::TensorInfo aclProjectionWeightsInfo;
295 arm_compute::TensorInfo aclProjectionBiasInfo;
Teresa Charlinbe727be2020-09-25 15:08:21 +0100296
Ryan OShea2323af42020-05-13 16:36:19 +0100297 arm_compute::TensorInfo aclInputLayerNormWeightsInfo;
298 arm_compute::TensorInfo aclForgetLayerNormWeightsInfo;
299 arm_compute::TensorInfo aclCellLayerNormWeightsInfo;
300 arm_compute::TensorInfo aclOutputLayerNormWeightsInfo;
301
Teresa Charlinbe727be2020-09-25 15:08:21 +0100302 // Create tensor info for optional params if they are enabled
Ryan OShea2323af42020-05-13 16:36:19 +0100303 if (descriptor.m_PeepholeEnabled)
304 {
305 if (!descriptor.m_CifgEnabled)
306 {
307 aclCellToInputWeightsInfo = BuildArmComputeTensorInfo(paramsInfo.GetCellToInputWeights());
308 }
309
310 aclCellToForgetWeightsInfo = BuildArmComputeTensorInfo(paramsInfo.GetCellToForgetWeights());
311 aclCellToOutputWeightsInfo = BuildArmComputeTensorInfo(paramsInfo.GetCellToOutputWeights());
312
Teresa Charlinbe727be2020-09-25 15:08:21 +0100313 // Set peephole params info
Ryan OShea2323af42020-05-13 16:36:19 +0100314 aclParamsInfo.set_peephole_params(&aclCellToForgetWeightsInfo,
315 &aclCellToOutputWeightsInfo);
316 }
317
318 if (descriptor.m_ProjectionEnabled)
319 {
320 aclProjectionWeightsInfo = BuildArmComputeTensorInfo(paramsInfo.GetProjectionWeights());
321
322 if (paramsInfo.m_ProjectionBias != nullptr)
323 {
324 aclProjectionBiasInfo = BuildArmComputeTensorInfo(paramsInfo.GetProjectionBias());
325 }
326
Teresa Charlinbe727be2020-09-25 15:08:21 +0100327 // Set projection params info
Ryan OShea2323af42020-05-13 16:36:19 +0100328 aclParamsInfo.set_projection_params(
329 &aclProjectionWeightsInfo,
330 paramsInfo.m_ProjectionBias != nullptr ? &aclProjectionBiasInfo : nullptr);
331 }
332
333 if (descriptor.m_LayerNormEnabled)
334 {
335 if (!descriptor.m_CifgEnabled)
336 {
337 aclInputLayerNormWeightsInfo = BuildArmComputeTensorInfo(paramsInfo.GetInputLayerNormWeights());
338 }
339
340 aclForgetLayerNormWeightsInfo = BuildArmComputeTensorInfo(paramsInfo.GetForgetLayerNormWeights());
341 aclCellLayerNormWeightsInfo = BuildArmComputeTensorInfo(paramsInfo.GetCellLayerNormWeights());
342 aclOutputLayerNormWeightsInfo = BuildArmComputeTensorInfo(paramsInfo.GetOutputLayerNormWeights());
343
Teresa Charlinbe727be2020-09-25 15:08:21 +0100344 // Set layer norm params info
Ryan OShea2323af42020-05-13 16:36:19 +0100345 aclParamsInfo.set_layer_normalization_params(
346 paramsInfo.m_InputLayerNormWeights != nullptr ? &aclInputLayerNormWeightsInfo : nullptr,
347 &aclForgetLayerNormWeightsInfo,
348 &aclCellLayerNormWeightsInfo,
349 &aclOutputLayerNormWeightsInfo);
350 }
351
352 if (!descriptor.m_CifgEnabled)
353 {
354 aclInputToInputWeightsInfo = BuildArmComputeTensorInfo(paramsInfo.GetInputToInputWeights());
355 aclRecurrentToInputWeightsInfo = BuildArmComputeTensorInfo(paramsInfo.GetRecurrentToInputWeights());
356 aclInputGateBiasInfo = BuildArmComputeTensorInfo(paramsInfo.GetInputGateBias());
357
Teresa Charlinbe727be2020-09-25 15:08:21 +0100358 // Set CIFG params info
Ryan OShea2323af42020-05-13 16:36:19 +0100359 aclParamsInfo.set_cifg_params(
360 &aclInputToInputWeightsInfo,
361 &aclRecurrentToInputWeightsInfo,
Teresa Charlinbe727be2020-09-25 15:08:21 +0100362 paramsInfo.m_CellToInputWeights != nullptr ? &aclCellToInputWeightsInfo : nullptr,
Ryan OShea2323af42020-05-13 16:36:19 +0100363 &aclInputGateBiasInfo);
364 }
365
Teresa Charlinbe727be2020-09-25 15:08:21 +0100366 // Set scalar descriptor params
Ryan OShea2323af42020-05-13 16:36:19 +0100367 aclParamsInfo.set_cell_clip_params(descriptor.m_CellClip);
368 aclParamsInfo.set_projection_clip_params(descriptor.m_ProjectionClip);
369 aclParamsInfo.set_hidden_state_params(descriptor.m_HiddenStateZeroPoint, descriptor.m_HiddenStateScale);
370 aclParamsInfo.set_matmul_scale_params(descriptor.m_InputIntermediateScale,
371 descriptor.m_ForgetIntermediateScale,
372 descriptor.m_CellIntermediateScale,
373 descriptor.m_OutputIntermediateScale);
374
Teresa Charlinbe727be2020-09-25 15:08:21 +0100375 // QLSTM CL validate
Ryan OShea2323af42020-05-13 16:36:19 +0100376 return arm_compute::CLQLSTMLayer::validate(&aclInputInfo,
377 &aclInputToForgetWeightsInfo,
378 &aclInputToCellWeightsInfo,
379 &aclInputToOutputWeightsInfo,
380 &aclRecurrentToForgetWeightsInfo,
381 &aclRecurrentToCellWeightsInfo,
382 &aclRecurrentToOutputWeightsInfo,
383 &aclForgetGateBiasInfo,
384 &aclCellBiasInfo,
385 &aclOutputGateBiasInfo,
386 &aclCellStateInInfo,
387 &aclOutputStateInInfo,
388 &aclCellStateOutInfo,
389 &aclOutputStateOutInfo,
390 &aclOutputInfo,
391 aclParamsInfo);
392}
393
394void ClQLstmWorkload::FreeUnusedTensors()
395{
396 FreeTensorIfUnused(m_InputToInputWeightsTensor);
397 FreeTensorIfUnused(m_InputToForgetWeightsTensor);
398 FreeTensorIfUnused(m_InputToCellWeightsTensor);
399 FreeTensorIfUnused(m_InputToOutputWeightsTensor);
400
401 FreeTensorIfUnused(m_RecurrentToInputWeightsTensor);
402 FreeTensorIfUnused(m_RecurrentToForgetWeightsTensor);
403 FreeTensorIfUnused(m_RecurrentToCellWeightsTensor);
404 FreeTensorIfUnused(m_RecurrentToOutputWeightsTensor);
405
406 FreeTensorIfUnused(m_CellToInputWeightsTensor);
407 FreeTensorIfUnused(m_CellToForgetWeightsTensor);
408 FreeTensorIfUnused(m_CellToOutputWeightsTensor);
409
410 FreeTensorIfUnused(m_InputGateBiasTensor);
411 FreeTensorIfUnused(m_ForgetGateBiasTensor);
412 FreeTensorIfUnused(m_CellBiasTensor);
413 FreeTensorIfUnused(m_OutputGateBiasTensor);
414
415 FreeTensorIfUnused(m_ProjectionWeightsTensor);
416 FreeTensorIfUnused(m_ProjectionBiasTensor);
417
418 FreeTensorIfUnused(m_InputLayerNormWeightsTensor);
419 FreeTensorIfUnused(m_ForgetLayerNormWeightsTensor);
420 FreeTensorIfUnused(m_CellLayerNormWeightsTensor);
421 FreeTensorIfUnused(m_OutputLayerNormWeightsTensor);
422}
423
424} //namespace armnn