From 2aa7fd011a4baff52dceb00a71b3674f819df8fc Mon Sep 17 00:00:00 2001 From: Sang-Hoon Park Date: Wed, 18 Sep 2019 13:39:00 +0100 Subject: COMPMID-2601 [CL] add mixed precision support to PoolingLayer * PoolingLayerInfo is updated with a new flag. * CL Kernel is updated to use FP32 accumulation. * CL pooling layer testscases are added for mixed precision. * Reference pooling layer is updated to use FP32 accumulation. Change-Id: I4ab2167cc7f86c86293cf50a0ca5119c04dc9c7e Signed-off-by: Sang-Hoon Park Reviewed-on: https://review.mlplatform.org/c/1973 Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: VidhyaSudhan Loganathan --- tests/validation/CL/PoolingLayer.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'tests/validation/CL') diff --git a/tests/validation/CL/PoolingLayer.cpp b/tests/validation/CL/PoolingLayer.cpp index 7d79f3f86c..ff7c24f024 100644 --- a/tests/validation/CL/PoolingLayer.cpp +++ b/tests/validation/CL/PoolingLayer.cpp @@ -76,6 +76,8 @@ constexpr AbsoluteTolerance tolerance_f16(0.01f); /**< Tolerance value constexpr AbsoluteTolerance tolerance_qasymm8(1); /**< Tolerance value for comparing reference's output against implementation's output for 8-bit asymmetric type */ const auto pool_data_layout_dataset = framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }); +const auto pool_fp_mixed_precision_dataset = framework::dataset::make("FpMixedPrecision", { true, false }); + } // namespace TEST_SUITE(CL) @@ -125,6 +127,9 @@ using CLPoolingLayerFixture = PoolingLayerValidationFixture using CLSpecialPoolingLayerFixture = SpecialPoolingLayerValidationFixture; +template +using CLMixedPrecesionPoolingLayerFixture = PoolingLayerValidationMixedPrecisionFixture; + TEST_SUITE(Float) TEST_SUITE(FP32) FIXTURE_DATA_TEST_CASE(RunSpecial, CLSpecialPoolingLayerFixture, framework::DatasetMode::ALL, datasets::PoolingLayerDatasetSpecial() * framework::dataset::make("DataType", DataType::F32)) @@ -151,16 +156,18 @@ FIXTURE_DATA_TEST_CASE(RunLarge, CLPoolingLayerFixture, framework::Datase TEST_SUITE_END() // FP32 TEST_SUITE(FP16) -FIXTURE_DATA_TEST_CASE(RunSmall, CLPoolingLayerFixture, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::SmallShapes(), combine(PoolingLayerDatasetFPSmall, - framework::dataset::make("DataType", DataType::F16))), - pool_data_layout_dataset)) +FIXTURE_DATA_TEST_CASE(RunSmall, CLMixedPrecesionPoolingLayerFixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::SmallShapes(), combine(PoolingLayerDatasetFPSmall, + framework::dataset::make("DataType", DataType::F16))), + pool_data_layout_dataset), + pool_fp_mixed_precision_dataset)) { // Validate output validate(CLAccessor(_target), _reference, tolerance_f16); } -FIXTURE_DATA_TEST_CASE(RunLarge, CLPoolingLayerFixture, framework::DatasetMode::NIGHTLY, combine(combine(datasets::LargeShapes(), combine(PoolingLayerDatasetFP, - framework::dataset::make("DataType", DataType::F16))), - pool_data_layout_dataset)) +FIXTURE_DATA_TEST_CASE(RunLarge, CLMixedPrecesionPoolingLayerFixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeShapes(), combine(PoolingLayerDatasetFP, + framework::dataset::make("DataType", DataType::F16))), + pool_data_layout_dataset), + pool_fp_mixed_precision_dataset)) { // Validate output validate(CLAccessor(_target), _reference, tolerance_f16); -- cgit v1.2.1