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