Skip to content

Commit 786e93a

Browse files
committed
test: Adjust the tolerance of fp16 depthwise convolution tests for cpu
Depthwise convolution tests for 5x5 filters were failing from time to time with small differences. The relative tolerance was %2, but running this test 10M times revealed the errors can be larger depending on how much the numbers are close to zero. Therefore, we added an absolute tolerance for the results that's been tested 10M times. Resolves: COMPMID-8379 Change-Id: Iaa997b0208332bb39e3d30ad7991fc4627f9015a Signed-off-by: Gunes Bayir <gunes.bayir@arm.com>
1 parent 0825d60 commit 786e93a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/validation/NEON/DepthwiseConvolutionLayer.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ constexpr AbsoluteTolerance<int8_t> tolerance_qasymm8_signed(
6161
#ifdef ARM_COMPUTE_ENABLE_FP16
6262
RelativeTolerance<half_float::half> tolerance_f16(half_float::half(
6363
0.02)); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F16 */
64-
constexpr float tolerance_num = 0.05f; /**< Tolerance number */
65-
#endif // ARM_COMPUTE_ENABLE_FP16
64+
constexpr float abs_tolerance_f16 = 0.015f;
65+
constexpr float tolerance_num = 0.05f; /**< Tolerance number */
66+
#endif // ARM_COMPUTE_ENABLE_FP16
6667

6768
const auto depth_multipliers = make("DepthMultiplier", {1, 2, 8});
6869
const auto large_depth_multipliers = make("DepthMultiplier", {5, 32});
@@ -792,7 +793,7 @@ FIXTURE_DATA_TEST_CASE_NEW(RunSmallW5x5,
792793
{
793794
if (CPUInfo::get().has_fp16())
794795
{
795-
validate(Accessor(_target), _reference, tolerance_f16);
796+
validate(Accessor(_target), _reference, tolerance_f16, 0.0, abs_tolerance_f16);
796797
}
797798
else
798799
{

0 commit comments

Comments
 (0)