ARM-software / armnn

Arm NN ML Software. The code here is a read-only mirror of https://review.mlplatform.org/admin/repos/ml/armnn
https://developer.arm.com/products/processors/machine-learning/arm-nn
MIT License
1.15k stars 307 forks source link

Inconsistent Interpretation of Tensor Dimensions in QuantizedLstmLayer and Its NEON Backend #601

Closed preusser closed 2 years ago

preusser commented 2 years ago

The armnn::QuantizedLstmLayer expects the batch dimension to come first asking for inputs of BATCH_SIZE x INPUT_SIZE and BATCH_SIZE x HIDDEN_SIZE as well as corresponding outputs: https://github.com/ARM-software/armnn/blob/branches/armnn_21_11/src/armnn/layers/QuantizedLstmLayer.cpp#L81

The corresponding accelerated implementation by the Arm ComputeLibrary NEON backend expects the opposite order: https://github.com/ARM-software/ComputeLibrary/blob/master/src/runtime/NEON/functions/NELSTMLayerQuantized.cpp#L259

It is currently impossible to pass the shape validations in both Arm NN and the ComputeLibrary unless proper cubes are used as tensors.

preusser commented 2 years ago

I can no longer reproduce the issue. An appropriate transpose appears to be added in the translation process. Sorry for the disturbance.