Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 1 | /* |
Gunes Bayir | cc28773 | 2023-01-19 15:56:00 +0000 | [diff] [blame] | 2 | * Copyright (c) 2022-2023 Arm Limited. |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to |
| 8 | * deal in the Software without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in all |
| 14 | * copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | * SOFTWARE. |
| 23 | */ |
| 24 | |
| 25 | #include "arm_compute/dynamic_fusion/sketch/gpu/operators/GpuDepthwiseConv2d.h" |
| 26 | |
| 27 | #include "tests/CL/CLAccessor.h" |
| 28 | #include "tests/datasets/DepthwiseConvolutionLayerDataset.h" |
| 29 | #include "tests/datasets/DilatedDepthwiseConvolutionLayerDataset.h" |
| 30 | #include "tests/framework/Asserts.h" |
| 31 | #include "tests/framework/Fixture.h" |
| 32 | #include "tests/framework/Macros.h" |
| 33 | #include "tests/framework/datasets/Datasets.h" |
| 34 | #include "tests/validation/Validation.h" |
| 35 | #include "tests/validation/fixtures/dynamic_fusion/gpu/cl/DepthwiseConv2dFixture.h" |
| 36 | |
| 37 | namespace arm_compute |
| 38 | { |
| 39 | namespace test |
| 40 | { |
| 41 | namespace validation |
| 42 | { |
| 43 | const auto depth_multipliers = framework::dataset::make("DepthMultiplier", { 1U, 4U }); |
| 44 | const auto large_depth_multipliers = framework::dataset::make("DepthMultiplier", { 1, 2, 5, 8 }); |
| 45 | |
| 46 | TEST_SUITE(CL) |
| 47 | TEST_SUITE(DYNAMIC_FUSION) |
| 48 | TEST_SUITE(DEPTHWISE_CONV2D) |
| 49 | |
| 50 | RelativeTolerance<float> tolerance_f32(0.01f); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */ |
| 51 | RelativeTolerance<half_float::half> tolerance_f16(half_float::half(0.1)); /**< Tolerance value for comparing reference's output against implementation's output for DataType::F16 */ |
| 52 | constexpr float tolerance_num = 0.02f; /**< Tolerance number */ |
| 53 | |
| 54 | // *INDENT-OFF* |
| 55 | // clang-format off |
Gunes Bayir | cc28773 | 2023-01-19 15:56:00 +0000 | [diff] [blame] | 56 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(zip( // Explanations of failing tests |
| 57 | framework::dataset::make("InputInfo", { TensorInfo(TensorShape(2U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // Mismatching data type input/weights |
| 58 | TensorInfo(TensorShape(3U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // Mismatching input feature maps |
| 59 | TensorInfo(TensorShape(2U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // Mismatching depth multiplier |
| 60 | TensorInfo(TensorShape(2U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // Invalid biases size |
| 61 | TensorInfo(TensorShape(2U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // Invalid biases dimensions |
| 62 | TensorInfo(TensorShape(8U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), // dilation < 1 |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 63 | TensorInfo(TensorShape(8U, 27U, 13U), 1, DataType::F32, DataLayout::NHWC), |
Gunes Bayir | cc28773 | 2023-01-19 15:56:00 +0000 | [diff] [blame] | 64 | TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::QASYMM8, DataLayout::NHWC), // Unsupported data type |
| 65 | TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::QASYMM8_SIGNED, DataLayout::NHWC), // Unsupported data type |
| 66 | TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::QSYMM16, DataLayout::NHWC), // Unsupported data type |
| 67 | TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::QSYMM8, DataLayout::NHWC), // Unsupported data type |
| 68 | TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::QSYMM8_PER_CHANNEL, DataLayout::NHWC), // Unsupported data type |
| 69 | TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::QASYMM16, DataLayout::NHWC), // Unsupported data type |
| 70 | TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::U8, DataLayout::NHWC), // Unsupported data type |
| 71 | TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::S8, DataLayout::NHWC), // Unsupported data type |
| 72 | TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::U16, DataLayout::NHWC), // Unsupported data type |
| 73 | TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::S16, DataLayout::NHWC), // Unsupported data type |
| 74 | TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::U32, DataLayout::NHWC), // Unsupported data type |
| 75 | TensorInfo(TensorShape(8U, 32U, 13U), 1, DataType::S32, DataLayout::NHWC), // Unsupported data type |
| 76 | TensorInfo(TensorShape(32U, 13U, 8U), 1, DataType::F32, DataLayout::NCHW), // Unsupported data layout |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 77 | TensorInfo(TensorShape(8U, 32U, 13U, 4U), 1, DataType::F32, DataLayout::NHWC), |
Gunes Bayir | cc28773 | 2023-01-19 15:56:00 +0000 | [diff] [blame] | 78 | TensorInfo(TensorShape(8U, 32U, 13U, 4U), 1, DataType::F32, DataLayout::NHWC), // weight dimension > 3 |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 79 | TensorInfo(TensorShape(8U, 32U, 13U, 4U), 1, DataType::F32, DataLayout::NHWC), |
| 80 | TensorInfo(TensorShape(8U, 32U, 13U, 4U), 1, DataType::F32, DataLayout::NHWC), |
| 81 | TensorInfo(TensorShape(8U, 32U, 13U, 4U), 1, DataType::F32, DataLayout::NHWC), |
| 82 | }), |
| 83 | framework::dataset::make("WeightsInfo", { TensorInfo(TensorShape(2U, 3U, 3U, 2U), 1, DataType::F16, DataLayout::NHWC), |
| 84 | TensorInfo(TensorShape(2U, 3U, 3U, 2U), 1, DataType::F32, DataLayout::NHWC), |
| 85 | TensorInfo(TensorShape(2U, 3U, 3U, 2U), 1, DataType::F32, DataLayout::NHWC), |
| 86 | TensorInfo(TensorShape(2U, 3U, 3U, 2U), 1, DataType::F32, DataLayout::NHWC), |
| 87 | TensorInfo(TensorShape(2U, 3U, 3U, 2U), 1, DataType::F32, DataLayout::NHWC), |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 88 | TensorInfo(TensorShape(16U, 3U, 3U), 1, DataType::F32, DataLayout::NHWC), |
| 89 | TensorInfo(TensorShape(16U, 3U, 3U), 1, DataType::F32, DataLayout::NHWC), |
| 90 | TensorInfo(TensorShape(24U, 3U, 3U), 1, DataType::QASYMM8, DataLayout::NHWC), |
| 91 | TensorInfo(TensorShape(24U, 3U, 3U), 1, DataType::QASYMM8_SIGNED, DataLayout::NHWC), |
| 92 | TensorInfo(TensorShape(24U, 3U, 3U), 1, DataType::QSYMM16, DataLayout::NHWC), |
| 93 | TensorInfo(TensorShape(24U, 3U, 3U), 1, DataType::QSYMM8, DataLayout::NHWC), |
| 94 | TensorInfo(TensorShape(24U, 3U, 3U), 1, DataType::QSYMM8_PER_CHANNEL, DataLayout::NHWC), |
| 95 | TensorInfo(TensorShape(24U, 3U, 3U), 1, DataType::QASYMM16, DataLayout::NHWC), |
| 96 | TensorInfo(TensorShape(24U, 3U, 3U), 1, DataType::U8, DataLayout::NHWC), |
| 97 | TensorInfo(TensorShape(24U, 3U, 3U), 1, DataType::S8, DataLayout::NHWC), |
| 98 | TensorInfo(TensorShape(24U, 3U, 3U), 1, DataType::U16, DataLayout::NHWC), |
| 99 | TensorInfo(TensorShape(24U, 3U, 3U), 1, DataType::S16, DataLayout::NHWC), |
| 100 | TensorInfo(TensorShape(24U, 3U, 3U), 1, DataType::U32, DataLayout::NHWC), |
| 101 | TensorInfo(TensorShape(24U, 3U, 3U), 1, DataType::S32, DataLayout::NHWC), |
| 102 | TensorInfo(TensorShape(3U, 3U, 24U), 1, DataType::F32, DataLayout::NCHW), |
| 103 | TensorInfo(TensorShape(24U, 3U, 3U), 1, DataType::F32, DataLayout::NHWC), |
| 104 | TensorInfo(TensorShape(24U, 3U, 3U, 5U), 1, DataType::F32, DataLayout::NHWC), |
| 105 | TensorInfo(TensorShape(24U, 3U, 3U), 1, DataType::F32, DataLayout::NHWC), |
| 106 | TensorInfo(TensorShape(24U, 3U, 3U), 1, DataType::F32, DataLayout::NHWC), |
| 107 | TensorInfo(TensorShape(24U, 4U, 3U), 1, DataType::F32, DataLayout::NHWC), |
| 108 | })), |
| 109 | framework::dataset::make("BiasesInfo", { TensorInfo(TensorShape(2U), 1, DataType::F32, DataLayout::NHWC), |
| 110 | TensorInfo(TensorShape(2U), 1, DataType::F32, DataLayout::NHWC), |
| 111 | TensorInfo(TensorShape(2U), 1, DataType::F32, DataLayout::NHWC), |
| 112 | TensorInfo(TensorShape(4U), 1, DataType::F32, DataLayout::NHWC), |
| 113 | TensorInfo(TensorShape(2U, 2U), 1, DataType::F32, DataLayout::NHWC), |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 114 | TensorInfo(TensorShape(16U), 1, DataType::F32, DataLayout::NHWC), |
| 115 | TensorInfo(TensorShape(16U), 1, DataType::F32, DataLayout::NHWC), |
| 116 | TensorInfo(TensorShape(24U), 1, DataType::S32, DataLayout::NHWC), |
| 117 | TensorInfo(TensorShape(24U), 1, DataType::S32, DataLayout::NHWC), |
| 118 | TensorInfo(TensorShape(24U), 1, DataType::S32, DataLayout::NHWC), |
| 119 | TensorInfo(TensorShape(24U), 1, DataType::S32, DataLayout::NHWC), |
| 120 | TensorInfo(TensorShape(24U), 1, DataType::S32, DataLayout::NHWC), |
| 121 | TensorInfo(TensorShape(24U), 1, DataType::S32, DataLayout::NHWC), |
| 122 | TensorInfo(TensorShape(24U), 1, DataType::S32, DataLayout::NHWC), |
| 123 | TensorInfo(TensorShape(24U), 1, DataType::S32, DataLayout::NHWC), |
| 124 | TensorInfo(TensorShape(24U), 1, DataType::S32, DataLayout::NHWC), |
| 125 | TensorInfo(TensorShape(24U), 1, DataType::S32, DataLayout::NHWC), |
| 126 | TensorInfo(TensorShape(24U), 1, DataType::S32, DataLayout::NHWC), |
| 127 | TensorInfo(TensorShape(24U), 1, DataType::S32, DataLayout::NHWC), |
| 128 | TensorInfo(TensorShape(24U), 1, DataType::S32, DataLayout::NCHW), |
| 129 | TensorInfo(TensorShape(24U), 1, DataType::F32, DataLayout::NHWC), |
| 130 | TensorInfo(TensorShape(24U), 1, DataType::F32, DataLayout::NHWC), |
| 131 | TensorInfo(TensorShape(24U), 1, DataType::F32, DataLayout::NHWC), |
| 132 | TensorInfo(TensorShape(24U), 1, DataType::F32, DataLayout::NHWC), |
| 133 | TensorInfo(TensorShape(24U), 1, DataType::F32, DataLayout::NHWC), |
| 134 | })), |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 135 | framework::dataset::make("Padding", { Padding2D(0, 0, 0, 0), |
| 136 | Padding2D(0, 0, 0, 0), |
| 137 | Padding2D(0, 0, 0, 0), |
| 138 | Padding2D(0, 0, 0, 0), |
| 139 | Padding2D(0, 0, 0, 0), |
| 140 | Padding2D(0, 0, 0, 0), |
| 141 | Padding2D(0, 0, 0, 0), |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 142 | Padding2D(1, 1, 0, 0), |
| 143 | Padding2D(1, 1, 0, 0), |
| 144 | Padding2D(1, 1, 0, 0), |
| 145 | Padding2D(1, 1, 0, 0), |
| 146 | Padding2D(1, 1, 0, 0), |
| 147 | Padding2D(1, 1, 0, 0), |
| 148 | Padding2D(1, 1, 0, 0), |
| 149 | Padding2D(1, 1, 0, 0), |
| 150 | Padding2D(1, 1, 0, 0), |
| 151 | Padding2D(1, 1, 0, 0), |
| 152 | Padding2D(1, 1, 0, 0), |
| 153 | Padding2D(1, 1, 0, 0), |
| 154 | Padding2D(1, 1, 0, 0), |
| 155 | Padding2D(1, 1, 0, 0), |
| 156 | Padding2D(1, 1, 0, 0), |
| 157 | Padding2D(2, 1, 2, 1), |
| 158 | Padding2D(2, 1, 2, 1), |
| 159 | Padding2D(2, 1, 2, 1), |
| 160 | })), |
| 161 | framework::dataset::make("Stride", { Size2D(1, 1), |
| 162 | Size2D(1, 1), |
| 163 | Size2D(1, 1), |
| 164 | Size2D(1, 1), |
| 165 | Size2D(1, 1), |
| 166 | Size2D(1, 1), |
| 167 | Size2D(1, 1), |
| 168 | Size2D(1, 1), |
| 169 | Size2D(1, 1), |
| 170 | Size2D(1, 1), |
| 171 | Size2D(1, 1), |
| 172 | Size2D(1, 1), |
| 173 | Size2D(1, 1), |
| 174 | Size2D(1, 1), |
| 175 | Size2D(1, 1), |
| 176 | Size2D(1, 1), |
| 177 | Size2D(1, 1), |
| 178 | Size2D(1, 1), |
| 179 | Size2D(1, 1), |
| 180 | Size2D(1, 1), |
| 181 | Size2D(1, 1), |
| 182 | Size2D(1, 1), |
| 183 | Size2D(1, 1), |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 184 | Size2D(2, 3), |
| 185 | Size2D(2, 3), |
| 186 | })), |
| 187 | framework::dataset::make("DepthMultiplier", { 1, |
| 188 | 1, |
| 189 | 3, |
| 190 | 1, |
| 191 | 1, |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 192 | 2, |
| 193 | 2, |
| 194 | 3, |
| 195 | 3, |
| 196 | 3, |
| 197 | 3, |
| 198 | 3, |
| 199 | 3, |
| 200 | 3, |
| 201 | 3, |
| 202 | 3, |
| 203 | 3, |
| 204 | 3, |
| 205 | 3, |
| 206 | 3, |
| 207 | 3, |
| 208 | 3, |
| 209 | 3, |
| 210 | 3, |
| 211 | 3, |
| 212 | })), |
| 213 | framework::dataset::make("Dilation", { Size2D(1U, 1U), |
| 214 | Size2D(1U, 1U), |
| 215 | Size2D(1U, 1U), |
| 216 | Size2D(1U, 1U), |
| 217 | Size2D(1U, 1U), |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 218 | Size2D(0U, 1U), |
| 219 | Size2D(1U, 1U), |
| 220 | Size2D(1U, 1U), |
| 221 | Size2D(1U, 1U), |
| 222 | Size2D(1U, 1U), |
| 223 | Size2D(1U, 1U), |
| 224 | Size2D(1U, 1U), |
| 225 | Size2D(1U, 1U), |
| 226 | 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(1U, 1U), |
| 233 | Size2D(1U, 1U), |
| 234 | Size2D(1U, 1U), |
| 235 | Size2D(1U, 1U), |
| 236 | Size2D(1U, 1U), |
| 237 | Size2D(2U, 3U), |
| 238 | })), |
Gunes Bayir | cc28773 | 2023-01-19 15:56:00 +0000 | [diff] [blame] | 239 | framework::dataset::make("Expected", { false, false, false, false, false, false, true, false, |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 240 | false, false, false, false, false, false, false, false, false, false, |
| 241 | false, false, true, false, true, true, true })), |
Gunes Bayir | cc28773 | 2023-01-19 15:56:00 +0000 | [diff] [blame] | 242 | input_info, weights_info, biases_info, padding, stride, depth_multiplier, dilation, expected) |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 243 | { |
| 244 | CLCompileContext cl_compile_ctx = CLKernelLibrary::get().get_compile_context(); |
Viet-Hoa Do | 3fcf3dc | 2023-05-17 15:17:48 +0100 | [diff] [blame] | 245 | GpuWorkloadContext context = GpuWorkloadContext{ &cl_compile_ctx }; |
| 246 | GpuWorkloadSketch sketch{ &context }; |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 247 | |
Viet-Hoa Do | 3fcf3dc | 2023-05-17 15:17:48 +0100 | [diff] [blame] | 248 | const TensorInfo sketch_input_info = context.create_tensor_info(input_info); |
| 249 | const TensorInfo sketch_weights_info = context.create_tensor_info(weights_info); |
| 250 | const TensorInfo sketch_biases_info = context.create_tensor_info(biases_info); |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 251 | |
| 252 | DepthwiseConv2dAttributes attributes {}; |
| 253 | attributes.pad(padding) |
| 254 | .stride(stride) |
| 255 | .dilation(dilation) |
| 256 | .depth_multiplier(depth_multiplier); |
| 257 | |
Gunes Bayir | cc28773 | 2023-01-19 15:56:00 +0000 | [diff] [blame] | 258 | const Status status = GpuDepthwiseConv2d::validate_op(sketch, &sketch_input_info, &sketch_weights_info, &sketch_biases_info, attributes); |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 259 | const bool res = bool(status); |
| 260 | ARM_COMPUTE_EXPECT(res == expected, framework::LogLevel::ERRORS); |
| 261 | } |
| 262 | // clang-format on |
| 263 | // *INDENT-ON* |
| 264 | |
| 265 | template <typename T> |
| 266 | using DynamicFusionGpuDepthwiseConv2dFixture = DynamicFusionGpuDepthwiseConv2dValidationFixture<CLTensor, CLAccessor, GpuDepthwiseConv2d, T>; |
| 267 | |
| 268 | TEST_SUITE(Float) |
| 269 | TEST_SUITE(FP16) |
| 270 | TEST_SUITE(W3x3) |
| 271 | FIXTURE_DATA_TEST_CASE(RunSmall, DynamicFusionGpuDepthwiseConv2dFixture<half>, framework::DatasetMode::ALL, |
| 272 | combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), |
| 273 | depth_multipliers), |
| 274 | framework::dataset::make("DataType", DataType::F16)), |
| 275 | framework::dataset::make("DataLayout", DataLayout::NHWC))) |
| 276 | { |
| 277 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 278 | } |
| 279 | FIXTURE_DATA_TEST_CASE(RunLarge, DynamicFusionGpuDepthwiseConv2dFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
| 280 | large_depth_multipliers), |
| 281 | framework::dataset::make("DataType", DataType::F16)), |
| 282 | framework::dataset::make("DataLayout", DataLayout::NHWC))) |
| 283 | { |
| 284 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 285 | } |
ramy.elgammal@arm.com | a04ae3e | 2023-07-27 18:23:17 +0100 | [diff] [blame] | 286 | #ifndef ACL_INTERNAL_TEST_CKW_IN_DF // Do not include this test as dilation not supported yet in DepthwiseConv2d CKW kernel |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 287 | TEST_SUITE(Dilation) |
| 288 | FIXTURE_DATA_TEST_CASE(RunSmall, DynamicFusionGpuDepthwiseConv2dFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 289 | depth_multipliers), |
| 290 | framework::dataset::make("DataType", DataType::F16)), |
| 291 | framework::dataset::make("DataLayout", { DataLayout::NHWC }))) |
| 292 | { |
| 293 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 294 | } |
| 295 | FIXTURE_DATA_TEST_CASE(RunLarge, DynamicFusionGpuDepthwiseConv2dFixture<half>, framework::DatasetMode::NIGHTLY, |
| 296 | combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 297 | large_depth_multipliers), |
| 298 | framework::dataset::make("DataType", DataType::F16)), |
| 299 | framework::dataset::make("DataLayout", { DataLayout::NHWC }))) |
| 300 | { |
| 301 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 302 | } |
| 303 | TEST_SUITE_END() // Dilation |
ramy.elgammal@arm.com | a04ae3e | 2023-07-27 18:23:17 +0100 | [diff] [blame] | 304 | #endif // ACL_INTERNAL_TEST_CKW_IN_DF |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 305 | TEST_SUITE_END() // W3x3 |
| 306 | |
| 307 | TEST_SUITE(Generic) |
| 308 | FIXTURE_DATA_TEST_CASE(RunSmall, DynamicFusionGpuDepthwiseConv2dFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
| 309 | depth_multipliers), |
| 310 | framework::dataset::make("DataType", DataType::F16)), |
| 311 | framework::dataset::make("DataLayout", { DataLayout::NHWC }))) |
| 312 | { |
| 313 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
| 314 | } |
| 315 | FIXTURE_DATA_TEST_CASE(RunLarge, DynamicFusionGpuDepthwiseConv2dFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(), |
| 316 | large_depth_multipliers), |
| 317 | framework::dataset::make("DataType", DataType::F16)), |
| 318 | framework::dataset::make("DataLayout", { DataLayout::NHWC }))) |
| 319 | { |
| 320 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
| 321 | } |
ramy.elgammal@arm.com | a04ae3e | 2023-07-27 18:23:17 +0100 | [diff] [blame] | 322 | #ifndef ACL_INTERNAL_TEST_CKW_IN_DF // Do not include this test as dilation not supported yet in DepthwiseConv2d CKW kernel |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 323 | TEST_SUITE(Dilation) |
| 324 | FIXTURE_DATA_TEST_CASE(RunSmall, DynamicFusionGpuDepthwiseConv2dFixture<half>, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
| 325 | depth_multipliers), |
| 326 | framework::dataset::make("DataType", DataType::F16)), |
| 327 | framework::dataset::make("DataLayout", { DataLayout::NHWC }))) |
| 328 | { |
| 329 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
| 330 | } |
| 331 | FIXTURE_DATA_TEST_CASE(RunLarge, DynamicFusionGpuDepthwiseConv2dFixture<half>, framework::DatasetMode::NIGHTLY, |
| 332 | combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset(), |
| 333 | large_depth_multipliers), |
| 334 | framework::dataset::make("DataType", DataType::F16)), |
| 335 | framework::dataset::make("DataLayout", { DataLayout::NHWC }))) |
| 336 | { |
| 337 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num); |
| 338 | } |
| 339 | TEST_SUITE_END() // Dilation |
ramy.elgammal@arm.com | a04ae3e | 2023-07-27 18:23:17 +0100 | [diff] [blame] | 340 | #endif // ACL_INTERNAL_TEST_CKW_IN_DF |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 341 | TEST_SUITE_END() // Generic |
| 342 | TEST_SUITE_END() // FP16 |
| 343 | |
| 344 | TEST_SUITE(FP32) |
| 345 | TEST_SUITE(W3x3) |
| 346 | FIXTURE_DATA_TEST_CASE(RunSmall, DynamicFusionGpuDepthwiseConv2dFixture<float>, framework::DatasetMode::ALL, |
| 347 | combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset3x3(), |
| 348 | depth_multipliers), |
| 349 | framework::dataset::make("DataType", DataType::F32)), |
| 350 | framework::dataset::make("DataLayout", DataLayout::NHWC))) |
| 351 | { |
| 352 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 353 | } |
| 354 | FIXTURE_DATA_TEST_CASE(RunLarge, DynamicFusionGpuDepthwiseConv2dFixture<float>, framework::DatasetMode::NIGHTLY, |
| 355 | combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset3x3(), |
| 356 | large_depth_multipliers), |
| 357 | framework::dataset::make("DataType", DataType::F32)), |
| 358 | framework::dataset::make("DataLayout", DataLayout::NHWC))) |
| 359 | { |
| 360 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 361 | } |
| 362 | |
ramy.elgammal@arm.com | a04ae3e | 2023-07-27 18:23:17 +0100 | [diff] [blame] | 363 | #ifndef ACL_INTERNAL_TEST_CKW_IN_DF // Do not include this test as dilation not supported yet in DepthwiseConv2d CKW kernel |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 364 | TEST_SUITE(Dilation) |
| 365 | |
| 366 | FIXTURE_DATA_TEST_CASE(RunSmall, DynamicFusionGpuDepthwiseConv2dFixture<float>, framework::DatasetMode::ALL, |
| 367 | combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 368 | depth_multipliers), |
| 369 | framework::dataset::make("DataType", DataType::F32)), |
| 370 | framework::dataset::make("DataLayout", DataLayout::NHWC))) |
| 371 | { |
| 372 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 373 | } |
| 374 | FIXTURE_DATA_TEST_CASE(RunLarge, DynamicFusionGpuDepthwiseConv2dFixture<float>, framework::DatasetMode::NIGHTLY, |
| 375 | combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 376 | large_depth_multipliers), |
| 377 | framework::dataset::make("DataType", DataType::F32)), |
| 378 | framework::dataset::make("DataLayout", DataLayout::NHWC))) |
| 379 | { |
| 380 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 381 | } |
| 382 | TEST_SUITE_END() // Dilation |
ramy.elgammal@arm.com | a04ae3e | 2023-07-27 18:23:17 +0100 | [diff] [blame] | 383 | #endif // ACL_INTERNAL_TEST_CKW_IN_DF |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 384 | TEST_SUITE_END() // W3x3 |
| 385 | |
| 386 | TEST_SUITE(Generic) |
| 387 | FIXTURE_DATA_TEST_CASE(RunSmall, DynamicFusionGpuDepthwiseConv2dFixture<float>, framework::DatasetMode::ALL, |
| 388 | combine(combine(combine(datasets::SmallDepthwiseConvolutionLayerDataset(), |
| 389 | depth_multipliers), |
| 390 | framework::dataset::make("DataType", DataType::F32)), |
| 391 | framework::dataset::make("DataLayout", { DataLayout::NHWC }))) |
| 392 | { |
| 393 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 394 | } |
| 395 | |
| 396 | FIXTURE_DATA_TEST_CASE(RunLarge, DynamicFusionGpuDepthwiseConv2dFixture<float>, framework::DatasetMode::NIGHTLY, |
| 397 | combine(combine(combine(datasets::LargeDepthwiseConvolutionLayerDataset(), |
| 398 | large_depth_multipliers), |
| 399 | framework::dataset::make("DataType", DataType::F32)), |
| 400 | framework::dataset::make("DataLayout", { DataLayout::NHWC }))) |
| 401 | { |
| 402 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 403 | } |
| 404 | |
| 405 | FIXTURE_DATA_TEST_CASE(RunLargeKernelSize, DynamicFusionGpuDepthwiseConv2dFixture<float>, framework::DatasetMode::ALL, |
| 406 | combine(combine(combine(datasets::LargeKernelSizeDepthwiseConvolutionLayerNHWCDataset(), |
| 407 | framework::dataset::make("DepthMultiplier", { 1 })), |
| 408 | framework::dataset::make("DataType", DataType::F32)), |
| 409 | framework::dataset::make("DataLayout", { DataLayout::NHWC }))) |
| 410 | { |
| 411 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 412 | } |
| 413 | |
ramy.elgammal@arm.com | a04ae3e | 2023-07-27 18:23:17 +0100 | [diff] [blame] | 414 | #ifndef ACL_INTERNAL_TEST_CKW_IN_DF // Do not include this test as dilation not supported yet in DepthwiseConv2d CKW kernel |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 415 | TEST_SUITE(Dilation) |
| 416 | FIXTURE_DATA_TEST_CASE(RunSmall, DynamicFusionGpuDepthwiseConv2dFixture<float>, framework::DatasetMode::ALL, combine(combine(combine(datasets::SmallDepthwiseDilatedConvolutionLayerDataset(), |
| 417 | depth_multipliers), |
| 418 | framework::dataset::make("DataType", DataType::F32)), |
| 419 | framework::dataset::make("DataLayout", { DataLayout::NHWC }))) |
| 420 | { |
| 421 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 422 | } |
| 423 | FIXTURE_DATA_TEST_CASE(RunLarge, DynamicFusionGpuDepthwiseConv2dFixture<float>, framework::DatasetMode::NIGHTLY, |
| 424 | combine(combine(combine(datasets::LargeDepthwiseDilatedConvolutionLayerDataset3x3(), |
| 425 | large_depth_multipliers), |
| 426 | framework::dataset::make("DataType", DataType::F32)), |
| 427 | framework::dataset::make("DataLayout", { DataLayout::NHWC }))) |
| 428 | { |
| 429 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 430 | } |
| 431 | TEST_SUITE_END() // Dilation |
ramy.elgammal@arm.com | a04ae3e | 2023-07-27 18:23:17 +0100 | [diff] [blame] | 432 | #endif // ACL_INTERNAL_TEST_CKW_IN_DF |
Gunes Bayir | 7dc0234 | 2022-11-21 21:46:50 +0000 | [diff] [blame] | 433 | TEST_SUITE_END() // Generic |
| 434 | TEST_SUITE_END() // FP32 |
| 435 | TEST_SUITE_END() // Float |
| 436 | TEST_SUITE_END() // DEPTHWISE_CONV2D |
| 437 | TEST_SUITE_END() // DYNAMIC_FUSION |
| 438 | TEST_SUITE_END() // CL |
| 439 | } // namespace validation |
| 440 | } // namespace test |
| 441 | } // namespace arm_compute |