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