IVGCVSW-4158 FP16 Mobilenet V1 and V2 30% regression on ArmNN on Mate20
authorSadik Armagan <sadik.armagan@arm.com>
Fri, 22 Nov 2019 12:52:28 +0000 (12:52 +0000)
committerKevin May <kevin.may@arm.com>
Sat, 23 Nov 2019 14:37:32 +0000 (14:37 +0000)
* Enable FP16 mixed precision for Android Q

Signed-off-by: Sadik Armagan <sadik.armagan@arm.com>
Change-Id: I5ddb94b13385e1fec39e4407dffc8e4bc6b8d64a

Android.mk
src/backends/cl/workloads/ClPooling2dWorkload.cpp

index f8dcb60..d755d20 100644 (file)
@@ -235,6 +235,7 @@ endif # ARMNN_REF_ENABLED == 1
 
 ifeq ($(Q_OR_LATER),1)
 LOCAL_CFLAGS += \
+        -DARMNN_MIXED_PRECISION_FP16_POOLING \
         -DBOOST_NO_AUTO_PTR
 endif # PLATFORM_VERSION == Q or later
 
index bf89997..8400977 100644 (file)
@@ -44,14 +44,13 @@ ClPooling2dWorkload::ClPooling2dWorkload(
     // enable fp_mixed_precision for the the FP16 cases that
     // accumulation reaches a limit beyond which there is no more increment of the value
     bool fpMixedPrecision = false;
+#ifdef ARMNN_MIXED_PRECISION_FP16_POOLING
     if (input.info()->data_type() == arm_compute::DataType::F16
-        && m_Data.m_Parameters.m_PoolType == PoolingAlgorithm::Average
-        && m_Data.m_Parameters.m_PoolWidth >= 100
-        && input.info()->dimension(3) >= 5
-        && input.info()->dimension(2) * input.info()->dimension(1) >= 3000)
+        && m_Data.m_Parameters.m_PoolType == PoolingAlgorithm::Average)
     {
         fpMixedPrecision = true;
     }
+#endif
 
     arm_compute::PoolingLayerInfo layerInfo = BuildArmComputePoolingLayerInfo(m_Data.m_Parameters, fpMixedPrecision);