aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGiorgio Arena <giorgio.arena@arm.com>2021-05-12 12:28:58 +0100
committerGeorgios Pinitas <georgios.pinitas@arm.com>2021-05-17 09:02:15 +0000
commited4b8a07e67c7802207c8954a88ad7a91aec79e0 (patch)
tree771cb0867fa675cf02286006f7fafa2f66a814e2 /tests
parent186fe683da63dea2dac06e46a412e354d33cd9c2 (diff)
downloadComputeLibrary-ed4b8a07e67c7802207c8954a88ad7a91aec79e0.tar.gz
Fix MeanStdDevNormalizationLayer reference outputting nan for FP16
- Bring the epsilon up to 1e-3 for FP16 (both backends) since it was causing the reference's variance being negative and its square root being NaN - Bring the epsilon up to 1e-7 for FP16 NEON test for the same problem on the NEON kernel - Adjust the CL kernel's vec_size when input tensor's width < 16 and use macros agnostic of vector size for sum reduction - Add previously mismatching tensor shapes Resolve COMPMID-4354 Change-Id: I823c871aacb72326f90c86b24cb16c3e2d4bd15e Signed-off-by: Giorgio Arena <giorgio.arena@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5630 Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/datasets/ShapeDatasets.h6
-rw-r--r--tests/validation/CL/MeanStdDevNormalizationLayer.cpp4
-rw-r--r--tests/validation/NEON/MeanStdDevNormalizationLayer.cpp4
3 files changed, 7 insertions, 7 deletions
diff --git a/tests/datasets/ShapeDatasets.h b/tests/datasets/ShapeDatasets.h
index c2b4cd7da4..37c5f1626d 100644
--- a/tests/datasets/ShapeDatasets.h
+++ b/tests/datasets/ShapeDatasets.h
@@ -88,9 +88,9 @@ public:
Small2DShapes()
: ShapeDataset("Shape",
{
- TensorShape{ 7U, 7U },
- TensorShape{ 27U, 13U },
- TensorShape{ 128U, 64U }
+ TensorShape{ 1U, 7U },
+ TensorShape{ 5U, 13U },
+ TensorShape{ 32U, 64U }
})
{
}
diff --git a/tests/validation/CL/MeanStdDevNormalizationLayer.cpp b/tests/validation/CL/MeanStdDevNormalizationLayer.cpp
index e77a21ed7f..cdeb622130 100644
--- a/tests/validation/CL/MeanStdDevNormalizationLayer.cpp
+++ b/tests/validation/CL/MeanStdDevNormalizationLayer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019-2020 Arm Limited.
+ * Copyright (c) 2019-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -78,7 +78,7 @@ TEST_SUITE(FP16)
FIXTURE_DATA_TEST_CASE(RunSmall, CLMeanStdDevNormalizationLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(),
framework::dataset::make("DataType", DataType::F16)),
framework::dataset::make("InPlace", { false, true })),
- framework::dataset::make("Epsilon", { 1e-8 })))
+ framework::dataset::make("Epsilon", { 1e-3 })))
{
// Validate output
validate(CLAccessor(_target), _reference, tolerance_f16);
diff --git a/tests/validation/NEON/MeanStdDevNormalizationLayer.cpp b/tests/validation/NEON/MeanStdDevNormalizationLayer.cpp
index 20e3bd5325..90d3d05a0d 100644
--- a/tests/validation/NEON/MeanStdDevNormalizationLayer.cpp
+++ b/tests/validation/NEON/MeanStdDevNormalizationLayer.cpp
@@ -81,7 +81,7 @@ TEST_SUITE(FP16)
FIXTURE_DATA_TEST_CASE(RunSmall, NEMeanStdDevNormalizationLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(),
framework::dataset::make("DataType", DataType::F16)),
framework::dataset::make("InPlace", { false, true })),
- framework::dataset::make("Epsilon", { 1e-8 })))
+ framework::dataset::make("Epsilon", { 1e-3 })))
{
// Validate output
validate(Accessor(_target), _reference, tolerance_f16);
@@ -101,7 +101,7 @@ TEST_SUITE(FP32)
FIXTURE_DATA_TEST_CASE(RunSmall, NEMeanStdDevNormalizationLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(),
framework::dataset::make("DataType", DataType::F32)),
framework::dataset::make("InPlace", { false, true })),
- framework::dataset::make("Epsilon", { 1e-8 })))
+ framework::dataset::make("Epsilon", { 1e-7 })))
{
// Validate output
validate(Accessor(_target), _reference, tolerance_f32);