IVGCVSW-4148 Report quant multiplier > 1 as unsupported for ACL
authorJames Conroy <james.conroy@arm.com>
Tue, 19 Nov 2019 15:28:58 +0000 (15:28 +0000)
committerJames Conroy <james.conroy@arm.com>
Thu, 21 Nov 2019 16:40:56 +0000 (16:40 +0000)
* This is a temporary measure that needs to be
  removed when quantization multiplier > 1.0f
  support has been added for NEON and CL.
* Layers affected: convolution, depthwise convolution,
  dilated depthwise convolution and transpose
  convolution.

Signed-off-by: James Conroy <james.conroy@arm.com>
Change-Id: Ief1aec2ff0eedf8250f6a8675288e1c343dcfce4

src/backends/cl/ClLayerSupport.cpp
src/backends/neon/NeonLayerSupport.cpp

index 612af6b..7a1c573 100644 (file)
@@ -328,6 +328,12 @@ bool ClLayerSupport::IsConvolution2dSupported(const TensorInfo& input,
         return false;
     }
 
+    // Multiplier > 1.0f currently not supported in ACL
+    if ((input.GetQuantizationScale() * weights.GetQuantizationScale()) / output.GetQuantizationScale() > 1.0f)
+    {
+        return false;
+    }
+
     FORWARD_WORKLOAD_VALIDATE_FUNC(ClConvolution2dWorkloadValidate,
                                    reasonIfUnsupported,
                                    input,
@@ -371,6 +377,12 @@ bool ClLayerSupport::IsDepthwiseConvolutionSupported(const TensorInfo& input,
         return false;
     }
 
+    // Multiplier > 1.0f currently not supported in ACL
+    if ((input.GetQuantizationScale() * weights.GetQuantizationScale()) / output.GetQuantizationScale() > 1.0f)
+    {
+        return false;
+    }
+
     FORWARD_WORKLOAD_VALIDATE_FUNC(ClDepthwiseConvolutionWorkloadValidate,
                                    reasonIfUnsupported,
                                    input,
@@ -387,6 +399,12 @@ bool ClLayerSupport::IsDilatedDepthwiseConvolutionSupported(const TensorInfo& in
                                                             const Optional<TensorInfo>& biases,
                                                             Optional<std::string&> reasonIfUnsupported) const
 {
+    // Multiplier > 1.0f currently not supported in ACL
+    if ((input.GetQuantizationScale() * weights.GetQuantizationScale()) / output.GetQuantizationScale() > 1.0f)
+    {
+        return false;
+    }
+
     FORWARD_WORKLOAD_VALIDATE_FUNC(ClDepthwiseConvolutionWorkloadValidate,
                                    reasonIfUnsupported,
                                    input,
@@ -792,6 +810,12 @@ bool ClLayerSupport::IsTransposeConvolution2dSupported(const TensorInfo& input,
                                                        const Optional<TensorInfo>& biases,
                                                        Optional<std::string&> reasonIfUnsupported) const
 {
+    // Multiplier > 1.0f currently not supported in ACL
+    if ((input.GetQuantizationScale() * weights.GetQuantizationScale()) / output.GetQuantizationScale() > 1.0f)
+    {
+        return false;
+    }
+
     FORWARD_WORKLOAD_VALIDATE_FUNC(ClTransposeConvolution2dWorkloadValidate,
                                    reasonIfUnsupported,
                                    input,
index 5410ef4..ed0f41a 100644 (file)
@@ -279,6 +279,12 @@ bool NeonLayerSupport::IsConvolution2dSupported(const TensorInfo& input,
         return false;
     }
 
+    // Multiplier > 1.0f currently not supported in ACL
+    if ((input.GetQuantizationScale() * weights.GetQuantizationScale()) / output.GetQuantizationScale() > 1.0f)
+    {
+        return false;
+    }
+
     FORWARD_WORKLOAD_VALIDATE_FUNC(NeonConvolution2dWorkloadValidate,
                                    reasonIfUnsupported,
                                    input,
@@ -312,6 +318,12 @@ bool NeonLayerSupport::IsDepthwiseConvolutionSupported(const TensorInfo& input,
         return false;
     }
 
+    // Multiplier > 1.0f currently not supported in ACL
+    if ((input.GetQuantizationScale() * weights.GetQuantizationScale()) / output.GetQuantizationScale() > 1.0f)
+    {
+        return false;
+    }
+
     FORWARD_WORKLOAD_VALIDATE_FUNC(NeonDepthwiseConvolutionWorkloadValidate,
                                    reasonIfUnsupported,
                                    input,
@@ -338,6 +350,12 @@ bool NeonLayerSupport::IsDilatedDepthwiseConvolutionSupported(const TensorInfo&
                                                               const Optional<TensorInfo>& biases,
                                                               Optional<std::string&> reasonIfUnsupported) const
 {
+    // Multiplier > 1.0f currently not supported in ACL
+    if ((input.GetQuantizationScale() * weights.GetQuantizationScale()) / output.GetQuantizationScale() > 1.0f)
+    {
+        return false;
+    }
+
     FORWARD_WORKLOAD_VALIDATE_FUNC(NeonDepthwiseConvolutionWorkloadValidate,
                                    reasonIfUnsupported,
                                    input,
@@ -738,6 +756,12 @@ bool NeonLayerSupport::IsTransposeConvolution2dSupported(const TensorInfo& input
                                                          const Optional<TensorInfo>& biases,
                                                          Optional<std::string&> reasonIfUnsupported) const
 {
+    // Multiplier > 1.0f currently not supported in ACL
+    if ((input.GetQuantizationScale() * weights.GetQuantizationScale()) / output.GetQuantizationScale() > 1.0f)
+    {
+        return false;
+    }
+
     FORWARD_WORKLOAD_VALIDATE_FUNC(NeonTransposeConvolution2dWorkloadValidate,
                                    reasonIfUnsupported,
                                    input,