Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 1 | /* |
Michele Di Giorgio | d9eaf61 | 2020-07-08 11:12:57 +0100 | [diff] [blame] | 2 | * Copyright (c) 2017-2020 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 |
| 52 | RelativeTolerance<half_float::half> tolerance_f16(half_float::half(0.01)); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F16 */ |
| 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 | |
Michele Di Giorgio | 633d30b | 2019-10-08 17:17:18 +0100 | [diff] [blame] | 56 | const auto depth_multipliers = framework::dataset::make("DepthMultiplier", { 1, 2, 5 }); |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 57 | const auto large_depth_multipliers = framework::dataset::make("DepthMultiplier", { 1, 2, 5, 8 }); |
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>; |
Abe Mbise | 7784c83 | 2018-05-31 16:48:41 +0100 | [diff] [blame] | 245 | |
Dmitry Savenko | d7295b7 | 2017-11-20 22:00:08 +0700 | [diff] [blame] | 246 | TEST_SUITE(Float) |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 247 | TEST_SUITE(F32) |
Michalis Spyrou | b7b3153 | 2017-11-23 12:10:21 +0000 | [diff] [blame] | 248 | TEST_SUITE(Generic) |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 249 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 250 | depth_multipliers), |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 251 | framework::dataset::make("DataType", |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 252 | DataType::F32)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 253 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 254 | ActivationFunctionsDataset)) |
Michalis Spyrou | b7b3153 | 2017-11-23 12:10:21 +0000 | [diff] [blame] | 255 | { |
| 256 | validate(Accessor(_target), _reference, tolerance_f32); |
| 257 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 258 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 259 | large_depth_multipliers), |
Giorgio Arena | 04a8f8c | 2017-11-23 11:45:24 +0000 | [diff] [blame] | 260 | framework::dataset::make("DataType", |
Giorgio Arena | 1ed1fc6 | 2018-03-26 16:20:05 +0100 | [diff] [blame] | 261 | DataType::F32)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 262 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 263 | ActivationFunctionsDataset)) |
Michalis Spyrou | b7b3153 | 2017-11-23 12:10:21 +0000 | [diff] [blame] | 264 | { |
| 265 | validate(Accessor(_target), _reference, tolerance_f32); |
| 266 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 267 | |
| 268 | TEST_SUITE(Dilation) |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 269 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
| 270 | depth_multipliers), |
| 271 | framework::dataset::make("DataType", |
| 272 | DataType::F32)), |
| 273 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 274 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 275 | { |
| 276 | validate(Accessor(_target), _reference, tolerance_f32); |
| 277 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 278 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 279 | large_depth_multipliers), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 280 | framework::dataset::make("DataType", |
| 281 | DataType::F32)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 282 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 283 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 284 | { |
| 285 | validate(Accessor(_target), _reference, tolerance_f32); |
| 286 | } |
| 287 | TEST_SUITE_END() // Dilation |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 288 | TEST_SUITE_END() // Generic |
Michalis Spyrou | b7b3153 | 2017-11-23 12:10:21 +0000 | [diff] [blame] | 289 | |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 290 | TEST_SUITE(W3x3) |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 291 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), |
| 292 | depth_multipliers), |
| 293 | framework::dataset::make("DataType", |
| 294 | DataType::F32)), |
| 295 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 296 | ActivationFunctionsDataset)) |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 297 | { |
| 298 | validate(Accessor(_target), _reference, tolerance_f32); |
| 299 | } |
Manuel Bottini | 05069f0 | 2019-09-26 17:18:26 +0100 | [diff] [blame] | 300 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 301 | combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 302 | large_depth_multipliers), |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 303 | framework::dataset::make("DataType", |
| 304 | DataType::F32)), |
| 305 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 306 | ActivationFunctionsDataset)) |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 307 | { |
| 308 | validate(Accessor(_target), _reference, tolerance_f32); |
| 309 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 310 | TEST_SUITE(Dilation) |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 311 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 312 | combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 313 | depth_multipliers), |
| 314 | framework::dataset::make("DataType", |
| 315 | DataType::F32)), |
| 316 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 317 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 318 | { |
| 319 | validate(Accessor(_target), _reference, tolerance_f32); |
| 320 | } |
Manuel Bottini | 05069f0 | 2019-09-26 17:18:26 +0100 | [diff] [blame] | 321 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 322 | combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 323 | large_depth_multipliers), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 324 | framework::dataset::make("DataType", |
| 325 | DataType::F32)), |
| 326 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 327 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 328 | { |
| 329 | validate(Accessor(_target), _reference, tolerance_f32); |
| 330 | } |
| 331 | |
| 332 | TEST_SUITE_END() // Dilation |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 333 | TEST_SUITE_END() // W3x3 |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 334 | |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 335 | TEST_SUITE(Optimized) |
Manuel Bottini | 05069f0 | 2019-09-26 17:18:26 +0100 | [diff] [blame] | 336 | FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 337 | combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(), |
| 338 | framework::dataset::make("DepthMultiplier", 1)), |
| 339 | framework::dataset::make("DataType", |
| 340 | DataType::F32)), |
| 341 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 342 | ActivationFunctionsDataset)) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 343 | { |
| 344 | validate(Accessor(_target), _reference, tolerance_f32); |
| 345 | } |
Manuel Bottini | 05069f0 | 2019-09-26 17:18:26 +0100 | [diff] [blame] | 346 | FIXTURE_DATA_TEST_CASE(RunSmall5x5, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::PRECOMMIT, |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 347 | combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(), |
| 348 | framework::dataset::make("DepthMultiplier", 1)), |
| 349 | framework::dataset::make("DataType", |
| 350 | DataType::F32)), |
| 351 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 352 | ActivationFunctionsDataset)) |
| 353 | { |
| 354 | validate(Accessor(_target), _reference, tolerance_f32); |
| 355 | } |
Manuel Bottini | 05069f0 | 2019-09-26 17:18:26 +0100 | [diff] [blame] | 356 | FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerFixture<float>, framework::DatasetMode::NIGHTLY, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 357 | combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(), |
| 358 | framework::dataset::make("DepthMultiplier", 1)), |
| 359 | framework::dataset::make("DataType", |
| 360 | DataType::F32)), |
| 361 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 362 | ActivationFunctionsDataset)) |
Georgios Pinitas | 4074c99 | 2018-01-30 18:13:46 +0000 | [diff] [blame] | 363 | { |
| 364 | validate(Accessor(_target), _reference, tolerance_f32); |
| 365 | } |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 366 | TEST_SUITE_END() // Optimized |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 367 | TEST_SUITE_END() // F32 |
Pablo Tello | 941cd70 | 2017-12-12 14:35:00 +0000 | [diff] [blame] | 368 | |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 369 | #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
| 370 | TEST_SUITE(F16) |
Georgios Pinitas | 8cffcd6 | 2018-11-16 17:11:50 +0000 | [diff] [blame] | 371 | TEST_SUITE(Generic) |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 372 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
Georgios Pinitas | 8cffcd6 | 2018-11-16 17:11:50 +0000 | [diff] [blame] | 373 | depth_multipliers), |
| 374 | framework::dataset::make("DataType", |
| 375 | DataType::F16)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 376 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 377 | ActivationFunctionsDataset)) |
Georgios Pinitas | 8cffcd6 | 2018-11-16 17:11:50 +0000 | [diff] [blame] | 378 | { |
| 379 | validate(Accessor(_target), _reference, tolerance_f16, tolerance_num); |
| 380 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 381 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 382 | large_depth_multipliers), |
Georgios Pinitas | 8cffcd6 | 2018-11-16 17:11:50 +0000 | [diff] [blame] | 383 | framework::dataset::make("DataType", |
| 384 | DataType::F16)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 385 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 386 | ActivationFunctionsDataset)) |
Georgios Pinitas | 8cffcd6 | 2018-11-16 17:11:50 +0000 | [diff] [blame] | 387 | { |
| 388 | validate(Accessor(_target), _reference, tolerance_f16, tolerance_num); |
| 389 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 390 | |
| 391 | TEST_SUITE(Dilation) |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 392 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
| 393 | depth_multipliers), |
| 394 | framework::dataset::make("DataType", |
| 395 | DataType::F16)), |
| 396 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 397 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 398 | { |
| 399 | validate(Accessor(_target), _reference, tolerance_f16, tolerance_num); |
| 400 | } |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 401 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 402 | large_depth_multipliers), |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 403 | framework::dataset::make("DataType", |
| 404 | DataType::F16)), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 405 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 406 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 407 | { |
| 408 | validate(Accessor(_target), _reference, tolerance_f16, tolerance_num); |
| 409 | } |
| 410 | TEST_SUITE_END() // Dilation |
| 411 | |
Georgios Pinitas | 8cffcd6 | 2018-11-16 17:11:50 +0000 | [diff] [blame] | 412 | TEST_SUITE_END() // Generic |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 413 | template <typename T> |
Manuel Bottini | 05069f0 | 2019-09-26 17:18:26 +0100 | [diff] [blame] | 414 | using NEDepthwiseConvolutionLayerFixture = DepthwiseConvolutionLayerValidationFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>; |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 415 | TEST_SUITE(W3x3) |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 416 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), |
| 417 | depth_multipliers), |
| 418 | framework::dataset::make("DataType", |
| 419 | DataType::F16)), |
| 420 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 421 | ActivationFunctionsDataset)) |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 422 | { |
| 423 | validate(Accessor(_target), _reference, tolerance_f16); |
| 424 | } |
Manuel Bottini | 05069f0 | 2019-09-26 17:18:26 +0100 | [diff] [blame] | 425 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 426 | combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 427 | large_depth_multipliers), |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 428 | framework::dataset::make("DataType", |
| 429 | DataType::F16)), |
| 430 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 431 | ActivationFunctionsDataset)) |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 432 | { |
| 433 | validate(Accessor(_target), _reference, tolerance_f16); |
| 434 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 435 | |
| 436 | TEST_SUITE(Dilation) |
| 437 | |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 438 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 439 | combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 440 | depth_multipliers), |
| 441 | framework::dataset::make("DataType", |
| 442 | DataType::F16)), |
| 443 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 444 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 445 | { |
| 446 | validate(Accessor(_target), _reference, tolerance_f16); |
| 447 | } |
Manuel Bottini | 05069f0 | 2019-09-26 17:18:26 +0100 | [diff] [blame] | 448 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 449 | combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 450 | large_depth_multipliers), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 451 | framework::dataset::make("DataType", |
| 452 | DataType::F16)), |
| 453 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 454 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 455 | { |
| 456 | validate(Accessor(_target), _reference, tolerance_f16); |
| 457 | } |
| 458 | |
| 459 | TEST_SUITE_END() // Dilation |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 460 | TEST_SUITE_END() // W3x3 |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 461 | |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 462 | TEST_SUITE(Optimized) |
Manuel Bottini | 05069f0 | 2019-09-26 17:18:26 +0100 | [diff] [blame] | 463 | FIXTURE_DATA_TEST_CASE(RunSmallW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 464 | combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(), |
| 465 | framework::dataset::make("DepthMultiplier", 1)), |
| 466 | framework::dataset::make("DataType", |
| 467 | DataType::F16)), |
| 468 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 469 | ActivationFunctionsDataset)) |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 470 | { |
| 471 | validate(Accessor(_target), _reference, tolerance_f16); |
| 472 | } |
Manuel Bottini | 05069f0 | 2019-09-26 17:18:26 +0100 | [diff] [blame] | 473 | FIXTURE_DATA_TEST_CASE(RunSmallW5x5, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::PRECOMMIT, |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 474 | combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(), |
| 475 | framework::dataset::make("DepthMultiplier", 1)), |
| 476 | framework::dataset::make("DataType", |
| 477 | DataType::F16)), |
| 478 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 479 | ActivationFunctionsDataset)) |
| 480 | { |
| 481 | validate(Accessor(_target), _reference, tolerance_f16); |
| 482 | } |
Manuel Bottini | 05069f0 | 2019-09-26 17:18:26 +0100 | [diff] [blame] | 483 | FIXTURE_DATA_TEST_CASE(RunLargeW3x3, NEDepthwiseConvolutionLayerFixture<half>, framework::DatasetMode::NIGHTLY, |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 484 | combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(), |
| 485 | framework::dataset::make("DepthMultiplier", 1)), |
| 486 | framework::dataset::make("DataType", |
| 487 | DataType::F16)), |
| 488 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 489 | ActivationFunctionsDataset)) |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 490 | { |
| 491 | validate(Accessor(_target), _reference, tolerance_f16); |
| 492 | } |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 493 | TEST_SUITE_END() // Optimized |
Georgios Pinitas | 20c246a | 2018-09-12 16:45:53 +0100 | [diff] [blame] | 494 | TEST_SUITE_END() // FP16 |
| 495 | #endif // __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
| 496 | |
| 497 | TEST_SUITE_END() // Float |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 498 | |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 499 | template <typename T> |
Manuel Bottini | 05069f0 | 2019-09-26 17:18:26 +0100 | [diff] [blame] | 500 | using NEDepthwiseConvolutionLayerQuantizedFixtureOptimized = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>; |
Georgios Pinitas | d05dce4 | 2018-01-22 16:29:17 +0000 | [diff] [blame] | 501 | template <typename T> |
Giorgio Arena | d93e263 | 2019-10-15 11:09:33 +0100 | [diff] [blame] | 502 | using NEDepthwiseConvolutionLayerQuantizedFixture = DepthwiseConvolutionLayerValidationQuantizedFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, T>; |
| 503 | using NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture = DepthwiseConvolutionLayerValidationQuantizedPerChannelFixture<Tensor, Accessor, NEDepthwiseConvolutionLayer, uint8_t, int8_t>; |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 504 | |
| 505 | TEST_SUITE(Quantized) |
| 506 | TEST_SUITE(QASYMM8) |
Georgios Pinitas | d05dce4 | 2018-01-22 16:29:17 +0000 | [diff] [blame] | 507 | TEST_SUITE(Generic) |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 508 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 509 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
| 510 | depth_multipliers), |
| 511 | framework::dataset::make("DataType", DataType::QASYMM8)), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 512 | input_qinfo_dataset), |
Gian Marco Iodice | e5ecd01 | 2019-08-28 15:56:36 +0100 | [diff] [blame] | 513 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })), |
Michele Di Giorgio | 8c837ca | 2020-01-07 15:06:41 +0000 | [diff] [blame] | 514 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 515 | ActivationFunctionsDataset)) |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 516 | { |
| 517 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 518 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 519 | |
| 520 | TEST_SUITE(Dilation) |
| 521 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 522 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
| 523 | depth_multipliers), |
| 524 | framework::dataset::make("DataType", DataType::QASYMM8)), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 525 | input_qinfo_dataset), |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 526 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })), |
Michele Di Giorgio | 8c837ca | 2020-01-07 15:06:41 +0000 | [diff] [blame] | 527 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 528 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 529 | { |
| 530 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 531 | } |
| 532 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<uint8_t>, framework::DatasetMode::NIGHTLY, |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 533 | combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 534 | large_depth_multipliers), |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 535 | framework::dataset::make("DataType", DataType::QASYMM8)), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 536 | input_qinfo_dataset), |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 537 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })), |
Michele Di Giorgio | 8c837ca | 2020-01-07 15:06:41 +0000 | [diff] [blame] | 538 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 539 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 540 | { |
| 541 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 542 | } |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 543 | TEST_SUITE_END() // Dilation |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 544 | TEST_SUITE_END() // Generic |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 545 | TEST_SUITE(W3x3) |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 546 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT, |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 547 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers), |
| 548 | framework::dataset::make("DataType", DataType::QASYMM8)), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 549 | input_qinfo_dataset), |
Gian Marco Iodice | e5ecd01 | 2019-08-28 15:56:36 +0100 | [diff] [blame] | 550 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
Michele Di Giorgio | 13ec5f0 | 2020-01-02 12:11:13 +0000 | [diff] [blame] | 551 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 552 | ActivationFunctionsDataset)) |
Giorgio Arena | 7657224 | 2018-04-04 17:44:26 +0100 | [diff] [blame] | 553 | { |
| 554 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 555 | } |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 556 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY, |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 557 | combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 558 | large_depth_multipliers), |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 559 | framework::dataset::make("DataType", DataType::QASYMM8)), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 560 | input_qinfo_dataset), |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 561 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
Michele Di Giorgio | 13ec5f0 | 2020-01-02 12:11:13 +0000 | [diff] [blame] | 562 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 563 | ActivationFunctionsDataset)) |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 564 | { |
| 565 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 566 | } |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 567 | |
| 568 | TEST_SUITE(Dilation) |
| 569 | |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 570 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT, |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 571 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers), |
| 572 | framework::dataset::make("DataType", DataType::QASYMM8)), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 573 | input_qinfo_dataset), |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 574 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })), |
Michele Di Giorgio | 13ec5f0 | 2020-01-02 12:11:13 +0000 | [diff] [blame] | 575 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 576 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 577 | { |
| 578 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 579 | } |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 580 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY, |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 581 | combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
Matthew Jackson | 6c2eac1 | 2019-07-23 10:43:10 +0100 | [diff] [blame] | 582 | large_depth_multipliers), |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 583 | framework::dataset::make("DataType", DataType::QASYMM8)), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 584 | input_qinfo_dataset), |
Pablo Tello | a28aebc | 2019-06-03 14:59:48 +0100 | [diff] [blame] | 585 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
Michele Di Giorgio | 13ec5f0 | 2020-01-02 12:11:13 +0000 | [diff] [blame] | 586 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
Manuel Bottini | a788c2f | 2019-04-08 13:18:00 +0100 | [diff] [blame] | 587 | ActivationFunctionsDataset)) |
Usama Arif | 881f2de | 2019-04-12 10:29:17 +0100 | [diff] [blame] | 588 | { |
| 589 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 590 | } |
| 591 | TEST_SUITE_END() // Dilation |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 592 | TEST_SUITE_END() // W3x3 |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 593 | |
| 594 | TEST_SUITE(Optimized) |
| 595 | FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT, |
| 596 | combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(), |
| 597 | framework::dataset::make("DepthMultiplier", 1)), |
| 598 | framework::dataset::make("DataType", |
| 599 | DataType::QASYMM8)), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 600 | input_qinfo_dataset), |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 601 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
Michele Di Giorgio | 8c837ca | 2020-01-07 15:06:41 +0000 | [diff] [blame] | 602 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 603 | ActivationFunctionsDataset)) |
| 604 | { |
| 605 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 606 | } |
| 607 | FIXTURE_DATA_TEST_CASE(RunSmall5x5, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::PRECOMMIT, |
| 608 | combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(), |
| 609 | framework::dataset::make("DepthMultiplier", 1)), |
| 610 | framework::dataset::make("DataType", |
| 611 | DataType::QASYMM8)), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 612 | input_qinfo_dataset), |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 613 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
Michele Di Giorgio | 8c837ca | 2020-01-07 15:06:41 +0000 | [diff] [blame] | 614 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 615 | ActivationFunctionsDataset)) |
| 616 | { |
| 617 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 618 | } |
| 619 | FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<uint8_t>, framework::DatasetMode::NIGHTLY, |
| 620 | combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(), |
| 621 | framework::dataset::make("DepthMultiplier", 1)), |
| 622 | framework::dataset::make("DataType", |
| 623 | DataType::QASYMM8)), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 624 | input_qinfo_dataset), |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 625 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
Michele Di Giorgio | 8c837ca | 2020-01-07 15:06:41 +0000 | [diff] [blame] | 626 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
Georgios Pinitas | 4c75851 | 2019-07-10 19:49:11 +0100 | [diff] [blame] | 627 | ActivationFunctionsDataset)) |
| 628 | { |
| 629 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 630 | } |
| 631 | TEST_SUITE_END() // Optimized |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 632 | TEST_SUITE_END() // QASYMM8 |
Michele Di Giorgio | 13ec5f0 | 2020-01-02 12:11:13 +0000 | [diff] [blame] | 633 | |
| 634 | TEST_SUITE(QASYMM8_SIGNED) |
Michele Di Giorgio | 8c837ca | 2020-01-07 15:06:41 +0000 | [diff] [blame] | 635 | TEST_SUITE(Generic) |
| 636 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT, |
| 637 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
| 638 | depth_multipliers), |
| 639 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 640 | input_qinfo_dataset), |
| 641 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })), |
| 642 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 643 | ActivationFunctionsDataset)) |
| 644 | { |
| 645 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 646 | } |
| 647 | |
| 648 | TEST_SUITE(Dilation) |
| 649 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::PRECOMMIT, |
| 650 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
| 651 | depth_multipliers), |
| 652 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 653 | input_qinfo_dataset), |
| 654 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.8f, 1) })), |
| 655 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 656 | ActivationFunctionsDataset)) |
| 657 | { |
| 658 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 659 | } |
| 660 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixture<int8_t>, framework::DatasetMode::NIGHTLY, |
| 661 | combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(), |
| 662 | large_depth_multipliers), |
| 663 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 664 | input_qinfo_dataset), |
| 665 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.9f, 11) })), |
| 666 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 667 | ActivationFunctionsDataset)) |
| 668 | { |
| 669 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 670 | } |
| 671 | TEST_SUITE_END() // Dilation |
| 672 | TEST_SUITE_END() // Generic |
| 673 | |
Michele Di Giorgio | 13ec5f0 | 2020-01-02 12:11:13 +0000 | [diff] [blame] | 674 | TEST_SUITE(W3x3) |
| 675 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT, |
| 676 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), depth_multipliers), |
| 677 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 678 | input_qinfo_dataset), |
| 679 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 680 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 681 | ActivationFunctionsDataset)) |
| 682 | { |
| 683 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 684 | } |
| 685 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::NIGHTLY, |
| 686 | combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
| 687 | large_depth_multipliers), |
| 688 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 689 | input_qinfo_dataset), |
| 690 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 691 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 692 | ActivationFunctionsDataset)) |
| 693 | { |
| 694 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 695 | } |
| 696 | |
| 697 | TEST_SUITE(Dilation) |
| 698 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT, |
| 699 | combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), depth_multipliers), |
| 700 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 701 | input_qinfo_dataset), |
| 702 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.7f, 10) })), |
| 703 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 704 | ActivationFunctionsDataset)) |
| 705 | { |
| 706 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 707 | } |
| 708 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::NIGHTLY, |
| 709 | combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 710 | large_depth_multipliers), |
| 711 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 712 | input_qinfo_dataset), |
| 713 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 714 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 715 | ActivationFunctionsDataset)) |
| 716 | { |
| 717 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 718 | } |
| 719 | TEST_SUITE_END() // Dilation |
| 720 | TEST_SUITE_END() // W3x3 |
Michele Di Giorgio | 8c837ca | 2020-01-07 15:06:41 +0000 | [diff] [blame] | 721 | |
| 722 | TEST_SUITE(Optimized) |
| 723 | FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT, |
| 724 | combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(), |
| 725 | framework::dataset::make("DepthMultiplier", 1)), |
| 726 | framework::dataset::make("DataType", |
| 727 | DataType::QASYMM8_SIGNED)), |
| 728 | input_qinfo_dataset), |
| 729 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 730 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 731 | ActivationFunctionsDataset)) |
| 732 | { |
| 733 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 734 | } |
| 735 | FIXTURE_DATA_TEST_CASE(RunSmall5x5, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::PRECOMMIT, |
| 736 | combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset5x5(), |
| 737 | framework::dataset::make("DepthMultiplier", 1)), |
| 738 | framework::dataset::make("DataType", |
| 739 | DataType::QASYMM8_SIGNED)), |
| 740 | input_qinfo_dataset), |
| 741 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 742 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 743 | ActivationFunctionsDataset)) |
| 744 | { |
| 745 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 746 | } |
| 747 | FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedFixtureOptimized<int8_t>, framework::DatasetMode::NIGHTLY, |
| 748 | combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(), |
| 749 | framework::dataset::make("DepthMultiplier", 1)), |
| 750 | framework::dataset::make("DataType", |
| 751 | DataType::QASYMM8_SIGNED)), |
| 752 | input_qinfo_dataset), |
| 753 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 10) })), |
| 754 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 755 | ActivationFunctionsDataset)) |
| 756 | { |
| 757 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 758 | } |
| 759 | TEST_SUITE_END() // Optimized |
Michele Di Giorgio | 13ec5f0 | 2020-01-02 12:11:13 +0000 | [diff] [blame] | 760 | TEST_SUITE_END() // QASYMM8_SIGNED |
| 761 | |
Giorgio Arena | d93e263 | 2019-10-15 11:09:33 +0100 | [diff] [blame] | 762 | TEST_SUITE(QSYMM8_PER_CHANNEL) |
| 763 | TEST_SUITE(Generic) |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 764 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT, |
Giorgio Arena | d93e263 | 2019-10-15 11:09:33 +0100 | [diff] [blame] | 765 | combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
| 766 | depth_multipliers), |
| 767 | framework::dataset::make("InputDataType", DataType::QASYMM8)), |
| 768 | framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 769 | input_qinfo_dataset), |
Giorgio Arena | d93e263 | 2019-10-15 11:09:33 +0100 | [diff] [blame] | 770 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })), |
| 771 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 772 | ActivationFunctionsDataset)) |
| 773 | { |
| 774 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 775 | } |
| 776 | |
| 777 | TEST_SUITE(Dilation) |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 778 | FIXTURE_DATA_TEST_CASE(RunSmall, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT, |
Giorgio Arena | d93e263 | 2019-10-15 11:09:33 +0100 | [diff] [blame] | 779 | combine(combine(combine(combine(combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
| 780 | depth_multipliers), |
| 781 | framework::dataset::make("InputDataType", DataType::QASYMM8)), |
| 782 | framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 783 | input_qinfo_dataset), |
Giorgio Arena | d93e263 | 2019-10-15 11:09:33 +0100 | [diff] [blame] | 784 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })), |
| 785 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 786 | ActivationFunctionsDataset)) |
| 787 | { |
| 788 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 789 | } |
| 790 | FIXTURE_DATA_TEST_CASE(RunLarge, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY, |
| 791 | combine(combine(combine(combine(combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(), |
| 792 | depth_multipliers), |
| 793 | framework::dataset::make("InputDataType", DataType::QASYMM8)), |
| 794 | framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 795 | input_qinfo_dataset), |
Giorgio Arena | d93e263 | 2019-10-15 11:09:33 +0100 | [diff] [blame] | 796 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })), |
| 797 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), |
| 798 | ActivationFunctionsDataset)) |
| 799 | { |
| 800 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 801 | } |
| 802 | TEST_SUITE_END() // Dilation |
| 803 | TEST_SUITE_END() // Generic |
Giuseppe Rossini | f01201a | 2019-11-06 14:57:49 +0000 | [diff] [blame] | 804 | |
| 805 | TEST_SUITE(Optimized) |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 806 | FIXTURE_DATA_TEST_CASE(RunSmall3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::PRECOMMIT, |
Giuseppe Rossini | f01201a | 2019-11-06 14:57:49 +0000 | [diff] [blame] | 807 | combine(combine(combine(combine(combine(combine(combine(datasets::SmallOptimizedDepthwiseConvolutionLayerDataset3x3(), |
| 808 | framework::dataset::make("DepthMultiplier", 1)), |
| 809 | framework::dataset::make("InputDataType", DataType::QASYMM8)), |
| 810 | framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 811 | input_qinfo_dataset), |
Giuseppe Rossini | f01201a | 2019-11-06 14:57:49 +0000 | [diff] [blame] | 812 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })), |
| 813 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
| 814 | ActivationFunctionsDataset)) |
| 815 | { |
| 816 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 817 | } |
| 818 | FIXTURE_DATA_TEST_CASE(RunLarge3x3, NEDepthwiseConvolutionLayerQuantizedSymmetricPerChannelFixture, framework::DatasetMode::NIGHTLY, |
| 819 | combine(combine(combine(combine(combine(combine(combine(datasets::LargeOptimizedDepthwiseConvolutionLayerDataset3x3(), |
| 820 | framework::dataset::make("DepthMultiplier", 1)), |
| 821 | framework::dataset::make("InputDataType", DataType::QASYMM8)), |
| 822 | framework::dataset::make("WeightsDataType", DataType::QSYMM8_PER_CHANNEL)), |
Michele Di Giorgio | f29d1b7 | 2019-10-29 10:58:13 +0000 | [diff] [blame] | 823 | input_qinfo_dataset), |
Giuseppe Rossini | f01201a | 2019-11-06 14:57:49 +0000 | [diff] [blame] | 824 | framework::dataset::make("DstQuantizationInfo", { QuantizationInfo(0.5f, 4) })), |
| 825 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
| 826 | ActivationFunctionsDataset)) |
| 827 | { |
| 828 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 829 | } |
| 830 | TEST_SUITE_END() // Optimized |
Giorgio Arena | d93e263 | 2019-10-15 11:09:33 +0100 | [diff] [blame] | 831 | TEST_SUITE_END() // QSYMM8_PER_CHANNEL |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 832 | TEST_SUITE_END() // Quantized |
Georgios Pinitas | f72f936 | 2018-01-12 16:29:45 +0000 | [diff] [blame] | 833 | |
Michalis Spyrou | aeebe4a | 2019-01-09 14:21:03 +0000 | [diff] [blame] | 834 | TEST_SUITE_END() // DepthwiseConvLayer |
| 835 | TEST_SUITE_END() // NEON |
Michalis Spyrou | 7362f0d | 2017-10-18 17:58:22 +0100 | [diff] [blame] | 836 | } // namespace validation |
| 837 | } // namespace test |
| 838 | } // namespace arm_compute |