Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 1 | /* |
Gunes Bayir | ec0113d | 2022-11-09 09:26:27 +0000 | [diff] [blame] | 2 | * Copyright (c) 2017-2022 Arm Limited. |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to |
| 8 | * deal in the Software without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in all |
| 14 | * copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | * SOFTWARE. |
| 23 | */ |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 24 | #include "arm_compute/core/Types.h" |
Michele Di Giorgio | ed5a492 | 2018-09-13 16:22:01 +0100 | [diff] [blame] | 25 | #include "arm_compute/core/utils/misc/ShapeCalculator.h" |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 26 | #include "arm_compute/runtime/CL/CLTensor.h" |
| 27 | #include "arm_compute/runtime/CL/CLTensorAllocator.h" |
| 28 | #include "arm_compute/runtime/CL/functions/CLDeconvolutionLayer.h" |
| 29 | #include "tests/CL/CLAccessor.h" |
| 30 | #include "tests/PaddingCalculator.h" |
| 31 | #include "tests/datasets/ShapeDatasets.h" |
| 32 | #include "tests/framework/Asserts.h" |
| 33 | #include "tests/framework/Macros.h" |
| 34 | #include "tests/framework/datasets/Datasets.h" |
| 35 | #include "tests/validation/Validation.h" |
| 36 | #include "tests/validation/fixtures/DeconvolutionLayerFixture.h" |
| 37 | |
| 38 | namespace arm_compute |
| 39 | { |
| 40 | namespace test |
| 41 | { |
| 42 | namespace validation |
| 43 | { |
| 44 | namespace |
| 45 | { |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 46 | constexpr AbsoluteTolerance<float> tolerance_fp32(0.001f); /**< Tolerance for floating point tests */ |
| 47 | RelativeTolerance<half_float::half> tolerance_f16(half_float::half(0.2)); /**< Tolerance value for comparing reference's for DataType::F16 */ |
Giuseppe Rossini | 0a958cb | 2020-01-16 16:38:56 +0000 | [diff] [blame] | 48 | constexpr AbsoluteTolerance<float> tolerance_qasymm8(1.0); /**< Tolerance value for comparing reference's output against implementation's output for quantized data types */ |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 49 | constexpr float tolerance_num = 0.07f; /**< Tolerance number */ |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 50 | |
Manuel Bottini | 6e10aa3 | 2020-04-30 13:28:23 +0100 | [diff] [blame] | 51 | const auto data9x9_small_asymm = framework::dataset::make("InputShape", TensorShape{ 10U, 10U, 1U, 1U }) *framework::dataset::make("StrideX", 2) *framework::dataset::make("StrideY", |
| 52 | 2) |
| 53 | *framework::dataset::make("PadLeft", 3) |
| 54 | *framework::dataset::make("PadRight", 4) *framework::dataset::make("PadTop", 3) *framework::dataset::make("PadBottom", 4) *framework::dataset::make("NumKernels", { 1 }); |
| 55 | |
| 56 | const auto data9x9_large_asymm = framework::dataset::make("InputShape", TensorShape{ 640U, 360U, 56U, 1U }) *framework::dataset::make("StrideX", 2) *framework::dataset::make("StrideY", |
| 57 | 2) |
| 58 | *framework::dataset::make("PadLeft", 3) |
| 59 | *framework::dataset::make("PadRight", 4) *framework::dataset::make("PadTop", 3) *framework::dataset::make("PadBottom", 4) *framework::dataset::make("NumKernels", { 1 }); |
| 60 | |
Michalis Spyrou | 5ce99a2 | 2019-01-25 14:17:49 +0000 | [diff] [blame] | 61 | const auto data4x4 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 4) * framework::dataset::make("StrideY", 1, 4) * framework::dataset::make("PadX", 0, 3) |
giuros01 | a69a88b | 2019-01-31 16:29:19 +0000 | [diff] [blame] | 62 | * framework::dataset::make("PadY", 0, 3) * framework::dataset::make("NumKernels", { 3 }); |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 63 | |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 64 | const auto data3x3 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 4) * framework::dataset::make("StrideY", 1, 4) * framework::dataset::make("PadX", 0, 2) |
giuros01 | a69a88b | 2019-01-31 16:29:19 +0000 | [diff] [blame] | 65 | * framework::dataset::make("PadY", 0, 2) * framework::dataset::make("NumKernels", { 3 }); |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 66 | |
Matthew Jackson | b9070a4 | 2019-08-22 16:13:27 +0100 | [diff] [blame] | 67 | const auto data3x3_asymm = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 2) * framework::dataset::make("StrideY", 1, 2) * framework::dataset::make("PadLeft", 0, 1) |
| 68 | * framework::dataset::make("PadRight", 0, 1) * framework::dataset::make("PadTop", 0, 1) * framework::dataset::make("PadBottom", 0, 1) * framework::dataset::make("NumKernels", { 3 }); |
| 69 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 70 | const auto data3x3_precommit = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 2) * framework::dataset::make("StrideY", 1, 2) * framework::dataset::make("PadX", 0, 2) |
giuros01 | a69a88b | 2019-01-31 16:29:19 +0000 | [diff] [blame] | 71 | * framework::dataset::make("PadY", 0, 2) * framework::dataset::make("NumKernels", { 3 }); |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 72 | |
Gunes Bayir | ec0113d | 2022-11-09 09:26:27 +0000 | [diff] [blame] | 73 | const auto data3x3_precommit_large_channels = datasets::SmallDeconvolutionShapesWithLargerChannels() * framework::dataset::make("StrideX", 2) * framework::dataset::make("StrideY", |
Gunes Bayir | 5945070 | 2022-12-12 09:29:06 +0000 | [diff] [blame^] | 74 | 2) |
| 75 | * framework::dataset::make("PadX", 1) |
Gunes Bayir | ec0113d | 2022-11-09 09:26:27 +0000 | [diff] [blame] | 76 | * framework::dataset::make("PadY", 2) * framework::dataset::make("NumKernels", { 5 }); |
| 77 | |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 78 | const auto data2x2_precommit = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 2) * framework::dataset::make("StrideY", 2) * framework::dataset::make("PadX", 1) |
| 79 | * framework::dataset::make("PadY", 1) * framework::dataset::make("NumKernels", { 3 }); |
| 80 | |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 81 | const auto data1x1 = datasets::SmallDeconvolutionShapes() * framework::dataset::make("StrideX", 1, 4) * framework::dataset::make("StrideY", 1, 4) * framework::dataset::make("PadX", 0, 1) |
giuros01 | a69a88b | 2019-01-31 16:29:19 +0000 | [diff] [blame] | 82 | * framework::dataset::make("PadY", 0, 1) * framework::dataset::make("NumKernels", { 3 }); |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 83 | |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 84 | const auto data_layouts_dataset = framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }); |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 85 | |
| 86 | const auto add_bias_dataset = framework::dataset::make("AddBias", { true, false }); |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 87 | } // namespace |
| 88 | |
| 89 | TEST_SUITE(CL) |
| 90 | TEST_SUITE(DeconvolutionLayer) |
| 91 | |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 92 | // *INDENT-OFF* |
| 93 | // clang-format off |
Manuel Bottini | c1b76fa | 2019-06-17 12:04:40 +0100 | [diff] [blame] | 94 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip( |
Freddie Liardet | e92b045 | 2021-04-22 14:55:17 +0100 | [diff] [blame] | 95 | framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type |
| 96 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid weights shape |
| 97 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F16), // Non supported data type |
Gunes Bayir | ec0113d | 2022-11-09 09:26:27 +0000 | [diff] [blame] | 98 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid bias shape |
Freddie Liardet | e92b045 | 2021-04-22 14:55:17 +0100 | [diff] [blame] | 99 | TensorInfo(TensorShape(13U, 11U, 4U, 3U), 1, DataType::F32), // Window shrink |
| 100 | TensorInfo(TensorShape(32U, 16U, 2U), 1, DataType::F32), |
Gunes Bayir | ec0113d | 2022-11-09 09:26:27 +0000 | [diff] [blame] | 101 | TensorInfo(TensorShape(2U, 13U, 27U), 1, DataType::F32, DataLayout::NHWC), // Mismatching data type |
| 102 | TensorInfo(TensorShape(2U, 13U, 27U), 1, DataType::F32, DataLayout::NHWC), // Invalid weights shape |
| 103 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F16, DataLayout::NHWC), // Non supported data type |
| 104 | TensorInfo(TensorShape(2U, 13U, 27U), 1, DataType::F32, DataLayout::NHWC), // Invalid bias shape |
| 105 | TensorInfo(TensorShape(4U, 11U, 13U, 3U), 1, DataType::F32, DataLayout::NHWC), // Window shrink |
| 106 | TensorInfo(TensorShape(2U, 16U, 32U), 1, DataType::F32, DataLayout::NHWC), |
Freddie Liardet | e92b045 | 2021-04-22 14:55:17 +0100 | [diff] [blame] | 107 | }), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 108 | framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16), |
Freddie Liardet | e92b045 | 2021-04-22 14:55:17 +0100 | [diff] [blame] | 109 | TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32), |
| 110 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16), |
| 111 | TensorInfo(TensorShape(3U, 2U, 2U, 2U), 1, DataType::F32), |
| 112 | TensorInfo(TensorShape(3U, 3U, 4U), 1, DataType::F32), |
Vidhya Sudhan Loganathan | 7485d5a | 2018-07-04 09:34:00 +0100 | [diff] [blame] | 113 | TensorInfo(TensorShape(1U, 1U, 2U, 4U), 1, DataType::F32), |
Gunes Bayir | ec0113d | 2022-11-09 09:26:27 +0000 | [diff] [blame] | 114 | TensorInfo(TensorShape(2U, 3U, 3U, 2U), 1, DataType::F16, DataLayout::NHWC), |
| 115 | TensorInfo(TensorShape(2U, 3U, 3U, 4U), 1, DataType::F32, DataLayout::NHWC), |
| 116 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16, DataLayout::NHWC), |
| 117 | TensorInfo(TensorShape(2U, 2U, 3U, 2U), 1, DataType::F32, DataLayout::NHWC), |
| 118 | TensorInfo(TensorShape(4U, 3U, 3U), 1, DataType::F32, DataLayout::NHWC), |
| 119 | TensorInfo(TensorShape(2U, 2U, 2U, 4U), 1, DataType::F32, DataLayout::NHWC), |
Freddie Liardet | e92b045 | 2021-04-22 14:55:17 +0100 | [diff] [blame] | 120 | })), |
| 121 | framework::dataset::make("BiasInfo", { TensorInfo(TensorShape(1U), 1, DataType::F16), |
| 122 | TensorInfo(TensorShape(1U), 1, DataType::F32), |
| 123 | TensorInfo(TensorShape(1U), 1, DataType::F32), |
| 124 | TensorInfo(TensorShape(25U, 11U), 1, DataType::F32), |
| 125 | TensorInfo(TensorShape(1U), 1, DataType::F32), |
| 126 | TensorInfo(TensorShape(4U), 1, DataType::F32), |
Gunes Bayir | ec0113d | 2022-11-09 09:26:27 +0000 | [diff] [blame] | 127 | TensorInfo(TensorShape(1U), 1, DataType::F16, DataLayout::NHWC), |
| 128 | TensorInfo(TensorShape(1U), 1, DataType::F32, DataLayout::NHWC), |
| 129 | TensorInfo(TensorShape(1U), 1, DataType::F32, DataLayout::NHWC), |
| 130 | TensorInfo(TensorShape(25U, 11U), 1, DataType::F32, DataLayout::NHWC), |
| 131 | TensorInfo(TensorShape(1U), 1, DataType::F32, DataLayout::NHWC), |
| 132 | TensorInfo(TensorShape(4U), 1, DataType::F32, DataLayout::NHWC), |
Freddie Liardet | e92b045 | 2021-04-22 14:55:17 +0100 | [diff] [blame] | 133 | })), |
| 134 | framework::dataset::make("OutputInfo", { TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F16), |
| 135 | TensorInfo(TensorShape(25U, 10U, 2U), 1, DataType::F32), |
| 136 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 137 | TensorInfo(TensorShape(13U, 13U, 2U), 1, DataType::F32), |
| 138 | TensorInfo(TensorShape(11U, 9U, 1U, 3U), 1, DataType::F32), |
| 139 | TensorInfo(TensorShape(32U, 16U, 4U), 1, DataType::F32), |
Gunes Bayir | ec0113d | 2022-11-09 09:26:27 +0000 | [diff] [blame] | 140 | TensorInfo(TensorShape(2U, 11U, 25U), 1, DataType::F16, DataLayout::NHWC), |
| 141 | TensorInfo(TensorShape(2U, 10U, 25U), 1, DataType::F32, DataLayout::NHWC), |
| 142 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32, DataLayout::NHWC), |
| 143 | TensorInfo(TensorShape(2U, 13U, 13U), 1, DataType::F32, DataLayout::NHWC), |
| 144 | TensorInfo(TensorShape(1U, 9U, 11U, 3U), 1, DataType::F32, DataLayout::NHWC), |
| 145 | TensorInfo(TensorShape(4U, 43U, 91U), 1, DataType::F32, DataLayout::NHWC), |
Freddie Liardet | e92b045 | 2021-04-22 14:55:17 +0100 | [diff] [blame] | 146 | })), |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 147 | framework::dataset::make("PadStrideInfo", { PadStrideInfo(1, 1, 0, 0), |
| 148 | PadStrideInfo(1, 1, 0, 0), |
| 149 | PadStrideInfo(1, 1, 0, 0), |
Manuel Bottini | c1b76fa | 2019-06-17 12:04:40 +0100 | [diff] [blame] | 150 | PadStrideInfo(1, 1, 0, 0), |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 151 | PadStrideInfo(1, 1, 1, 1), |
| 152 | PadStrideInfo(1, 1, 0, 0), |
Gunes Bayir | ec0113d | 2022-11-09 09:26:27 +0000 | [diff] [blame] | 153 | PadStrideInfo(1, 1, 0, 0), |
| 154 | PadStrideInfo(1, 1, 0, 0), |
| 155 | PadStrideInfo(1, 1, 0, 0), |
| 156 | PadStrideInfo(1, 1, 0, 0), |
| 157 | PadStrideInfo(1, 1, 1, 1), |
| 158 | PadStrideInfo(3, 3, 2, 2), |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 159 | })), |
Gunes Bayir | ec0113d | 2022-11-09 09:26:27 +0000 | [diff] [blame] | 160 | framework::dataset::make("Expected", { false, false, false, false, false, true, // NCHW |
| 161 | false, false, false, false, false, true })), // NHWC |
Manuel Bottini | c1b76fa | 2019-06-17 12:04:40 +0100 | [diff] [blame] | 162 | input_info, weights_info, bias_info, output_info, pad_info, expected) |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 163 | { |
Manuel Bottini | c1b76fa | 2019-06-17 12:04:40 +0100 | [diff] [blame] | 164 | bool is_valid = bool(CLDeconvolutionLayer::validate(&input_info.clone()->set_is_resizable(false), &weights_info.clone()->set_is_resizable(false), &bias_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), pad_info)); |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 165 | ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS); |
| 166 | } |
| 167 | // clang-format on |
| 168 | // *INDENT-ON* |
| 169 | |
| 170 | template <typename T> |
Michele Di Giorgio | 14cbfb2 | 2019-10-23 10:53:10 +0100 | [diff] [blame] | 171 | using CLDeconvolutionLayerFixture4x4 = DeconvolutionValidationFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 4, 4>; |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 172 | |
| 173 | template <typename T> |
Michele Di Giorgio | 14cbfb2 | 2019-10-23 10:53:10 +0100 | [diff] [blame] | 174 | using CLDeconvolutionLayerFixture3x3 = DeconvolutionValidationFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 3, 3>; |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 175 | |
| 176 | template <typename T> |
Matthew Jackson | b9070a4 | 2019-08-22 16:13:27 +0100 | [diff] [blame] | 177 | using CLDeconvolutionLayerAsymmFixture3x3 = DeconvolutionValidationAsymmFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 3, 3>; |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 178 | |
| 179 | template <typename T> |
Michele Di Giorgio | 14cbfb2 | 2019-10-23 10:53:10 +0100 | [diff] [blame] | 180 | using CLDeconvolutionLayerFixture2x2 = DeconvolutionValidationFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 2, 2>; |
Matthew Jackson | b9070a4 | 2019-08-22 16:13:27 +0100 | [diff] [blame] | 181 | |
| 182 | template <typename T> |
Michele Di Giorgio | 14cbfb2 | 2019-10-23 10:53:10 +0100 | [diff] [blame] | 183 | using CLDeconvolutionLayerFixture1x1 = DeconvolutionValidationFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 1, 1>; |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 184 | |
Manuel Bottini | 6e10aa3 | 2020-04-30 13:28:23 +0100 | [diff] [blame] | 185 | template <typename T> |
| 186 | using CLDeconvolutionLayerAsymmFixture9x9 = DeconvolutionValidationAsymmFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 9, 9>; |
| 187 | |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 188 | TEST_SUITE(Float) |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 189 | TEST_SUITE(FP32) |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 190 | |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 191 | TEST_SUITE(W4x4) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 192 | FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerFixture4x4<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data4x4, framework::dataset::make("DataType", DataType::F32)), |
| 193 | data_layouts_dataset), |
| 194 | add_bias_dataset)) |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 195 | { |
| 196 | // Validate output |
| 197 | validate(CLAccessor(_target), _reference, tolerance_fp32); |
| 198 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 199 | TEST_SUITE_END() // W4x4 |
Georgios Pinitas | ced7a8d | 2018-02-01 16:31:33 +0000 | [diff] [blame] | 200 | |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 201 | TEST_SUITE(W3x3) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 202 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data3x3_precommit, framework::dataset::make("DataType", |
| 203 | DataType::F32)), |
| 204 | data_layouts_dataset), |
| 205 | add_bias_dataset)) |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 206 | { |
| 207 | // Validate output |
| 208 | validate(CLAccessor(_target), _reference, tolerance_fp32); |
| 209 | } |
Gunes Bayir | ec0113d | 2022-11-09 09:26:27 +0000 | [diff] [blame] | 210 | |
| 211 | FIXTURE_DATA_TEST_CASE(RunSmallWithLargeChannels, CLDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data3x3_precommit_large_channels, |
| 212 | framework::dataset::make("DataType", |
| 213 | DataType::F32)), |
| 214 | data_layouts_dataset), |
| 215 | framework::dataset::make("AddBias", { true }))) |
| 216 | { |
| 217 | // Validate output |
| 218 | validate(CLAccessor(_target), _reference, tolerance_fp32); |
| 219 | } |
| 220 | |
Matthew Jackson | b9070a4 | 2019-08-22 16:13:27 +0100 | [diff] [blame] | 221 | FIXTURE_DATA_TEST_CASE(RunAsymm, CLDeconvolutionLayerAsymmFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3_asymm, framework::dataset::make("DataType", |
| 222 | DataType::F32)), |
| 223 | data_layouts_dataset), |
| 224 | add_bias_dataset)) |
| 225 | { |
| 226 | // Validate output |
| 227 | validate(CLAccessor(_target), _reference, tolerance_fp32); |
| 228 | } |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 229 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDeconvolutionLayerFixture3x3<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3, framework::dataset::make("DataType", DataType::F32)), |
| 230 | data_layouts_dataset), |
| 231 | add_bias_dataset)) |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 232 | { |
| 233 | // Validate output |
| 234 | validate(CLAccessor(_target), _reference, tolerance_fp32); |
| 235 | } |
| 236 | TEST_SUITE_END() // W3x3 |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 237 | |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 238 | TEST_SUITE(W2x2) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 239 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerFixture2x2<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data2x2_precommit, framework::dataset::make("DataType", |
| 240 | DataType::F32)), |
| 241 | data_layouts_dataset), |
| 242 | add_bias_dataset)) |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 243 | { |
| 244 | // Validate output |
| 245 | validate(CLAccessor(_target), _reference, tolerance_fp32); |
| 246 | } |
| 247 | TEST_SUITE_END() // W2x2 |
| 248 | |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 249 | TEST_SUITE(W1x1) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 250 | FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerFixture1x1<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data1x1, framework::dataset::make("DataType", DataType::F32)), |
| 251 | data_layouts_dataset), |
| 252 | add_bias_dataset)) |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 253 | { |
| 254 | // Validate output |
| 255 | validate(CLAccessor(_target), _reference, tolerance_fp32); |
| 256 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 257 | TEST_SUITE_END() // W1x1 |
Manuel Bottini | 6e10aa3 | 2020-04-30 13:28:23 +0100 | [diff] [blame] | 258 | TEST_SUITE(W9x9) |
| 259 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerAsymmFixture9x9<float>, framework::DatasetMode::ALL, combine(combine(combine(data9x9_small_asymm, framework::dataset::make("DataType", |
| 260 | DataType::F32)), |
| 261 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
| 262 | framework::dataset::make("AddBias", { false }))) |
| 263 | { |
| 264 | // Validate output |
| 265 | validate(CLAccessor(_target), _reference, tolerance_fp32); |
| 266 | } |
| 267 | TEST_SUITE_END() // W9x9 |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 268 | TEST_SUITE_END() // FP32 |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 269 | |
| 270 | TEST_SUITE(FP16) |
| 271 | |
| 272 | TEST_SUITE(W4x4) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 273 | FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerFixture4x4<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data4x4, framework::dataset::make("DataType", DataType::F16)), |
| 274 | data_layouts_dataset), |
| 275 | add_bias_dataset)) |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 276 | { |
| 277 | // Validate output |
| 278 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
| 279 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 280 | TEST_SUITE_END() // W4x4 |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 281 | |
| 282 | TEST_SUITE(W3x3) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 283 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerFixture3x3<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data3x3_precommit, framework::dataset::make("DataType", |
| 284 | DataType::F16)), |
| 285 | data_layouts_dataset), |
| 286 | add_bias_dataset)) |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 287 | { |
| 288 | // Validate output |
| 289 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
| 290 | } |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 291 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDeconvolutionLayerFixture3x3<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data3x3, framework::dataset::make("DataType", DataType::F16)), |
| 292 | data_layouts_dataset), |
| 293 | add_bias_dataset)) |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 294 | { |
| 295 | // Validate output |
| 296 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
| 297 | } |
| 298 | TEST_SUITE_END() // W3x3 |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 299 | |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 300 | TEST_SUITE(W2x2) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 301 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerFixture2x2<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data2x2_precommit, framework::dataset::make("DataType", |
| 302 | DataType::F16)), |
| 303 | data_layouts_dataset), |
| 304 | add_bias_dataset)) |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 305 | { |
| 306 | // Validate output |
giuros01 | b56d0cd | 2019-05-13 13:24:55 +0100 | [diff] [blame] | 307 | validate(CLAccessor(_target), _reference, tolerance_f16); |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 308 | } |
| 309 | TEST_SUITE_END() // W2x2 |
| 310 | |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 311 | TEST_SUITE(W1x1) |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 312 | FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerFixture1x1<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(data1x1, framework::dataset::make("DataType", DataType::F16)), |
| 313 | data_layouts_dataset), |
| 314 | add_bias_dataset)) |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 315 | { |
| 316 | // Validate output |
| 317 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
| 318 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 319 | TEST_SUITE_END() // W1x1 |
Georgios Pinitas | 793f87d | 2018-05-18 20:08:58 +0100 | [diff] [blame] | 320 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 321 | TEST_SUITE_END() // FP16 |
| 322 | TEST_SUITE_END() // Float |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 323 | |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 324 | template <typename T> |
| 325 | using CLDeconvolutionLayerQuantizedFixture4x4 = DeconvolutionValidationQuantizedFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 4, 4>; |
| 326 | |
| 327 | template <typename T> |
| 328 | using CLDeconvolutionLayerQuantizedFixture3x3 = DeconvolutionValidationQuantizedFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 3, 3>; |
| 329 | |
| 330 | template <typename T> |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 331 | using CLDeconvolutionLayerQuantizedFixture2x2 = DeconvolutionValidationQuantizedFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 2, 2>; |
| 332 | |
| 333 | template <typename T> |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 334 | using CLDeconvolutionLayerQuantizedFixture1x1 = DeconvolutionValidationQuantizedFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, 1, 1>; |
| 335 | |
Freddie Liardet | e92b045 | 2021-04-22 14:55:17 +0100 | [diff] [blame] | 336 | template <typename T> |
| 337 | using CLDeconvolutionLayerQuantizedPerChannelFixture4x4 = DeconvolutionValidationQuantizedPerChannelFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, int8_t, 4, 4>; |
| 338 | |
| 339 | template <typename T> |
| 340 | using CLDeconvolutionLayerQuantizedPerChannelFixture3x3 = DeconvolutionValidationQuantizedPerChannelFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, int8_t, 3, 3>; |
| 341 | |
| 342 | template <typename T> |
| 343 | using CLDeconvolutionLayerQuantizedPerChannelFixture2x2 = DeconvolutionValidationQuantizedPerChannelFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, int8_t, 2, 2>; |
| 344 | |
| 345 | template <typename T> |
| 346 | using CLDeconvolutionLayerQuantizedPerChannelFixture1x1 = DeconvolutionValidationQuantizedPerChannelFixture<CLTensor, CLAccessor, CLDeconvolutionLayer, T, int8_t, 1, 1>; |
| 347 | |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 348 | TEST_SUITE(Quantized) |
| 349 | TEST_SUITE(QASYMM8) |
| 350 | |
| 351 | TEST_SUITE(W4x4) |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 352 | FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerQuantizedFixture4x4<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data4x4, framework::dataset::make("DataType", |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 353 | DataType::QASYMM8)), |
| 354 | data_layouts_dataset), |
Giuseppe Rossini | 0a958cb | 2020-01-16 16:38:56 +0000 | [diff] [blame] | 355 | framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 10), QuantizationInfo(2.f / 255.f, 5) })), |
| 356 | framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 5), QuantizationInfo(4.f / 255.f, 10) })), |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 357 | add_bias_dataset)) |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 358 | { |
| 359 | // Validate output |
| 360 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 361 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 362 | TEST_SUITE_END() // W4x4 |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 363 | |
| 364 | TEST_SUITE(W3x3) |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 365 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(data3x3_precommit, |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 366 | framework::dataset::make("DataType", |
| 367 | DataType::QASYMM8)), |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 368 | data_layouts_dataset), |
Giuseppe Rossini | 0a958cb | 2020-01-16 16:38:56 +0000 | [diff] [blame] | 369 | framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 10), QuantizationInfo(2.f / 255.f, 4) })), |
| 370 | framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 10), QuantizationInfo(4.f / 255.f, 5) })), |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 371 | add_bias_dataset)) |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 372 | { |
| 373 | // Validate output |
| 374 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 375 | } |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 376 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDeconvolutionLayerQuantizedFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data3x3, |
| 377 | framework::dataset::make("DataType", |
| 378 | DataType::QASYMM8)), |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 379 | data_layouts_dataset), |
Giuseppe Rossini | 0a958cb | 2020-01-16 16:38:56 +0000 | [diff] [blame] | 380 | framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 10), QuantizationInfo(2.f / 255.f, 128) })), |
| 381 | framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 128), QuantizationInfo(4.f / 255.f, 128) })), |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 382 | add_bias_dataset)) |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 383 | { |
| 384 | // Validate output |
| 385 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 386 | } |
| 387 | TEST_SUITE_END() // W3x3 |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 388 | |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 389 | TEST_SUITE(W2x2) |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 390 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedFixture2x2<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(data2x2_precommit, |
| 391 | framework::dataset::make("DataType", DataType::QASYMM8)), |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 392 | data_layouts_dataset), |
Giuseppe Rossini | 0a958cb | 2020-01-16 16:38:56 +0000 | [diff] [blame] | 393 | framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 128), QuantizationInfo(2.f / 255.f, 128) })), |
| 394 | framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 64), QuantizationInfo(4.f / 255.f, 128) })), |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 395 | add_bias_dataset)) |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 396 | { |
| 397 | // Validate output |
Giuseppe Rossini | 0a958cb | 2020-01-16 16:38:56 +0000 | [diff] [blame] | 398 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
giuros01 | 46a49a0 | 2019-04-01 13:50:22 +0100 | [diff] [blame] | 399 | } |
| 400 | TEST_SUITE_END() // W2x2 |
| 401 | |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 402 | TEST_SUITE(W1x1) |
Manuel Bottini | 279814b | 2019-10-25 10:28:28 +0100 | [diff] [blame] | 403 | FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerQuantizedFixture1x1<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data1x1, framework::dataset::make("DataType", |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 404 | DataType::QASYMM8)), |
| 405 | data_layouts_dataset), |
Giuseppe Rossini | 0a958cb | 2020-01-16 16:38:56 +0000 | [diff] [blame] | 406 | framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 0), QuantizationInfo(2.f / 255.f, 0) })), |
| 407 | framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 0), QuantizationInfo(4.f / 255.f, 0) })), |
Manuel Bottini | 9f0d5ec | 2019-08-19 13:31:38 +0100 | [diff] [blame] | 408 | add_bias_dataset)) |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 409 | { |
| 410 | // Validate output |
| 411 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 412 | } |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 413 | TEST_SUITE_END() // W1x1 |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 414 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 415 | TEST_SUITE_END() // QASYMM8 |
Sheri Zhang | a14817a | 2020-02-26 10:30:15 +0000 | [diff] [blame] | 416 | |
| 417 | TEST_SUITE(QASYMM8_SIGNED) |
| 418 | |
| 419 | // QASYMM8_SIGNED: zero-point in range [-128, 127] |
| 420 | // QASYMM8 : zero-point in range [0 , 255] |
| 421 | |
| 422 | TEST_SUITE(W4x4) |
| 423 | FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerQuantizedFixture4x4<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data4x4, framework::dataset::make("DataType", |
| 424 | DataType::QASYMM8_SIGNED)), |
| 425 | data_layouts_dataset), |
| 426 | framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 10), QuantizationInfo(2.f / 255.f, 5) })), |
| 427 | framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 5), QuantizationInfo(4.f / 255.f, 10) })), |
| 428 | add_bias_dataset)) |
| 429 | { |
| 430 | // Validate output |
| 431 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 432 | } |
| 433 | TEST_SUITE_END() // W4x4 |
| 434 | |
| 435 | TEST_SUITE(W3x3) |
| 436 | // DirectDeconvolution |
| 437 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedFixture3x3<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(data3x3_precommit, |
| 438 | framework::dataset::make("DataType", |
| 439 | DataType::QASYMM8_SIGNED)), |
| 440 | data_layouts_dataset), |
| 441 | framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 10), QuantizationInfo(2.f / 255.f, 4) })), |
| 442 | framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 10), QuantizationInfo(4.f / 255.f, 5) })), |
| 443 | add_bias_dataset)) |
| 444 | { |
| 445 | // Validate output |
| 446 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 447 | } |
| 448 | |
| 449 | FIXTURE_DATA_TEST_CASE(RunLarge, CLDeconvolutionLayerQuantizedFixture3x3<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data3x3, |
| 450 | framework::dataset::make("DataType", |
| 451 | DataType::QASYMM8_SIGNED)), |
| 452 | data_layouts_dataset), |
| 453 | framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, -10), QuantizationInfo(2.f / 255.f, 127) })), |
| 454 | framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 64), QuantizationInfo(4.f / 255.f, -128) })), |
| 455 | add_bias_dataset)) |
| 456 | { |
| 457 | // Validate output |
| 458 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 459 | } |
| 460 | TEST_SUITE_END() // W3x3 |
| 461 | |
| 462 | TEST_SUITE(W2x2) // GEMMDeconvolution |
| 463 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedFixture2x2<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(data2x2_precommit, |
| 464 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 465 | data_layouts_dataset), |
| 466 | framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 127), QuantizationInfo(2.f / 255.f, -128) })), |
| 467 | framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, -10), QuantizationInfo(4.f / 255.f, 64) })), |
| 468 | add_bias_dataset)) |
| 469 | { |
| 470 | // Validate output |
| 471 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 472 | } |
| 473 | TEST_SUITE_END() // W2x2 |
| 474 | |
| 475 | TEST_SUITE(W1x1) // DirectDeconvolution and GEMMDeconvolution |
Freddie Liardet | e92b045 | 2021-04-22 14:55:17 +0100 | [diff] [blame] | 476 | FIXTURE_DATA_TEST_CASE(Run, CLDeconvolutionLayerQuantizedFixture1x1<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(data1x1, |
| 477 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
Sheri Zhang | a14817a | 2020-02-26 10:30:15 +0000 | [diff] [blame] | 478 | data_layouts_dataset), |
| 479 | framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 0), QuantizationInfo(2.f / 255.f, 0) })), |
| 480 | framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 0), QuantizationInfo(4.f / 255.f, 0) })), |
| 481 | add_bias_dataset)) |
| 482 | { |
| 483 | // Validate output |
| 484 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 485 | } |
| 486 | TEST_SUITE_END() // W1x1 |
| 487 | |
| 488 | TEST_SUITE_END() // QASYMM8_SIGNED |
| 489 | |
Freddie Liardet | e92b045 | 2021-04-22 14:55:17 +0100 | [diff] [blame] | 490 | const auto input_qinfo_dataset = framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, 10) }); |
| 491 | const auto output_qinfo_dataset = framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 0) }); |
| 492 | const auto input_signed_qinfo_dataset = framework::dataset::make("InputQuantizationInfo", { QuantizationInfo(1.f / 255.f, -10) }); |
| 493 | const auto output_signed_qinfo_dataset = framework::dataset::make("OutputQuantizationInfo", { QuantizationInfo(3.f / 255.f, 10) }); |
| 494 | |
| 495 | TEST_SUITE(QSYMM8_PER_CHANNEL) |
| 496 | |
| 497 | TEST_SUITE(W4x4) |
Gunes Bayir | 5945070 | 2022-12-12 09:29:06 +0000 | [diff] [blame^] | 498 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedPerChannelFixture4x4<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(data4x4, |
Freddie Liardet | e92b045 | 2021-04-22 14:55:17 +0100 | [diff] [blame] | 499 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 500 | data_layouts_dataset), |
| 501 | input_qinfo_dataset), |
| 502 | output_qinfo_dataset), |
| 503 | add_bias_dataset), |
| 504 | framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL }))) |
| 505 | { |
| 506 | // Validate output |
| 507 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 508 | } |
Gunes Bayir | 5945070 | 2022-12-12 09:29:06 +0000 | [diff] [blame^] | 509 | FIXTURE_DATA_TEST_CASE(RunSmallSigned, CLDeconvolutionLayerQuantizedPerChannelFixture4x4<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(data4x4, |
Freddie Liardet | e92b045 | 2021-04-22 14:55:17 +0100 | [diff] [blame] | 510 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 511 | data_layouts_dataset), |
| 512 | input_signed_qinfo_dataset), |
| 513 | output_signed_qinfo_dataset), |
| 514 | add_bias_dataset), |
| 515 | framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL }))) |
| 516 | { |
| 517 | // Validate output |
| 518 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 519 | } |
| 520 | TEST_SUITE_END() // W4x4 |
| 521 | |
| 522 | TEST_SUITE(W3x3) |
Gunes Bayir | 5945070 | 2022-12-12 09:29:06 +0000 | [diff] [blame^] | 523 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedPerChannelFixture3x3<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(data3x3, |
Freddie Liardet | e92b045 | 2021-04-22 14:55:17 +0100 | [diff] [blame] | 524 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 525 | data_layouts_dataset), |
| 526 | input_qinfo_dataset), |
| 527 | output_qinfo_dataset), |
| 528 | add_bias_dataset), |
| 529 | framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL }))) |
| 530 | { |
| 531 | // Validate output |
| 532 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 533 | } |
Gunes Bayir | 5945070 | 2022-12-12 09:29:06 +0000 | [diff] [blame^] | 534 | FIXTURE_DATA_TEST_CASE(RunSmallSigned, CLDeconvolutionLayerQuantizedPerChannelFixture3x3<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(data3x3, |
Freddie Liardet | e92b045 | 2021-04-22 14:55:17 +0100 | [diff] [blame] | 535 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 536 | data_layouts_dataset), |
| 537 | input_signed_qinfo_dataset), |
| 538 | output_signed_qinfo_dataset), |
| 539 | add_bias_dataset), |
| 540 | framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL }))) |
| 541 | { |
| 542 | // Validate output |
| 543 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 544 | } |
Gunes Bayir | 5945070 | 2022-12-12 09:29:06 +0000 | [diff] [blame^] | 545 | |
| 546 | FIXTURE_DATA_TEST_CASE(RunSmallSignedPrecommit, CLDeconvolutionLayerQuantizedPerChannelFixture2x2<int8_t>, framework::DatasetMode::PRECOMMIT, |
| 547 | combine(combine(combine(combine(combine(combine(data3x3_precommit, |
| 548 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 549 | data_layouts_dataset), |
| 550 | input_signed_qinfo_dataset), |
| 551 | output_signed_qinfo_dataset), |
| 552 | add_bias_dataset), |
| 553 | framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL }))) |
| 554 | { |
| 555 | // Validate output |
| 556 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 557 | } |
Freddie Liardet | e92b045 | 2021-04-22 14:55:17 +0100 | [diff] [blame] | 558 | TEST_SUITE_END() // W3x3 |
| 559 | |
Gunes Bayir | 5945070 | 2022-12-12 09:29:06 +0000 | [diff] [blame^] | 560 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedPerChannelFixture2x2<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(combine(data3x3_precommit, |
Freddie Liardet | e92b045 | 2021-04-22 14:55:17 +0100 | [diff] [blame] | 561 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 562 | data_layouts_dataset), |
| 563 | input_qinfo_dataset), |
| 564 | output_qinfo_dataset), |
| 565 | add_bias_dataset), |
| 566 | framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL }))) |
| 567 | { |
| 568 | // Validate output |
| 569 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 570 | } |
Gunes Bayir | 5945070 | 2022-12-12 09:29:06 +0000 | [diff] [blame^] | 571 | |
| 572 | TEST_SUITE(W2x2) |
| 573 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedPerChannelFixture2x2<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(combine(data2x2_precommit, |
| 574 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 575 | data_layouts_dataset), |
| 576 | input_qinfo_dataset), |
| 577 | output_qinfo_dataset), |
| 578 | add_bias_dataset), |
| 579 | framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL }))) |
| 580 | { |
| 581 | // Validate output |
| 582 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 583 | } |
| 584 | FIXTURE_DATA_TEST_CASE(RunSmallSigned, CLDeconvolutionLayerQuantizedPerChannelFixture2x2<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(combine(data2x2_precommit, |
Freddie Liardet | e92b045 | 2021-04-22 14:55:17 +0100 | [diff] [blame] | 585 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 586 | data_layouts_dataset), |
| 587 | input_signed_qinfo_dataset), |
| 588 | output_signed_qinfo_dataset), |
| 589 | add_bias_dataset), |
| 590 | framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL }))) |
| 591 | { |
| 592 | // Validate output |
| 593 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 594 | } |
| 595 | TEST_SUITE_END() // W2x2 |
| 596 | |
| 597 | TEST_SUITE(W1x1) |
Gunes Bayir | 5945070 | 2022-12-12 09:29:06 +0000 | [diff] [blame^] | 598 | FIXTURE_DATA_TEST_CASE(RunSmall, CLDeconvolutionLayerQuantizedPerChannelFixture1x1<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(data1x1, |
Freddie Liardet | e92b045 | 2021-04-22 14:55:17 +0100 | [diff] [blame] | 599 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 600 | data_layouts_dataset), |
| 601 | input_qinfo_dataset), |
| 602 | output_qinfo_dataset), |
| 603 | add_bias_dataset), |
| 604 | framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL }))) |
| 605 | { |
| 606 | // Validate output |
| 607 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 608 | } |
Gunes Bayir | 5945070 | 2022-12-12 09:29:06 +0000 | [diff] [blame^] | 609 | FIXTURE_DATA_TEST_CASE(RunSmallSigned, CLDeconvolutionLayerQuantizedPerChannelFixture1x1<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(data1x1, |
Freddie Liardet | e92b045 | 2021-04-22 14:55:17 +0100 | [diff] [blame] | 610 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 611 | data_layouts_dataset), |
| 612 | input_signed_qinfo_dataset), |
| 613 | output_signed_qinfo_dataset), |
| 614 | add_bias_dataset), |
| 615 | framework::dataset::make("WeightsDataType", { DataType::QSYMM8_PER_CHANNEL }))) |
| 616 | { |
| 617 | // Validate output |
| 618 | validate(CLAccessor(_target), _reference, tolerance_qasymm8, tolerance_num); |
| 619 | } |
| 620 | TEST_SUITE_END() // W1x1 |
| 621 | |
| 622 | TEST_SUITE_END() // QSYMM8_PER_CHANNEL |
| 623 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 624 | TEST_SUITE_END() // Quantized |
Michele Di Giorgio | 9fef38a | 2018-07-06 18:06:58 +0100 | [diff] [blame] | 625 | |
Michalis Spyrou | 064add6 | 2018-11-01 18:14:27 +0000 | [diff] [blame] | 626 | TEST_SUITE_END() // DeconvolutionLayer |
| 627 | TEST_SUITE_END() // CL |
Michalis Spyrou | 780db4e | 2017-11-23 09:49:51 +0000 | [diff] [blame] | 628 | } // namespace validation |
| 629 | } // namespace test |
| 630 | } // namespace arm_compute |