diff options
author | Pablo Marquez Tello <pablo.tello@arm.com> | 2022-04-20 18:19:19 +0100 |
---|---|---|
committer | Pablo Marquez Tello <pablo.tello@arm.com> | 2022-04-21 15:46:57 +0000 |
commit | 1bae0f9c66c5026bbbe7bd6984bc0e6d6de7631d (patch) | |
tree | c340f5d489740bf89e50491f6247e5c5931d755d | |
parent | 01a8adebad130517678c2f5e6b97041a6e026048 (diff) | |
download | ComputeLibrary-1bae0f9c66c5026bbbe7bd6984bc0e6d6de7631d.tar.gz |
NEQLSTM: perform type conversion in prepare method.
* When input_to_forget_weights is QASYMM8_SIGNED, the conversion
to QSYMM8 is done in the prepare method
* Partially resolves MLCE-604
Change-Id: Iddadbc50d77381542451ac4e46de49b2706bc88c
Signed-off-by: Pablo Marquez Tello <pablo.tello@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/7441
Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
-rw-r--r-- | src/runtime/NEON/functions/NEQLSTMLayer.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/runtime/NEON/functions/NEQLSTMLayer.cpp b/src/runtime/NEON/functions/NEQLSTMLayer.cpp index c6e6a71cb7..15569b4ead 100644 --- a/src/runtime/NEON/functions/NEQLSTMLayer.cpp +++ b/src/runtime/NEON/functions/NEQLSTMLayer.cpp @@ -252,8 +252,6 @@ void NEQLSTMLayer::configure(const ITensor *input, _dequantize_input_to_forget_weights.configure(input_to_forget_weights, &_input_to_forget_weights_f32); _quantize_input_to_forget_weights.configure(&_input_to_forget_weights_f32, &_input_to_forget_weights_symm8); - _input_to_forget_weights_f32.allocator()->allocate(); - _input_to_forget_weights_symm8.allocator()->allocate(); ARM_COMPUTE_ERROR_THROW_ON(NEQLSTMLayer::validate(input->info(), _input_to_forget_weights_symm8.info(), input_to_cell_weights->info(), input_to_output_weights->info(), recurrent_to_forget_weights->info(), recurrent_to_cell_weights->info(), recurrent_to_output_weights->info(), @@ -1055,12 +1053,6 @@ void NEQLSTMLayer::run() // Acquire all the temporaries MemoryGroupResourceScope scope_mg(_memory_group); - if(_convert_input_to_forget_weights_to_qsymm8) - { - _dequantize_input_to_forget_weights.run(); - _quantize_input_to_forget_weights.run(); - } - // Forget gate. _mm_input_to_forget.run(); _input_to_forget_outstage.run(); @@ -1200,6 +1192,14 @@ void NEQLSTMLayer::prepare() { if(!_is_prepared) { + if(_convert_input_to_forget_weights_to_qsymm8) + { + _input_to_forget_weights_f32.allocator()->allocate(); + _input_to_forget_weights_symm8.allocator()->allocate(); + _dequantize_input_to_forget_weights.run(); + _quantize_input_to_forget_weights.run(); + } + // Pre-transpose weights to be used in GEMM. _input_to_forget_weights_transposed.allocator()->allocate(); _input_to_cell_weights_transposed.allocator()->allocate(); |