From 3351f2a454a11e15934fa8bfac635785783cf8e1 Mon Sep 17 00:00:00 2001 From: Sang-Hoon Park Date: Thu, 16 Jul 2020 14:26:16 +0100 Subject: COMPMID-3575: Mixed preicision in NEInstanceNormalizationLayerKernel In order to fix the issue caused by the limited precision of FP16. mixed precision (float accumulator) is introduced to NEInstanceNormalizationLayerKernel. Since the reference kernel is doing the mixed precision, currently mixed preicision computation is default when it is called from NEInstanceNormalizationLayer. - Make NEInstanceNormalizationLayerKernel use kernel descriptor to enable mixed precision computation - NEInstanceNormalizationLayer is modified to use the descriptor Change-Id: I7766622d715df054e303f9b441380b15b51f02b2 Signed-off-by: Sang-Hoon Park Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3589 Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio Reviewed-by: Georgios Pinitas Comments-Addressed: Arm Jenkins --- tests/validation/NEON/InstanceNormalizationLayer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tests/validation/NEON/InstanceNormalizationLayer.cpp') diff --git a/tests/validation/NEON/InstanceNormalizationLayer.cpp b/tests/validation/NEON/InstanceNormalizationLayer.cpp index 9d13a2b784..1073a7f6f7 100644 --- a/tests/validation/NEON/InstanceNormalizationLayer.cpp +++ b/tests/validation/NEON/InstanceNormalizationLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Arm Limited. + * Copyright (c) 2019-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -45,7 +45,11 @@ namespace /** Tolerance for float operations */ AbsoluteTolerance tolerance_f32(0.0015f); #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC -AbsoluteTolerance tolerance_f16(0.5f); +// This precision is chosen based on the precision float16_t can provide +// for the decimal numbers between 16 and 32 and decided based on multiple +// times of execution of tests. Although, with randomly generated numbers +// there is no gaurantee that this tolerance will be always large enough. +AbsoluteTolerance tolerance_f16(static_cast(0.015625f)); #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC } // namespace -- cgit v1.2.1