From 54eafd86fdeb19f2117271805a01da4395f9ef16 Mon Sep 17 00:00:00 2001 From: SiCong Li Date: Thu, 26 Jan 2023 17:36:08 +0000 Subject: Sync tolerance number of dynamic fusion direct conv2d with the current library Add descriptions and pointers in the tests to document the differences in test coverage between dynamic fusion and the current library, and most importantly, why the differences. This will come in handy when we want to quickly check if all old tests have been migrated so that we can safely deprecate / remove them. Resolves COMPMID-5840 Signed-off-by: SiCong Li Change-Id: Ie6227098979e51d7921810288f594beac19bce6f Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9043 Comments-Addressed: Arm Jenkins Reviewed-by: Viet-Hoa Do Tested-by: Arm Jenkins Benchmark: Arm Jenkins --- tests/validation/CL/ConvolutionLayer.cpp | 5 ++++- tests/validation/CL/DirectConvolutionLayer.cpp | 3 +++ .../dynamic_fusion/gpu/cl/DirectConv2d.cpp | 25 +++++++++++++++++++++- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/tests/validation/CL/ConvolutionLayer.cpp b/tests/validation/CL/ConvolutionLayer.cpp index 10b67075e2..bced540d2a 100644 --- a/tests/validation/CL/ConvolutionLayer.cpp +++ b/tests/validation/CL/ConvolutionLayer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2021 Arm Limited. + * Copyright (c) 2017-2021, 2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -39,6 +39,9 @@ #include "tests/validation/Validation.h" #include "tests/validation/fixtures/ConvolutionLayerFixture.h" +/** Synced with tests/validation/dynamic_fusion/gpu/cl/DirectConv2d.cpp + * Please check there for any differences in the coverage + */ namespace arm_compute { namespace test diff --git a/tests/validation/CL/DirectConvolutionLayer.cpp b/tests/validation/CL/DirectConvolutionLayer.cpp index 512c2cab97..342a093ca3 100644 --- a/tests/validation/CL/DirectConvolutionLayer.cpp +++ b/tests/validation/CL/DirectConvolutionLayer.cpp @@ -35,6 +35,9 @@ #include "tests/validation/Validation.h" #include "tests/validation/fixtures/DirectConvolutionLayerFixture.h" +/** Synced with tests/validation/dynamic_fusion/gpu/cl/DirectConv2d.cpp + * Please check there for any differences in the coverage + */ namespace arm_compute { namespace test diff --git a/tests/validation/dynamic_fusion/gpu/cl/DirectConv2d.cpp b/tests/validation/dynamic_fusion/gpu/cl/DirectConv2d.cpp index 45a2270bb3..cccad182ca 100644 --- a/tests/validation/dynamic_fusion/gpu/cl/DirectConv2d.cpp +++ b/tests/validation/dynamic_fusion/gpu/cl/DirectConv2d.cpp @@ -41,14 +41,29 @@ namespace validation { namespace { +/** Tolerances from tests/validation/CL/DirectConvolutionLayer.cpp + */ RelativeTolerance tolerance_f32(0.05f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */ RelativeTolerance tolerance_f16(half_float::half(0.2)); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F16 */ constexpr float abs_tolerance_f32(0.0001f); /**< Absolute tolerance for FP32 tests*/ -constexpr float tolerance_num = 0.02f; /**< Tolerance number */ +constexpr float tolerance_num = 0.07f; /**< Tolerance number */ } // namespace TEST_SUITE(CL) TEST_SUITE(DYNAMIC_FUSION) +/** Synced with tests/validation/CL/ConvolutionLayer.cpp + * + * Difference | Why the difference + * f32 tolerance here is smaller | To use the same tolerance as that of DirectConv2d; lowering tolerance is safe + * No quantized tests | Not supported yet + * No grouped CNN tests | Not supported yet + * No mixed layout tests | Not needed; only NHWC is supported + * No activation/post op tests | Not needed in fusion + * No ValidateConvolutionMethod | Only a single method (direct conv2d) is supported + * No ReshapeWeights = true tests | Not applicable yet. This parameter only concerns gemm-based conv2d + * No RunSmallWithPadding tests | Padding is removed + * + */ TEST_SUITE(CONV2D) template @@ -76,6 +91,14 @@ FIXTURE_DATA_TEST_CASE(RunSmall, DynamicFusionGpuConv2dFixture, framework: TEST_SUITE_END() // FP16 // Tests for specific conv2d methods +/** Synced with tests/validation/CL/DirectConvolutionLayer.cpp + * + * Difference | Why the difference + * No quantized tests | Not supported yet + * No Invalid output size test | Not applicable. Output is removed from the interface + * No mixed layout/NCHW tests | Not needed; only NHWC is supported + * No activation tests | Not needed in fusion + */ TEST_SUITE(DIRECT_CONV2D) // *INDENT-OFF* -- cgit v1.2.1