aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiorgio Arena <giorgio.arena@arm.com>2019-11-13 17:07:13 +0000
committerMichele Di Giorgio <michele.digiorgio@arm.com>2019-11-13 18:05:19 +0000
commit7a669a87ef04ecb4c9b51ea4a10d9a16aebf3227 (patch)
treea1f1cd35578386b141dff519ee85496819a64921
parent2dab2e936a41053cf260a235ac808577ae923f3e (diff)
downloadComputeLibrary-7a669a87ef04ecb4c9b51ea4a10d9a16aebf3227.tar.gz
COMPMID-2921 Performance regression on NEON Int8
Change-Id: I60ede3e8aeec678a9fb0d8d0f05a8048ab1ced7c Signed-off-by: Giorgio Arena <giorgio.arena@arm.com> Reviewed-on: https://review.mlplatform.org/c/2285 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
-rw-r--r--arm_compute/runtime/NEON/functions/NEGEMMConvolutionLayer.h3
-rw-r--r--src/runtime/NEON/functions/NEGEMMConvolutionLayer.cpp10
2 files changed, 7 insertions, 6 deletions
diff --git a/arm_compute/runtime/NEON/functions/NEGEMMConvolutionLayer.h b/arm_compute/runtime/NEON/functions/NEGEMMConvolutionLayer.h
index 2d4aaa495f..6452fc9249 100644
--- a/arm_compute/runtime/NEON/functions/NEGEMMConvolutionLayer.h
+++ b/arm_compute/runtime/NEON/functions/NEGEMMConvolutionLayer.h
@@ -231,13 +231,14 @@ private:
/** Static function to check if GEMM3D is supported in @ref NEGEMM or in @ref NEGEMMLowpMatrixMultiplyCore
*
* @param[in] input_info Input tensor info. Data types supported: QASYMM8/F16/F32.
+ * @param[in] weights_info Weights tensor info. Data types supported: QASYMM8/F16/F32.
* @param[in] act_info Activation layer information in case of a fused activation. Only RELU, BOUNDED_RELU and LU_BOUNDED_RELU supported.
* @param[in] gemm_3d_depth Depth of GEMM 3D
* @param[in] skip_im2col Flag which specifies if im2col has to be skipped. i.e. 1x1 convolution with NHWC data layout
*
* @return a status
*/
- static Status validate_gemm3d(const ITensorInfo *input_info, const ActivationLayerInfo &act_info, int gemm_3d_depth, bool skip_im2col);
+ static Status validate_gemm3d(const ITensorInfo *input_info, const ITensorInfo *weights_info, const ActivationLayerInfo &act_info, int gemm_3d_depth, bool skip_im2col);
private:
MemoryGroup _memory_group;
diff --git a/src/runtime/NEON/functions/NEGEMMConvolutionLayer.cpp b/src/runtime/NEON/functions/NEGEMMConvolutionLayer.cpp
index caff117e09..a730749b8b 100644
--- a/src/runtime/NEON/functions/NEGEMMConvolutionLayer.cpp
+++ b/src/runtime/NEON/functions/NEGEMMConvolutionLayer.cpp
@@ -218,7 +218,7 @@ Status NEGEMMConvolutionLayer::validate_mm(const ITensorInfo *input, const ITens
}
}
-Status NEGEMMConvolutionLayer::validate_gemm3d(const ITensorInfo *input_info, const ActivationLayerInfo &act_info, int gemm_3d_depth, bool skip_im2col)
+Status NEGEMMConvolutionLayer::validate_gemm3d(const ITensorInfo *input_info, const ITensorInfo *weights_info, const ActivationLayerInfo &act_info, int gemm_3d_depth, bool skip_im2col)
{
const DataType data_type = input_info->data_type();
const unsigned int mult_y = skip_im2col ? 1U : gemm_3d_depth;
@@ -226,7 +226,7 @@ Status NEGEMMConvolutionLayer::validate_gemm3d(const ITensorInfo *input_info, co
// Set dummy tensor shapes for the validation
const TensorInfo dummy_input_info(TensorShape(4U, 4U * mult_y, 1U * mult_z), 1, data_type, input_info->quantization_info());
- const TensorInfo dummy_weights_info(TensorShape(4U, 4U), 1, data_type);
+ const TensorInfo dummy_weights_info(TensorShape(4U, 4U), 1, data_type, weights_info->quantization_info());
const TensorInfo dummy_output_info(TensorShape(4U, 4U, gemm_3d_depth), 1, data_type, input_info->quantization_info());
return validate_mm(&dummy_input_info, &dummy_weights_info, nullptr, &dummy_output_info, act_info, gemm_3d_depth, skip_im2col);
@@ -278,7 +278,7 @@ void NEGEMMConvolutionLayer::configure(const ITensor *input, const ITensor *weig
// Check if GEMM3D is supported
if(data_layout == DataLayout::NHWC)
{
- _skip_col2im = bool(validate_gemm3d(input->info(), act_info, conv_h, true));
+ _skip_col2im = bool(validate_gemm3d(input->info(), weights->info(), act_info, conv_h, true));
// If not supported, we need to perform im2col and col2im (or reshape layer)
if(!_skip_col2im)
{
@@ -429,7 +429,7 @@ Status NEGEMMConvolutionLayer::validate(const ITensorInfo *input, const ITensorI
bool skip_col2im = false;
if(data_layout == DataLayout::NHWC)
{
- skip_col2im = bool(validate_gemm3d(input, act_info, conv_h, true));
+ skip_col2im = bool(validate_gemm3d(input, weights, act_info, conv_h, true));
// If not supported, we need to perform im2col and col2im (or reshape layer)
if(!skip_col2im)
{
@@ -440,7 +440,7 @@ Status NEGEMMConvolutionLayer::validate(const ITensorInfo *input, const ITensorI
if(skip_col2im)
{
// If not supported, we need to perform im2col and col2im (or reshape layer)
- if(!bool(validate_gemm3d(input, act_info, conv_h, skip_im2col)))
+ if(!bool(validate_gemm3d(input, weights, act_info, conv_h, skip_im2col)))
{
skip_im2col = false;
skip_col2im = false;