Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 1 | /* |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2023 Arm Limited. |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [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, |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 22 | * SOFTWARE. |
| 23 | */ |
| 24 | #include "arm_compute/core/Types.h" |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 25 | #include "arm_compute/core/utils/misc/ShapeCalculator.h" |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 26 | #include "arm_compute/runtime/NEON/functions/NEDepthwiseConvolutionLayer.h" |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 27 | #include "arm_compute/runtime/Tensor.h" |
| 28 | #include "arm_compute/runtime/TensorAllocator.h" |
| 29 | #include "tests/NEON/Accessor.h" |
| 30 | #include "tests/PaddingCalculator.h" |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 31 | #include "tests/datasets/DepthwiseConvolutionLayerDataset.h" |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 32 | #include "tests/datasets/DilatedDepthwiseConvolutionLayerDataset.h" |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 33 | #include "tests/framework/Asserts.h" |
| 34 | #include "tests/framework/Macros.h" |
| 35 | #include "tests/framework/datasets/Datasets.h" |
| 36 | #include "tests/validation/Validation.h" |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 37 | #include "tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h" |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 38 | |
| 39 | namespace arm_compute |
| 40 | { |
| 41 | namespace test |
| 42 | { |
| 43 | namespace validation |
| 44 | { |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 45 | using framework::dataset::make; |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 46 | using namespace arm_compute::misc::shape_calculator; |
| 47 | |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 48 | namespace |
| 49 | { |
Georgios Pinitas | 8cffcd6 | 2018-11-16 17:11:50 +0000 | [diff] [blame] | 50 | constexpr RelativeTolerance<float> tolerance_f32(0.01f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */ |
| 51 | constexpr AbsoluteTolerance<uint8_t> tolerance_qasymm8(1); /**< Tolerance value for comparing reference's output against implementation's output for DataType::QASYMM8 */ |
| 52 | #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
Manuel Bottini | e5df1d5 | 2021-04-29 12:06:33 +0100 | [diff] [blame] | 53 | RelativeTolerance<half_float::half> tolerance_f16(half_float::half(0.02)); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F16 */ |
Georgios Pinitas | 8cffcd6 | 2018-11-16 17:11:50 +0000 | [diff] [blame] | 54 | constexpr float tolerance_num = 0.05f; /**< Tolerance number */ |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 55 | #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 56 | |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 57 | const auto depth_multipliers = make("DepthMultiplier", { 1, 2, 8 }); |
| 58 | const auto large_depth_multipliers = make("DepthMultiplier", { 5, 32 }); |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 59 | |
| 60 | //Activation Functions |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 61 | const auto ActivationFunctionsDataset = make("ActivationInfo", |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 62 | { |
| 63 | ActivationLayerInfo(), |
| 64 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) |
| 65 | }); |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 66 | |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 67 | const auto ActivationFunctionsDatasetNightly = make("ActivationInfo", |
| 68 | { |
| 69 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 0.5f), |
| 70 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 0.5f, -0.5f), |
| 71 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LEAKY_RELU, 0.1f), |
| 72 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::SOFT_RELU), |
| 73 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::ELU), |
| 74 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::ABS), |
| 75 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LOGISTIC), |
| 76 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::TANH), |
| 77 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::SQUARE), |
| 78 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::SWISH), |
| 79 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::HARD_SWISH), |
| 80 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LINEAR, 2.f, 1.f), |
| 81 | #ifdef __aarch64__ |
| 82 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::GELU), |
| 83 | #endif // __aarch64__ |
| 84 | }); |
| 85 | |
| 86 | const auto ActivationFunctionsQuantizedDataset = make("ActivationInfo", |
| 87 | { |
| 88 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU, 0.5f), |
| 89 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU, 0.5f, -0.5f), |
| 90 | }); |
| 91 | |
| 92 | const auto input_qinfo_dataset = make("InputQInfo", |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 93 | { |
| 94 | QuantizationInfo(0.3f, 10), |
| 95 | QuantizationInfo(2.2f, 10), |
| 96 | }); |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 97 | } // namespace |
| 98 | |
| 99 | TEST_SUITE(NEON) |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 100 | TEST_SUITE(DepthwiseConvolutionLayer) |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 101 | |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 102 | // *INDENT-OFF* |
| 103 | // clang-format off |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 104 | DATA_TEST_CASE(Validate3x3, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip( |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 105 | make("InputInfo", { TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching data type input/weights |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 106 | TensorInfo(TensorShape(32U, 18U, 3U), 1, DataType::F32), // Mismatching input feature maps |
| 107 | TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Unsupported weights dimensions |
| 108 | TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Mismatching depth multiplier |
Giorgio Arena | 66cbafb | 2018-08-23 14:51:00 +0100 | [diff] [blame] | 109 | TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::QASYMM8), // Invalid stride |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 110 | TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases size |
| 111 | TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid biases dimensions |
| 112 | TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), // Invalid output size |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 113 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // patch size bigger than input width |
| 114 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // dilation < 1 |
Giorgio Arena | 66cbafb | 2018-08-23 14:51:00 +0100 | [diff] [blame] | 115 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 116 | }), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 117 | make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F16), |
Giorgio Arena | 66cbafb | 2018-08-23 14:51:00 +0100 | [diff] [blame] | 118 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
| 119 | TensorInfo(TensorShape(5U, 5U, 2U, 2U), 1, DataType::F32), |
| 120 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
| 121 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::QASYMM8), |
| 122 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
| 123 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
| 124 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
| 125 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 126 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
| 127 | TensorInfo(TensorShape(3U, 3U, 2U, 2U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 128 | })), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 129 | make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 130 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 131 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 132 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
Giorgio Arena | 66cbafb | 2018-08-23 14:51:00 +0100 | [diff] [blame] | 133 | TensorInfo(TensorShape(2U), 1, DataType::S32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 134 | TensorInfo(TensorShape(4U), 1, DataType::F32), |
| 135 | TensorInfo(TensorShape(2U, 2U), 1, DataType::F32), |
| 136 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 137 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 138 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 139 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 140 | })), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 141 | make("OutputInfo", { TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 142 | TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32), |
| 143 | TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32), |
| 144 | TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32), |
Giorgio Arena | 66cbafb | 2018-08-23 14:51:00 +0100 | [diff] [blame] | 145 | TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::QASYMM8), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 146 | TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32), |
| 147 | TensorInfo(TensorShape(30U, 16U, 2U), 1, DataType::F32), |
| 148 | TensorInfo(TensorShape(32U, 18U, 2U), 1, DataType::F32), |
| 149 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 150 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 151 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 152 | })), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 153 | make("ConvInfo", { PadStrideInfo(1, 1, 0, 0), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 154 | PadStrideInfo(1, 1, 0, 0), |
| 155 | PadStrideInfo(1, 1, 0, 0), |
| 156 | PadStrideInfo(1, 1, 0, 0), |
| 157 | PadStrideInfo(4, 1, 0, 0), |
| 158 | PadStrideInfo(1, 1, 0, 0), |
| 159 | PadStrideInfo(1, 1, 0, 0), |
| 160 | PadStrideInfo(1, 1, 0, 0), |
| 161 | PadStrideInfo(1, 1, 0, 0), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 162 | PadStrideInfo(1, 1, 0, 0), |
| 163 | PadStrideInfo(1, 1, 0, 0), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 164 | })), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 165 | make("DepthMultiplier", { 1, |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 166 | 1, |
| 167 | 1, |
| 168 | 3, |
| 169 | 1, |
| 170 | 1, |
| 171 | 1, |
| 172 | 1, |
| 173 | 1, |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 174 | 1, |
| 175 | 1, |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 176 | })), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 177 | make("Dilation", { Size2D(1U, 1U), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 178 | Size2D(1U, 1U), |
| 179 | Size2D(1U, 1U), |
| 180 | Size2D(1U, 1U), |
| 181 | Size2D(1U, 1U), |
| 182 | Size2D(1U, 1U), |
| 183 | Size2D(1U, 1U), |
| 184 | Size2D(1U, 1U), |
| 185 | Size2D(25U, 1U), |
| 186 | Size2D(0U, 1U), |
| 187 | Size2D(1U, 1U), |
| 188 | })), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 189 | make("Expected", { false, false, false, false, false, false, false, false, false, false, true })), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 190 | input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier,dilation, expected) |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 191 | { |
Manuel Bottini | 05069f0 | 2019-09-26 17:18:26 +0100 | [diff] [blame] | 192 | bool is_valid = bool(NEDepthwiseConvolutionLayer::validate(&input_info.clone()->set_is_resizable(false), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 193 | &weights_info.clone()->set_is_resizable(false), &biases_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), conv_info, depth_multiplier, ActivationLayerInfo(), dilation)); |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 194 | ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS); |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 195 | } |
| 196 | |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 197 | DATA_TEST_CASE(ValidateGeneric, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip( |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 198 | make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching data type input/weights |
Giorgio Arena | d93e263 | 2019-10-15 11:09:33 +0100 | [diff] [blame] | 199 | TensorInfo(TensorShape(27U, 13U, 3U), 1, DataType::F32), // Mismatching input feature maps |
| 200 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Mismatching depth multiplier |
| 201 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases size |
| 202 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid biases dimensions |
| 203 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), // Invalid output size |
| 204 | TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // Patch size bigger than input width |
| 205 | TensorInfo(TensorShape(27U, 13U, 8U), 1, DataType::F32), // Dilation < 1 |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 206 | }), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 207 | make("WeightsInfo", { TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F16), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 208 | TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32), |
| 209 | TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32), |
| 210 | TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32), |
| 211 | TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32), |
| 212 | TensorInfo(TensorShape(3U, 3U, 2U), 1, DataType::F32), |
| 213 | TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 214 | TensorInfo(TensorShape(3U, 3U, 16U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 215 | })), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 216 | make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 217 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 218 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 219 | TensorInfo(TensorShape(4U), 1, DataType::F32), |
| 220 | TensorInfo(TensorShape(2U, 2U), 1, DataType::F32), |
| 221 | TensorInfo(TensorShape(2U), 1, DataType::F32), |
| 222 | TensorInfo(TensorShape(16U), 1, DataType::F32), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 223 | TensorInfo(TensorShape(16U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 224 | })), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 225 | make("OutputInfo", { TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 226 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 227 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 228 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 229 | TensorInfo(TensorShape(25U, 11U, 2U), 1, DataType::F32), |
| 230 | TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), |
| 231 | TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 232 | TensorInfo(TensorShape(25U, 11U, 16U), 1, DataType::F32), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 233 | })), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 234 | make("ConvInfo", { PadStrideInfo(1, 1, 0, 0), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 235 | PadStrideInfo(1, 1, 0, 0), |
| 236 | PadStrideInfo(1, 1, 0, 0), |
| 237 | PadStrideInfo(1, 1, 0, 0), |
| 238 | PadStrideInfo(1, 1, 0, 0), |
| 239 | PadStrideInfo(1, 1, 0, 0), |
| 240 | PadStrideInfo(1, 1, 0, 0), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 241 | PadStrideInfo(1, 1, 0, 0), |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 242 | })), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 243 | make("DepthMultiplier", { 1, |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 244 | 1, |
| 245 | 3, |
| 246 | 1, |
| 247 | 1, |
| 248 | 1, |
| 249 | 2, |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 250 | 2, |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 251 | })), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 252 | make("Dilation", { Size2D(1U, 1U), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 253 | Size2D(1U, 1U), |
| 254 | Size2D(1U, 1U), |
| 255 | Size2D(1U, 1U), |
| 256 | Size2D(1U, 1U), |
| 257 | Size2D(1U, 1U), |
| 258 | Size2D(25U, 1U), |
| 259 | Size2D(0U, 1U), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 260 | })), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 261 | make("Expected", { false, false, false, false, false, false, false, false})), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 262 | input_info, weights_info, biases_info, output_info, conv_info, depth_multiplier,dilation, expected) |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 263 | { |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 264 | bool is_valid = bool(NEDepthwiseConvolutionLayer::validate(&input_info.clone()->set_is_resizable(false), &weights_info.clone()->set_is_resizable(false), &biases_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), conv_info, depth_multiplier, ActivationLayerInfo(), dilation)); |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 265 | ARM_COMPUTE_EXPECT(is_valid == expected, framework::LogLevel::ERRORS); |
| 266 | } |
| 267 | // clang-format on |
| 268 | // *INDENT-ON* |
Manuel Bottini | 05069f0 | 2019-09-26 17:18:26 +0100 | [diff] [blame] | 269 | template <typename T> |
| 270 | using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>; |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 271 | template <typename T> |
| 272 | using NEDepthwiseConvolutionLayerMixedDataLayoutFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T, true>; |
Milos Puzovic | a7077e9 | 2022-10-28 16:49:15 +0100 | [diff] [blame] | 273 | template <typename T> |
| 274 | using NEDepthwiseConvolutionLayerVariableWeightsFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T, false, false, true>; |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 275 | |
Dmitry Savenko | d7295b7 | 2017-11-20 22:00:08 +0700 | [diff] [blame] | 276 | TEST_SUITE(Float) |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 277 | TEST_SUITE(F32) |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 278 | |
| 279 | FIXTURE_DATA_TEST_CASE_NEW(RunActivations, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, |
| 280 | combine( |
| 281 | make("In", TensorShape(33U, 27U, 11U, 3U)), |
| 282 | make("Weights", Size2D(3U, 4U)), |
| 283 | make("Info", PadStrideInfo(1, 2, 0, 1)), |
| 284 | make("Dilation", Size2D(2U, 2U)), |
| 285 | make("DepthMultiplier", { 5 }), |
| 286 | make("DataType", DataType::F32), |
| 287 | make("DataLayout", { DataLayout::NHWC, DataLayout::NCHW }), |
| 288 | ActivationFunctionsDatasetNightly)) |
| 289 | { |
| 290 | validate(Accessor(_target), _reference, tolerance_f32); |
| 291 | } |
| 292 | |
Michalis Spyrou | b7b3153 | 2017-11-23 12:10:21 +0000 | [diff] [blame] | 293 | TEST_SUITE(Generic) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 294 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
| 295 | depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 296 | make("DataType", DataType::F32)), |
| 297 | make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 298 | ActivationFunctionsDataset)) |
Michalis Spyrou | b7b3153 | 2017-11-23 12:10:21 +0000 | [diff] [blame] | 299 | { |
| 300 | validate(Accessor(_target), _reference, tolerance_f32); |
| 301 | } |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 302 | FIXTURE_DATA_TEST_CASE_NEW(RunMixedDataLayout, NEDepthwiseConvolutionLayerMixedDataLayoutFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 303 | make("DepthMultiplier", { 2 })), |
| 304 | make("DataType", DataType::F32)), |
| 305 | make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 306 | make("ActivationInfo", ActivationLayerInfo()))) |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 307 | { |
| 308 | validate(Accessor(_target), _reference, tolerance_f32); |
| 309 | } |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 310 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(), |
| 311 | large_depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 312 | make("DataType", DataType::F32)), |
| 313 | make("DataLayout", { DataLayout::NHWC })), |
| 314 | make("ActivationInfo", { ActivationLayerInfo() }))) |
Michalis Spyrou | b7b3153 | 2017-11-23 12:10:21 +0000 | [diff] [blame] | 315 | { |
| 316 | validate(Accessor(_target), _reference, tolerance_f32); |
| 317 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 318 | TEST_SUITE(Dilation) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 319 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, |
| 320 | combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
| 321 | depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 322 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 323 | DataType::F32)), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 324 | make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 325 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 326 | { |
| 327 | validate(Accessor(_target), _reference, tolerance_f32); |
| 328 | } |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 329 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, |
| 330 | combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(), |
| 331 | large_depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 332 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 333 | DataType::F32)), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 334 | make("DataLayout", { DataLayout::NHWC })), |
| 335 | make("ActivationInfo", { ActivationLayerInfo() }))) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 336 | { |
| 337 | validate(Accessor(_target), _reference, tolerance_f32); |
| 338 | } |
| 339 | TEST_SUITE_END() // Dilation |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 340 | TEST_SUITE_END() // Generic |
Michalis Spyrou | b7b3153 | 2017-11-23 12:10:21 +0000 | [diff] [blame] | 341 | |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 342 | TEST_SUITE(W3x3) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 343 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), |
| 344 | depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 345 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 346 | DataType::F32)), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 347 | make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 348 | ActivationFunctionsDataset)) |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 349 | { |
| 350 | validate(Accessor(_target), _reference, tolerance_f32); |
| 351 | } |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 352 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, |
| 353 | combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
| 354 | large_depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 355 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 356 | DataType::F32)), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 357 | make("DataLayout", { DataLayout::NHWC })), |
| 358 | make("ActivationInfo", { ActivationLayerInfo() }))) |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 359 | { |
| 360 | validate(Accessor(_target), _reference, tolerance_f32); |
| 361 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 362 | TEST_SUITE(Dilation) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 363 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, |
| 364 | combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 365 | depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 366 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 367 | DataType::F32)), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 368 | make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 369 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 370 | { |
| 371 | validate(Accessor(_target), _reference, tolerance_f32); |
| 372 | } |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 373 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, |
| 374 | combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 375 | large_depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 376 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 377 | DataType::F32)), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 378 | make("DataLayout", { DataLayout::NHWC })), |
| 379 | make("ActivationInfo", { ActivationLayerInfo() }))) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 380 | { |
| 381 | validate(Accessor(_target), _reference, tolerance_f32); |
| 382 | } |
| 383 | |
| 384 | TEST_SUITE_END() // Dilation |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 385 | TEST_SUITE_END() // W3x3 |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 386 | |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 387 | TEST_SUITE(Optimized) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 388 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, |
| 389 | combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 390 | make("DepthMultiplier", 1)), |
| 391 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 392 | DataType::F32)), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 393 | make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 394 | ActivationFunctionsDataset)) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 395 | { |
| 396 | validate(Accessor(_target), _reference, tolerance_f32); |
| 397 | } |
Milos Puzovic | a7077e9 | 2022-10-28 16:49:15 +0100 | [diff] [blame] | 398 | FIXTURE_DATA_TEST_CASE_NEW(RunVariableWeightsSmall3x3, NEDepthwiseConvolutionLayerVariableWeightsFixture<float>, framework::DatasetMode::PRECOMMIT, |
| 399 | combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 400 | make("DepthMultiplier", 1)), |
| 401 | make("DataType", |
Milos Puzovic | a7077e9 | 2022-10-28 16:49:15 +0100 | [diff] [blame] | 402 | DataType::F32)), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 403 | make("DataLayout", { DataLayout::NHWC })), |
Milos Puzovic | a7077e9 | 2022-10-28 16:49:15 +0100 | [diff] [blame] | 404 | ActivationFunctionsDataset)) |
| 405 | { |
| 406 | validate(Accessor(_target), _reference, tolerance_f32); |
| 407 | } |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 408 | FIXTURE_DATA_TEST_CASE_NEW(RunMixedDataLayout3x3, NEDepthwiseConvolutionLayerMixedDataLayoutFixture<float>, framework::DatasetMode::PRECOMMIT, |
| 409 | combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 410 | make("DepthMultiplier", 1)), |
| 411 | make("DataType", DataType::F32)), |
| 412 | make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 413 | make("ActivationInfo", ActivationLayerInfo()))) |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 414 | { |
| 415 | validate(Accessor(_target), _reference, tolerance_f32); |
| 416 | } |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 417 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall5x5, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, |
| 418 | combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 419 | make("DepthMultiplier", 1)), |
| 420 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 421 | DataType::F32)), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 422 | make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 423 | ActivationFunctionsDataset)) |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 424 | { |
| 425 | validate(Accessor(_target), _reference, tolerance_f32); |
| 426 | } |
Milos Puzovic | a7077e9 | 2022-10-28 16:49:15 +0100 | [diff] [blame] | 427 | FIXTURE_DATA_TEST_CASE_NEW(RunVariableWeightsSmall5x5, NEDepthwiseConvolutionLayerVariableWeightsFixture<float>, framework::DatasetMode::PRECOMMIT, |
| 428 | combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 429 | make("DepthMultiplier", 1)), |
| 430 | make("DataType", |
Milos Puzovic | a7077e9 | 2022-10-28 16:49:15 +0100 | [diff] [blame] | 431 | DataType::F32)), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 432 | make("DataLayout", { DataLayout::NHWC })), |
Milos Puzovic | a7077e9 | 2022-10-28 16:49:15 +0100 | [diff] [blame] | 433 | ActivationFunctionsDataset)) |
| 434 | { |
| 435 | validate(Accessor(_target), _reference, tolerance_f32); |
| 436 | } |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 437 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, |
| 438 | combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 439 | make("DepthMultiplier", 1)), |
| 440 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 441 | DataType::F32)), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 442 | make("DataLayout", { DataLayout::NHWC })), |
| 443 | make("ActivationInfo", { ActivationLayerInfo() }))) |
Georgios Pinitas | 4074c99 | 2018-01-30 18:13:46 +0000 | [diff] [blame] | 444 | { |
| 445 | validate(Accessor(_target), _reference, tolerance_f32); |
| 446 | } |
Milos Puzovic | a7077e9 | 2022-10-28 16:49:15 +0100 | [diff] [blame] | 447 | FIXTURE_DATA_TEST_CASE_NEW(RunVariableWeightsLarge3x3, NEDepthwiseConvolutionLayerVariableWeightsFixture<float>, framework::DatasetMode::NIGHTLY, |
| 448 | combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 449 | make("DepthMultiplier", 1)), |
| 450 | make("DataType", |
Milos Puzovic | a7077e9 | 2022-10-28 16:49:15 +0100 | [diff] [blame] | 451 | DataType::F32)), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 452 | make("DataLayout", { DataLayout::NHWC })), |
| 453 | make("ActivationInfo", { ActivationLayerInfo() }))) |
Milos Puzovic | a7077e9 | 2022-10-28 16:49:15 +0100 | [diff] [blame] | 454 | { |
| 455 | validate(Accessor(_target), _reference, tolerance_f32); |
| 456 | } |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 457 | TEST_SUITE_END() // Optimized |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 458 | TEST_SUITE_END() // F32 |
Pablo Tello | 941cd70 | 2017-12-12 14:35:00 +0000 | [diff] [blame] | 459 | |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 460 | #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
| 461 | TEST_SUITE(F16) |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 462 | |
| 463 | FIXTURE_DATA_TEST_CASE_NEW(RunActivations, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, |
| 464 | combine( |
| 465 | make("In", TensorShape(33U, 27U, 11U, 3U)), |
| 466 | make("Weights", Size2D(3U, 4U)), |
| 467 | make("Info", PadStrideInfo(1, 2, 0, 1)), |
| 468 | make("Dilation", Size2D(2U, 2U)), |
| 469 | make("DepthMultiplier", { 5 }), |
| 470 | make("DataType", DataType::F16), |
| 471 | make("DataLayout", { DataLayout::NHWC, DataLayout::NCHW }), |
| 472 | ActivationFunctionsDatasetNightly)) |
| 473 | { |
| 474 | validate(Accessor(_target), _reference, tolerance_f16, tolerance_num); |
| 475 | } |
| 476 | |
Georgios Pinitas | 8cffcd6 | 2018-11-16 17:11:50 +0000 | [diff] [blame] | 477 | TEST_SUITE(Generic) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 478 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
| 479 | depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 480 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 481 | DataType::F16)), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 482 | make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 483 | ActivationFunctionsDataset)) |
Georgios Pinitas | 8cffcd6 | 2018-11-16 17:11:50 +0000 | [diff] [blame] | 484 | { |
| 485 | validate(Accessor(_target), _reference, tolerance_f16, tolerance_num); |
| 486 | } |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 487 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(), |
| 488 | large_depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 489 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 490 | DataType::F16)), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 491 | make("DataLayout", { DataLayout::NHWC })), |
| 492 | make("ActivationInfo", { ActivationLayerInfo() }))) |
Georgios Pinitas | 8cffcd6 | 2018-11-16 17:11:50 +0000 | [diff] [blame] | 493 | { |
| 494 | validate(Accessor(_target), _reference, tolerance_f16, tolerance_num); |
| 495 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 496 | |
| 497 | TEST_SUITE(Dilation) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 498 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, |
| 499 | combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
| 500 | depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 501 | make("DataType", DataType::F16)), |
| 502 | make("DataLayout", { DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 503 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 504 | { |
| 505 | validate(Accessor(_target), _reference, tolerance_f16, tolerance_num); |
| 506 | } |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 507 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, |
| 508 | combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(), |
| 509 | large_depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 510 | make("DataType", DataType::F16)), |
| 511 | make("DataLayout", { DataLayout::NHWC })), |
| 512 | make("ActivationInfo", { ActivationLayerInfo() }))) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 513 | { |
| 514 | validate(Accessor(_target), _reference, tolerance_f16, tolerance_num); |
| 515 | } |
| 516 | TEST_SUITE_END() // Dilation |
| 517 | |
Georgios Pinitas | 8cffcd6 | 2018-11-16 17:11:50 +0000 | [diff] [blame] | 518 | TEST_SUITE_END() // Generic |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 519 | template <typename T> |
Manuel Bottini | 05069f0 | 2019-09-26 17:18:26 +0100 | [diff] [blame] | 520 | using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>; |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 521 | TEST_SUITE(W3x3) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 522 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), |
| 523 | depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 524 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 525 | DataType::F16)), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 526 | make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 527 | ActivationFunctionsDataset)) |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 528 | { |
| 529 | validate(Accessor(_target), _reference, tolerance_f16); |
| 530 | } |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 531 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, |
| 532 | combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
| 533 | large_depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 534 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 535 | DataType::F16)), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 536 | make("DataLayout", { DataLayout::NHWC })), |
| 537 | make("ActivationInfo", { ActivationLayerInfo() }))) |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 538 | { |
| 539 | validate(Accessor(_target), _reference, tolerance_f16); |
| 540 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 541 | |
| 542 | TEST_SUITE(Dilation) |
| 543 | |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 544 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, |
| 545 | combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 546 | depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 547 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 548 | DataType::F16)), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 549 | make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 550 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 551 | { |
| 552 | validate(Accessor(_target), _reference, tolerance_f16); |
| 553 | } |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 554 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, |
| 555 | combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 556 | large_depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 557 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 558 | DataType::F16)), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 559 | make("DataLayout", { DataLayout::NHWC })), |
| 560 | make("ActivationInfo", { ActivationLayerInfo() }))) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 561 | { |
| 562 | validate(Accessor(_target), _reference, tolerance_f16); |
| 563 | } |
| 564 | |
| 565 | TEST_SUITE_END() // Dilation |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 566 | TEST_SUITE_END() // W3x3 |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 567 | |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 568 | TEST_SUITE(Optimized) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 569 | FIXTURE_DATA_TEST_CASE_NEW(RunSmallW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, |
| 570 | combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 571 | make("DepthMultiplier", 1)), |
| 572 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 573 | DataType::F16)), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 574 | make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 575 | ActivationFunctionsDataset)) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 576 | { |
| 577 | validate(Accessor(_target), _reference, tolerance_f16); |
| 578 | } |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 579 | FIXTURE_DATA_TEST_CASE_NEW(RunSmallW5x5, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, |
| 580 | combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 581 | make("DepthMultiplier", 1)), |
| 582 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 583 | DataType::F16)), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 584 | make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 585 | ActivationFunctionsDataset)) |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 586 | { |
| 587 | validate(Accessor(_target), _reference, tolerance_f16); |
| 588 | } |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 589 | FIXTURE_DATA_TEST_CASE_NEW(RunLargeW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, |
| 590 | combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 591 | make("DepthMultiplier", 1)), |
| 592 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 593 | DataType::F16)), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 594 | make("DataLayout", { DataLayout::NHWC })), |
| 595 | make("ActivationInfo", { ActivationLayerInfo() }))) |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 596 | { |
| 597 | validate(Accessor(_target), _reference, tolerance_f16); |
| 598 | } |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 599 | TEST_SUITE_END() // Optimized |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 600 | TEST_SUITE_END() // FP16 |
| 601 | #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
| 602 | |
| 603 | TEST_SUITE_END() // Float |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 604 | |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 605 | template <typename T> |
Giorgio Arena | d93e263 | 2019-10-15 11:09:33 +0100 | [diff] [blame] | 606 | using NEDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>; |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 607 | template <typename T> |
| 608 | using NEDepthwiseConvolutionLayerQuantizedMixedDataLayoutFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T, true>; |
Giorgio Arena | d93e263 | 2019-10-15 11:09:33 +0100 | [diff] [blame] | 609 | using NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture = DepthwiseConvolutionLayerValidationQuantizedPerChannelFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, uint8_t, int8_t>; |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 610 | |
| 611 | TEST_SUITE(Quantized) |
| 612 | TEST_SUITE(QASYMM8) |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 613 | |
| 614 | FIXTURE_DATA_TEST_CASE_NEW(RunActivations, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY, |
| 615 | combine( |
| 616 | make("In", TensorShape(33U, 27U, 11U, 3U)), |
| 617 | make("Weights", Size2D(3U, 4U)), |
| 618 | make("Info", PadStrideInfo(1, 2, 0, 1)), |
| 619 | make("Dilation", Size2D(2U, 2U)), |
| 620 | make("DepthMultiplier", { 5 }), |
| 621 | make("DataType", DataType::QASYMM8), |
| 622 | make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) }), |
| 623 | make("DstQuantizationInfo", { QuantizationInfo(0.05f, 4) }), |
| 624 | make("DataLayout", { DataLayout::NHWC, DataLayout::NCHW }), |
| 625 | ActivationFunctionsQuantizedDataset)) |
| 626 | { |
| 627 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 628 | } |
| 629 | |
Georgios Pinitas | d05dce4 | 2018-01-22 16:29:17 +0000 | [diff] [blame] | 630 | TEST_SUITE(Generic) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 631 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
| 632 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
| 633 | depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 634 | make("DataType", DataType::QASYMM8)), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 635 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 636 | make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })), |
| 637 | make("DataLayout", { DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 638 | ActivationFunctionsDataset)) |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 639 | { |
| 640 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 641 | } |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 642 | FIXTURE_DATA_TEST_CASE_NEW(RunMixedDataLayout, NEDepthwiseConvolutionLayerQuantizedMixedDataLayoutFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
| 643 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 644 | make("DepthMultiplier", { 2 })), |
| 645 | make("DataType", DataType::QASYMM8)), |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 646 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 647 | make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })), |
| 648 | make("DataLayout", { DataLayout::NHWC })), |
| 649 | make("ActivationInfo", ActivationLayerInfo()))) |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 650 | { |
| 651 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 652 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 653 | TEST_SUITE(Dilation) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 654 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
| 655 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
| 656 | depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 657 | make("DataType", DataType::QASYMM8)), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 658 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 659 | make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })), |
| 660 | make("DataLayout", { DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 661 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 662 | { |
| 663 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 664 | } |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 665 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY, |
| 666 | combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(), |
| 667 | large_depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 668 | make("DataType", DataType::QASYMM8)), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 669 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 670 | make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })), |
| 671 | make("DataLayout", { DataLayout::NHWC })), |
| 672 | make("ActivationInfo", { ActivationLayerInfo() }))) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 673 | { |
| 674 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 675 | } |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 676 | TEST_SUITE_END() // Dilation |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 677 | TEST_SUITE_END() // Generic |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 678 | TEST_SUITE(W3x3) |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 679 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 680 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 681 | make("DataType", DataType::QASYMM8)), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 682 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 683 | make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 684 | make("DataLayout", { DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 685 | ActivationFunctionsDataset)) |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 686 | { |
| 687 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 688 | } |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 689 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY, |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 690 | combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
| 691 | large_depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 692 | make("DataType", DataType::QASYMM8)), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 693 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 694 | make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 695 | make("DataLayout", { DataLayout::NHWC })), |
| 696 | make("ActivationInfo", { ActivationLayerInfo() }))) |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 697 | { |
| 698 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 699 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 700 | |
| 701 | TEST_SUITE(Dilation) |
| 702 | |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 703 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 704 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 705 | make("DataType", DataType::QASYMM8)), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 706 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 707 | make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })), |
| 708 | make("DataLayout", { DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 709 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 710 | { |
| 711 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 712 | } |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 713 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY, |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 714 | combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 715 | large_depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 716 | make("DataType", DataType::QASYMM8)), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 717 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 718 | make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 719 | make("DataLayout", { DataLayout::NHWC })), |
| 720 | make("ActivationInfo", { ActivationLayerInfo() }))) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 721 | { |
| 722 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 723 | } |
| 724 | TEST_SUITE_END() // Dilation |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 725 | TEST_SUITE_END() // W3x3 |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 726 | |
| 727 | TEST_SUITE(Optimized) |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 728 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 729 | combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 730 | make("DepthMultiplier", 1)), |
| 731 | make("DataType", DataType::QASYMM8)), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 732 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 733 | make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 734 | make("DataLayout", { DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 735 | ActivationFunctionsDataset)) |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 736 | { |
| 737 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 738 | } |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 739 | FIXTURE_DATA_TEST_CASE_NEW(RunMixedDataLayout3x3, NEDepthwiseConvolutionLayerQuantizedMixedDataLayoutFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
| 740 | combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 741 | make("DepthMultiplier", 1)), |
| 742 | make("DataType", DataType::QASYMM8)), |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 743 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 744 | make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 745 | make("DataLayout", { DataLayout::NHWC })), |
| 746 | make("ActivationInfo", ActivationLayerInfo()))) |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 747 | { |
| 748 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 749 | } |
| 750 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall5x5, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 751 | combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 752 | make("DepthMultiplier", 1)), |
| 753 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 754 | DataType::QASYMM8)), |
| 755 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 756 | make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 757 | make("DataLayout", { DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 758 | ActivationFunctionsDataset)) |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 759 | { |
| 760 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 761 | } |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 762 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY, |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 763 | combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 764 | make("DepthMultiplier", 1)), |
| 765 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 766 | DataType::QASYMM8)), |
| 767 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 768 | make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 769 | make("DataLayout", { DataLayout::NHWC })), |
| 770 | make("ActivationInfo", { ActivationLayerInfo() }))) |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 771 | { |
| 772 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 773 | } |
| 774 | TEST_SUITE_END() // Optimized |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 775 | TEST_SUITE_END() // QASYMM8 |
Michele Di Giorgio | 13ec5f0 | 2020-01-02 12:11:13 +0000 | [diff] [blame] | 776 | |
| 777 | TEST_SUITE(QASYMM8_SIGNED) |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 778 | |
| 779 | FIXTURE_DATA_TEST_CASE_NEW(RunActivations, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY, |
| 780 | combine( |
| 781 | make("In", TensorShape(33U, 27U, 11U, 3U)), |
| 782 | make("Weights", Size2D(3U, 4U)), |
| 783 | make("Info", PadStrideInfo(1, 2, 0, 1)), |
| 784 | make("Dilation", Size2D(2U, 2U)), |
| 785 | make("DepthMultiplier", { 5 }), |
| 786 | make("DataType", DataType::QASYMM8_SIGNED), |
| 787 | make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) }), |
| 788 | make("DstQuantizationInfo", { QuantizationInfo(0.05f, 4) }), |
| 789 | make("DataLayout", { DataLayout::NHWC, DataLayout::NCHW }), |
| 790 | ActivationFunctionsQuantizedDataset)) |
| 791 | { |
| 792 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 793 | } |
| 794 | |
Michele Di Giorgio | 8c837ca | 2020-01-07 15:06:41 +0000 | [diff] [blame] | 795 | TEST_SUITE(Generic) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 796 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT, |
| 797 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
| 798 | depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 799 | make("DataType", DataType::QASYMM8_SIGNED)), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 800 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 801 | make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })), |
| 802 | make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 803 | ActivationFunctionsDataset)) |
Michele Di Giorgio | 8c837ca | 2020-01-07 15:06:41 +0000 | [diff] [blame] | 804 | { |
| 805 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 806 | } |
| 807 | |
| 808 | TEST_SUITE(Dilation) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 809 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT, |
| 810 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
| 811 | depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 812 | make("DataType", DataType::QASYMM8_SIGNED)), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 813 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 814 | make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })), |
| 815 | make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 816 | ActivationFunctionsDataset)) |
Michele Di Giorgio | 8c837ca | 2020-01-07 15:06:41 +0000 | [diff] [blame] | 817 | { |
| 818 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 819 | } |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 820 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY, |
| 821 | combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(), |
| 822 | large_depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 823 | make("DataType", DataType::QASYMM8_SIGNED)), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 824 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 825 | make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })), |
| 826 | make("DataLayout", { DataLayout::NCHW })), |
| 827 | make("ActivationInfo", { ActivationLayerInfo() }))) |
Michele Di Giorgio | 8c837ca | 2020-01-07 15:06:41 +0000 | [diff] [blame] | 828 | { |
| 829 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 830 | } |
| 831 | TEST_SUITE_END() // Dilation |
| 832 | TEST_SUITE_END() // Generic |
| 833 | |
Michele Di Giorgio | 13ec5f0 | 2020-01-02 12:11:13 +0000 | [diff] [blame] | 834 | TEST_SUITE(W3x3) |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 835 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT, |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 836 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 837 | make("DataType", DataType::QASYMM8_SIGNED)), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 838 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 839 | make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 840 | make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 841 | ActivationFunctionsDataset)) |
Michele Di Giorgio | 13ec5f0 | 2020-01-02 12:11:13 +0000 | [diff] [blame] | 842 | { |
| 843 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 844 | } |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 845 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY, |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 846 | combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
| 847 | large_depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 848 | make("DataType", DataType::QASYMM8_SIGNED)), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 849 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 850 | make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 851 | make("DataLayout", { DataLayout::NCHW })), |
| 852 | make("ActivationInfo", { ActivationLayerInfo() }))) |
Michele Di Giorgio | 13ec5f0 | 2020-01-02 12:11:13 +0000 | [diff] [blame] | 853 | { |
| 854 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 855 | } |
| 856 | |
| 857 | TEST_SUITE(Dilation) |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 858 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT, |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 859 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 860 | make("DataType", DataType::QASYMM8_SIGNED)), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 861 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 862 | make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })), |
| 863 | make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 864 | ActivationFunctionsDataset)) |
Michele Di Giorgio | 13ec5f0 | 2020-01-02 12:11:13 +0000 | [diff] [blame] | 865 | { |
| 866 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 867 | } |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 868 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY, |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 869 | combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 870 | large_depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 871 | make("DataType", DataType::QASYMM8_SIGNED)), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 872 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 873 | make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 874 | make("DataLayout", { DataLayout::NCHW })), |
| 875 | make("ActivationInfo", { ActivationLayerInfo() }))) |
Michele Di Giorgio | 13ec5f0 | 2020-01-02 12:11:13 +0000 | [diff] [blame] | 876 | { |
| 877 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 878 | } |
| 879 | TEST_SUITE_END() // Dilation |
| 880 | TEST_SUITE_END() // W3x3 |
Michele Di Giorgio | 8c837ca | 2020-01-07 15:06:41 +0000 | [diff] [blame] | 881 | |
| 882 | TEST_SUITE(Optimized) |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 883 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT, |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 884 | combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 885 | make("DepthMultiplier", 1)), |
| 886 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 887 | DataType::QASYMM8_SIGNED)), |
| 888 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 889 | make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 890 | make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 891 | ActivationFunctionsDataset)) |
Michele Di Giorgio | 8c837ca | 2020-01-07 15:06:41 +0000 | [diff] [blame] | 892 | { |
| 893 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 894 | } |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 895 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall5x5, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT, |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 896 | combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 897 | make("DepthMultiplier", 1)), |
| 898 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 899 | DataType::QASYMM8_SIGNED)), |
| 900 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 901 | make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 902 | make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 903 | ActivationFunctionsDataset)) |
Michele Di Giorgio | 8c837ca | 2020-01-07 15:06:41 +0000 | [diff] [blame] | 904 | { |
| 905 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 906 | } |
Manuel Bottini | ca62c6f | 2021-03-23 11:50:34 +0000 | [diff] [blame] | 907 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY, |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 908 | combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 909 | make("DepthMultiplier", 1)), |
| 910 | make("DataType", |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 911 | DataType::QASYMM8_SIGNED)), |
| 912 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 913 | make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 914 | make("DataLayout", { DataLayout::NCHW })), |
| 915 | make("ActivationInfo", { ActivationLayerInfo() }))) |
Michele Di Giorgio | 8c837ca | 2020-01-07 15:06:41 +0000 | [diff] [blame] | 916 | { |
| 917 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 918 | } |
| 919 | TEST_SUITE_END() // Optimized |
Michele Di Giorgio | 13ec5f0 | 2020-01-02 12:11:13 +0000 | [diff] [blame] | 920 | TEST_SUITE_END() // QASYMM8_SIGNED |
| 921 | |
Giorgio Arena | d93e263 | 2019-10-15 11:09:33 +0100 | [diff] [blame] | 922 | TEST_SUITE(QSYMM8_PER_CHANNEL) |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 923 | |
| 924 | FIXTURE_DATA_TEST_CASE_NEW(RunActivations, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY, |
| 925 | combine( |
| 926 | make("In", TensorShape(33U, 27U, 11U, 3U)), |
| 927 | make("Weights", Size2D(3U, 4U)), |
| 928 | make("Info", PadStrideInfo(1, 2, 0, 1)), |
| 929 | make("Dilation", Size2D(2U, 2U)), |
| 930 | make("DepthMultiplier", { 5 }), |
| 931 | make("InputDataType", DataType::QASYMM8), |
| 932 | make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL), |
| 933 | make("SrcQuantizationInfo", { QuantizationInfo(0.3f, 10) }), |
| 934 | make("DstQuantizationInfo", { QuantizationInfo(0.05f, 4) }), |
| 935 | make("DataLayout", { DataLayout::NHWC, DataLayout::NCHW }), |
| 936 | ActivationFunctionsQuantizedDataset)) |
| 937 | { |
| 938 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 939 | } |
| 940 | |
Giorgio Arena | d93e263 | 2019-10-15 11:09:33 +0100 | [diff] [blame] | 941 | TEST_SUITE(Generic) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 942 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT, |
| 943 | combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
| 944 | depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 945 | make("InputDataType", DataType::QASYMM8)), |
| 946 | make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 947 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 948 | make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })), |
| 949 | make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 950 | ActivationFunctionsDataset)) |
Giorgio Arena | d93e263 | 2019-10-15 11:09:33 +0100 | [diff] [blame] | 951 | { |
| 952 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 953 | } |
| 954 | |
| 955 | TEST_SUITE(Dilation) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 956 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT, |
| 957 | combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
| 958 | depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 959 | make("InputDataType", DataType::QASYMM8)), |
| 960 | make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 961 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 962 | make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })), |
| 963 | make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 964 | ActivationFunctionsDataset)) |
Giorgio Arena | d93e263 | 2019-10-15 11:09:33 +0100 | [diff] [blame] | 965 | { |
| 966 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 967 | } |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 968 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY, |
| 969 | combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(), |
| 970 | depth_multipliers), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 971 | make("InputDataType", DataType::QASYMM8)), |
| 972 | make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 973 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 974 | make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })), |
| 975 | make("DataLayout", { DataLayout::NHWC })), |
| 976 | make("ActivationInfo", { ActivationLayerInfo() }))) |
Giorgio Arena | d93e263 | 2019-10-15 11:09:33 +0100 | [diff] [blame] | 977 | { |
| 978 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 979 | } |
| 980 | TEST_SUITE_END() // Dilation |
| 981 | TEST_SUITE_END() // Generic |
Giuseppe Rossini | f01201a | 2019-11-06 14:57:49 +0000 | [diff] [blame] | 982 | |
| 983 | TEST_SUITE(Optimized) |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 984 | FIXTURE_DATA_TEST_CASE_NEW(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT, |
| 985 | combine(combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 986 | make("DepthMultiplier", 1)), |
| 987 | make("InputDataType", DataType::QASYMM8)), |
| 988 | make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 989 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 990 | make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })), |
| 991 | make("DataLayout", { DataLayout::NHWC })), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 992 | ActivationFunctionsDataset)) |
Giuseppe Rossini | f01201a | 2019-11-06 14:57:49 +0000 | [diff] [blame] | 993 | { |
| 994 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 995 | } |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 996 | FIXTURE_DATA_TEST_CASE_NEW(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY, |
| 997 | combine(combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 998 | make("DepthMultiplier", 1)), |
| 999 | make("InputDataType", DataType::QASYMM8)), |
| 1000 | make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)), |
Giorgio Arena | 68e29da | 2021-02-08 16:31:10 +0000 | [diff] [blame] | 1001 | input_qinfo_dataset), |
Gunes Bayir | 3af4c9b | 2023-10-08 17:51:28 +0100 | [diff] [blame] | 1002 | make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })), |
| 1003 | make("DataLayout", { DataLayout::NHWC })), |
| 1004 | make("ActivationInfo", { ActivationLayerInfo() }))) |
Giuseppe Rossini | f01201a | 2019-11-06 14:57:49 +0000 | [diff] [blame] | 1005 | { |
| 1006 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 1007 | } |
| 1008 | TEST_SUITE_END() // Optimized |
Giorgio Arena | d93e263 | 2019-10-15 11:09:33 +0100 | [diff] [blame] | 1009 | TEST_SUITE_END() // QSYMM8_PER_CHANNEL |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 1010 | TEST_SUITE_END() // Quantized |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 1011 | |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 1012 | TEST_SUITE_END() // DepthwiseConvLayer |
Sheri Zhang | ac6499a | 2021-02-10 15:32:38 +0000 | [diff] [blame] | 1013 | TEST_SUITE_END() // Neon |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 1014 | } // namespace validation |
| 1015 | } // namespace test |
| 1016 | } // namespace arm_compute |