Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 1 | /* |
Gian Marco Iodice | bc6c374 | 2020-10-19 12:49:44 +0100 | [diff] [blame^] | 2 | * Copyright (c) 2018-2020 Arm Limited. |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +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, |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 22 | * SOFTWARE. |
| 23 | */ |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 24 | #include "arm_compute/core/CL/kernels/CLWinogradFilterTransformKernel.h" |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 25 | #include "arm_compute/core/CL/kernels/CLWinogradOutputTransformKernel.h" |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 26 | #include "arm_compute/core/Helpers.h" |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 27 | #include "arm_compute/core/Types.h" |
| 28 | #include "arm_compute/core/utils/misc/ShapeCalculator.h" |
| 29 | #include "arm_compute/runtime/CL/CLTensor.h" |
| 30 | #include "arm_compute/runtime/CL/CLTensorAllocator.h" |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 31 | #include "arm_compute/runtime/CL/functions/CLWinogradConvolutionLayer.h" |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 32 | #include "arm_compute/runtime/CL/functions/CLWinogradInputTransform.h" |
| 33 | #include "tests/CL/CLAccessor.h" |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 34 | #include "tests/CL/Helper.h" |
| 35 | #include "tests/PaddingCalculator.h" |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 36 | #include "tests/datasets/LargeConvolutionLayerDataset.h" |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 37 | #include "tests/datasets/ShapeDatasets.h" |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 38 | #include "tests/datasets/SmallConvolutionLayerDataset.h" |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 39 | #include "tests/datasets/WinogradInputTransformDataset.h" |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 40 | #include "tests/datasets/WinogradOutputTransformDataset.h" |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 41 | #include "tests/framework/Asserts.h" |
| 42 | #include "tests/framework/Macros.h" |
| 43 | #include "tests/framework/datasets/Datasets.h" |
| 44 | #include "tests/validation/Validation.h" |
Georgios Pinitas | 9fb1159 | 2018-04-26 20:34:58 +0100 | [diff] [blame] | 45 | #include "tests/validation/fixtures/WinogradConvolutionLayerFixture.h" |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 46 | |
| 47 | namespace arm_compute |
| 48 | { |
| 49 | namespace test |
| 50 | { |
| 51 | namespace validation |
| 52 | { |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 53 | namespace |
| 54 | { |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 55 | // *INDENT-OFF* |
| 56 | // clang-format off |
Michele Di Giorgio | 875a751 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 57 | constexpr AbsoluteTolerance<float> tolerance_f32(0.002f); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 58 | const AbsoluteTolerance<half> tolerance_f16(half(0.5f)); |
Gian Marco Iodice | 4497e81 | 2018-05-08 16:36:52 +0100 | [diff] [blame] | 59 | constexpr AbsoluteTolerance<float> tolerance_convolution_layer_f32(0.1f); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 60 | const AbsoluteTolerance<half> tolerance_convolution_layer_f16(half(0.4f)); |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 61 | RelativeTolerance<half_float::half> rel_tolerance_f16(half(0.2)); /**< Tolerance value for comparing reference's output against implementation's output for FP16 data types */ |
| 62 | constexpr float tolerance_num = 0.05f; /**< Tolerance number */ |
| 63 | constexpr float abs_tolerance_convolution_layer_f16 = 2.5f; /**< Tolerance number */ |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 64 | constexpr float tolerance_num_f16 = 0.15f; /**< Tolerance number */ |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 65 | |
| 66 | // Input transform |
| 67 | const auto SmallWinogradInputTransformDatasetNCHW = |
| 68 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset2x2_3x3(), |
| 69 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset2x1_3x1(), |
| 70 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset1x2_1x3(), |
| 71 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x4_3x3(), |
| 72 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x1_3x1(), |
| 73 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset1x4_1x3(), |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 74 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x4_5x5(), |
| 75 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x1_5x1(), |
| 76 | datasets::SmallWinogradInputTransformDataset1x4_1x5())))))))); |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 77 | |
| 78 | const auto SmallWinogradInputTransformDatasetNHWC = framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x4_3x3(), |
Giorgio Arena | 149fdf3 | 2018-07-04 17:03:33 +0100 | [diff] [blame] | 79 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x1_3x1(), |
| 80 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset1x4_1x3(), |
Gian Marco Iodice | d28b751 | 2018-07-06 12:59:28 +0100 | [diff] [blame] | 81 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x4_5x5(), |
| 82 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset4x1_5x1(), |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 83 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset1x4_1x5(), |
| 84 | framework::dataset::concat(datasets::SmallWinogradInputTransformDataset2x1_7x1(), |
| 85 | datasets::SmallWinogradInputTransformDataset1x2_1x7()))))))); |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 86 | |
Michele Di Giorgio | f955d51 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 87 | const auto SmallWinogradInputTransformDatasetNHWC_FP32 = framework::dataset::concat(SmallWinogradInputTransformDatasetNHWC, |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 88 | datasets::SmallWinogradInputTransformDataset2x2_7x7()); |
Michele Di Giorgio | f955d51 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 89 | |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 90 | const auto LargeWinogradInputTransformDatasetNCHW = |
| 91 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset2x2_3x3(), |
| 92 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset2x1_3x1(), |
| 93 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset1x2_1x3(), |
| 94 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x4_3x3(), |
| 95 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x1_3x1(), |
| 96 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset1x4_1x3(), |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 97 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x4_5x5(), |
| 98 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x1_5x1(), |
Georgios Pinitas | 0c81684 | 2019-12-20 15:07:43 +0000 | [diff] [blame] | 99 | datasets::LargeWinogradInputTransformDataset1x4_1x5())))))))); |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 100 | |
| 101 | const auto LargeWinogradInputTransformDatasetNHWC = |
| 102 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x4_3x3(), |
Gian Marco Iodice | d28b751 | 2018-07-06 12:59:28 +0100 | [diff] [blame] | 103 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x4_5x5(), |
| 104 | framework::dataset::concat(datasets::LargeWinogradInputTransformDataset4x1_5x1(), |
| 105 | datasets::LargeWinogradInputTransformDataset1x4_1x5()))); |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 106 | |
Michele Di Giorgio | f955d51 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 107 | const auto LargeWinogradInputTransformDatasetNHWC_FP32 = |
| 108 | framework::dataset::concat(LargeWinogradInputTransformDatasetNHWC, |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 109 | (datasets::LargeWinogradInputTransformDataset2x2_7x7())); |
Michele Di Giorgio | f955d51 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 110 | |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 111 | // Filter transform |
| 112 | const auto SmallWinogradFilterTransformDatasetNCHW = |
| 113 | framework::dataset::concat(combine(datasets::Small3x3Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 2U), Size2D(4U, 4U) })), |
| 114 | framework::dataset::concat(combine(datasets::Small3x1Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 1U), Size2D(4U, 1U) })), |
| 115 | framework::dataset::concat(combine(datasets::Small1x3Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 2U), Size2D(1U, 4U) })), |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 116 | framework::dataset::concat(combine(datasets::Small5x5Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })), |
| 117 | framework::dataset::concat(combine(datasets::Small5x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })), |
| 118 | combine(datasets::Small1x5Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) }))))))); |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 119 | |
Michele Di Giorgio | 881c684 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 120 | const auto SmallWinogradFilterTransformDatasetNHWC_F16 = |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 121 | framework::dataset::concat(combine(datasets::Small3x3Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })), |
Giorgio Arena | 149fdf3 | 2018-07-04 17:03:33 +0100 | [diff] [blame] | 122 | framework::dataset::concat(combine(datasets::Small3x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })), |
| 123 | framework::dataset::concat(combine(datasets::Small1x3Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) })), |
Gian Marco Iodice | d28b751 | 2018-07-06 12:59:28 +0100 | [diff] [blame] | 124 | framework::dataset::concat(combine(datasets::Small5x5Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })), |
| 125 | framework::dataset::concat(combine(datasets::Small5x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })), |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 126 | framework::dataset::concat(combine(datasets::Small1x5Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) })), |
| 127 | framework::dataset::concat(combine(datasets::Small1x7Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 2U) })), |
| 128 | combine(datasets::Small7x1Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 1U) }))))))))); |
Michele Di Giorgio | f955d51 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 129 | |
Michele Di Giorgio | 881c684 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 130 | const auto SmallWinogradFilterTransformDatasetNHWC_F32 = |
| 131 | framework::dataset::concat(SmallWinogradFilterTransformDatasetNHWC_F16, |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 132 | combine(datasets::Small7x7Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 2U) }))); |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 133 | |
| 134 | const auto LargeWinogradFilterTransformDatasetNCHW = |
| 135 | framework::dataset::concat(combine(datasets::Large3x3Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 2U), Size2D(4U, 4U) })), |
| 136 | framework::dataset::concat(combine(datasets::Large3x1Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 1U), Size2D(4U, 1U) })), |
| 137 | framework::dataset::concat(combine(datasets::Large1x3Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 2U), Size2D(1U, 4U) })), |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 138 | framework::dataset::concat(combine(datasets::Large5x5Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })), |
| 139 | framework::dataset::concat(combine(datasets::Large5x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })), |
| 140 | combine(datasets::Large1x5Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) }))))))); |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 141 | |
Michele Di Giorgio | 881c684 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 142 | const auto LargeWinogradFilterTransformDatasetNHWC_F16 = |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 143 | framework::dataset::concat(combine(datasets::Large3x3Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })), |
Gian Marco Iodice | d28b751 | 2018-07-06 12:59:28 +0100 | [diff] [blame] | 144 | framework::dataset::concat(combine(datasets::Large3x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })), |
| 145 | framework::dataset::concat(combine(datasets::Large1x3Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) })), |
| 146 | framework::dataset::concat(combine(datasets::Large5x5Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 4U) })), |
| 147 | framework::dataset::concat(combine(datasets::Large5x1Shapes(), framework::dataset::make("OutputTile", { Size2D(4U, 1U) })), |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 148 | framework::dataset::concat(combine(datasets::Large1x5Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 4U) })), |
| 149 | framework::dataset::concat(combine(datasets::Large7x1Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 1U) })), |
| 150 | combine(datasets::Large1x7Shapes(), framework::dataset::make("OutputTile", { Size2D(1U, 2U) }))))))))); |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 151 | |
Michele Di Giorgio | 881c684 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 152 | const auto LargeWinogradFilterTransformDatasetNHWC_F32 = |
| 153 | framework::dataset::concat(LargeWinogradFilterTransformDatasetNHWC_F16, |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 154 | combine(datasets::Large7x7Shapes(), framework::dataset::make("OutputTile", { Size2D(2U, 2U) }))); |
Michele Di Giorgio | 881c684 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 155 | |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 156 | // Output transform |
| 157 | const auto SmallWinogradOutputTransformDatasetNCHW = datasets::SmallWinogradOutputTransformDatasetNCHW(); |
| 158 | |
giuros01 | 3bfacb2 | 2019-04-01 12:07:02 +0100 | [diff] [blame] | 159 | const auto SmallWinogradOutputTransformDatasetNHWC_F16 = datasets::SmallWinogradOutputTransformDatasetNHWC_F16(); |
| 160 | |
| 161 | const auto SmallWinogradOutputTransformDatasetNHWC_F32 = datasets::SmallWinogradOutputTransformDatasetNHWC_F32(); |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 162 | |
| 163 | const auto LargeWinogradOutputTransformDatasetNCHW = datasets::LargeWinogradOutputTransformDatasetNCHW(); |
| 164 | |
giuros01 | 3bfacb2 | 2019-04-01 12:07:02 +0100 | [diff] [blame] | 165 | const auto LargeWinogradOutputTransformDatasetNHWC_F16 = datasets::LargeWinogradOutputTransformDatasetNHWC_F16(); |
| 166 | |
| 167 | const auto LargeWinogradOutputTransformDatasetNHWC_F32 = datasets::LargeWinogradOutputTransformDatasetNHWC_F32(); |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 168 | |
| 169 | //Activation Functions |
| 170 | const auto ActivationFunctionsDataset = framework::dataset::make("ActivationInfo", |
| 171 | { |
| 172 | ActivationLayerInfo(), |
| 173 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), |
| 174 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU), |
| 175 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU), |
Georgios Pinitas | 9d6a31c | 2019-02-25 14:33:25 +0000 | [diff] [blame] | 176 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LEAKY_RELU) |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 177 | }); |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 178 | const auto ActivationFunctionsSmallDataset = framework::dataset::make("ActivationInfo", |
| 179 | { |
| 180 | ActivationLayerInfo(), |
| 181 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU), |
Georgios Pinitas | 9d6a31c | 2019-02-25 14:33:25 +0000 | [diff] [blame] | 182 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LEAKY_RELU), |
| 183 | ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::SOFT_RELU) |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 184 | }); |
Gian Marco Iodice | bc6c374 | 2020-10-19 12:49:44 +0100 | [diff] [blame^] | 185 | |
| 186 | /** Zero padding test */ |
| 187 | bool validate_zero_padding(unsigned int width, unsigned height) |
| 188 | { |
| 189 | TensorShape shape(width, height, 11, 1); |
| 190 | |
| 191 | WinogradInfo winograd_info = WinogradInfo(Size2D(4U, 4U), Size2D(5U, 5U), Size2D(width, height), PadStrideInfo(), DataLayout::NHWC); |
| 192 | |
| 193 | // Create tensors |
| 194 | CLTensor src = create_tensor<CLTensor>(shape, DataType::F32, 1, QuantizationInfo(), DataLayout::NHWC); |
| 195 | CLTensor dst; |
| 196 | |
| 197 | src.info()->set_quantization_info(QuantizationInfo(1.f / 256.f, 0)); |
| 198 | dst.info()->set_quantization_info(QuantizationInfo(1.f / 256.f, 0)); |
| 199 | |
| 200 | CLWinogradInputTransform input_transform; |
| 201 | |
| 202 | input_transform.configure(&src, &dst, winograd_info); |
| 203 | |
| 204 | // Padding can be added along rhs and bias's X dimension |
| 205 | return src.info()->padding().empty() && dst.info()->padding().empty(); |
| 206 | } |
| 207 | |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 208 | } // namespace |
| 209 | |
| 210 | using namespace arm_compute::misc::shape_calculator; |
| 211 | |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 212 | TEST_SUITE(CL) |
| 213 | TEST_SUITE(Winograd) |
| 214 | |
| 215 | TEST_SUITE(InputTransform) |
Gian Marco Iodice | bc6c374 | 2020-10-19 12:49:44 +0100 | [diff] [blame^] | 216 | |
| 217 | /** Validate zero padding tests |
| 218 | * |
| 219 | * A series of validation tests to check that no padding is added |
| 220 | */ |
| 221 | DATA_TEST_CASE(ValidateZeroPadding, framework::DatasetMode::ALL, zip( |
| 222 | framework::dataset::make("Width", { 32U, 37U, 12U, 1U }), |
| 223 | framework::dataset::make("Height", { 13U, 27U, 19U, 1U })), |
| 224 | width, height) |
| 225 | { |
| 226 | bool status = validate_zero_padding(width, height); |
| 227 | ARM_COMPUTE_EXPECT(status, framework::LogLevel::ERRORS); |
| 228 | } |
| 229 | |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 230 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 231 | framework::dataset::make("InputInfo",{ |
| 232 | TensorInfo(TensorShape(53U, 21U, 5U, 3U), 1, DataType::F16), // F16 not supported |
| 233 | TensorInfo(TensorShape(53U, 21U, 5U, 3U), 1, DataType::QASYMM8), // QASYMM8 not supported |
| 234 | TensorInfo(TensorShape(53U, 21U, 5U, 3U), 1, DataType::F32), // Kernel size not supported |
| 235 | TensorInfo(TensorShape(53U, 21U, 5U, 3U), 1, DataType::F32), // Strides not supported |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 236 | TensorInfo(TensorShape(53U, 33U, 4U), 1, DataType::F32), // Padding needed |
| 237 | TensorInfo(TensorShape(34U, 42U, 7U, 3U), 1, DataType::F32), // Padding needed |
| 238 | TensorInfo(TensorShape(31U, 37U, 37U), 1, DataType::F32) // Padding needed |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 239 | }), |
| 240 | framework::dataset::make("OutputInfo", { |
| 241 | TensorInfo(TensorShape(5U, 5U, 16U, 3U), 1, DataType::F16), |
| 242 | TensorInfo(TensorShape(5U, 5U, 16U, 3U), 1, DataType::QASYMM8), |
| 243 | TensorInfo(TensorShape(5U, 5U, 16U, 3U), 1, DataType::F32), |
| 244 | TensorInfo(TensorShape(5U, 1U, 16U, 3U), 1, DataType::F32), |
| 245 | TensorInfo(TensorShape(4U, 442U, 16U), 1, DataType::F32), |
| 246 | TensorInfo(TensorShape(7U, 320U, 16U, 3U), 1, DataType::F32), |
| 247 | TensorInfo(TensorShape(37U, 304U, 16U), 1, DataType::F32) |
| 248 | })), |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 249 | framework::dataset::make("WinogradInfo", { |
| 250 | WinogradInfo(Size2D(2, 2), Size2D(3, 3), Size2D(53U, 21U), PadStrideInfo(1, 1, 1, 0), DataLayout::NCHW), |
| 251 | WinogradInfo(Size2D(2, 2), Size2D(3, 3), Size2D(53U, 21U), PadStrideInfo(1, 1, 0, 0), DataLayout::NCHW), |
| 252 | WinogradInfo(Size2D(2, 2), Size2D(3, 3), Size2D(53U, 21U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), |
| 253 | WinogradInfo(Size2D(2, 2), Size2D(3, 3), Size2D(53U, 21U), PadStrideInfo(2, 1, 1, 1), DataLayout::NCHW), |
| 254 | WinogradInfo(Size2D(2, 2), Size2D(3, 3), Size2D(53U, 33U), PadStrideInfo(1, 1, 0, 1), DataLayout::NCHW), |
| 255 | WinogradInfo(Size2D(2, 2), Size2D(3, 3), Size2D(34U, 42U), PadStrideInfo(1, 1, 0, 0), DataLayout::NCHW), |
| 256 | WinogradInfo(Size2D(2, 2), Size2D(3, 3), Size2D(31U, 37U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW) |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 257 | })), |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 258 | framework::dataset::make("Expected", { false, false, false, false, false, false, false })), |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 259 | input_info, output_info, winograd_info, expected) |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 260 | { |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 261 | ARM_COMPUTE_EXPECT(bool(CLWinogradInputTransform::validate(&input_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), winograd_info)) == expected, framework::LogLevel::ERRORS); |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 262 | } |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 263 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 264 | using CLWinogradInputTransformFixtureFP32 = WinogradInputTransformValidationFixture<CLTensor, CLAccessor, CLWinogradInputTransform, float>; |
| 265 | using CLWinogradInputTransformFixtureFP16 = WinogradInputTransformValidationFixture<CLTensor, CLAccessor, CLWinogradInputTransform, half>; |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 266 | |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 267 | TEST_SUITE(NCHW) |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 268 | TEST_SUITE(FP32) |
| 269 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradInputTransformFixtureFP32, framework::DatasetMode::PRECOMMIT, combine(combine(SmallWinogradInputTransformDatasetNCHW, |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 270 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 271 | framework::dataset::make("DataType", { DataType::F32 }))) |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 272 | { |
Giorgio Arena | fe5ef38 | 2018-04-17 10:14:10 +0100 | [diff] [blame] | 273 | validate(CLAccessor(_target), _reference, tolerance_f32); |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 274 | } |
| 275 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 276 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradInputTransformFixtureFP32, framework::DatasetMode::NIGHTLY, combine(combine(LargeWinogradInputTransformDatasetNCHW, |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 277 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 278 | framework::dataset::make("DataType", { DataType::F32 }))) |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 279 | { |
Giorgio Arena | fe5ef38 | 2018-04-17 10:14:10 +0100 | [diff] [blame] | 280 | validate(CLAccessor(_target), _reference, tolerance_f32); |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 281 | } |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 282 | TEST_SUITE_END() // FP32 |
| 283 | |
| 284 | TEST_SUITE(FP16) |
| 285 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradInputTransformFixtureFP16, framework::DatasetMode::PRECOMMIT, combine(combine(SmallWinogradInputTransformDatasetNCHW, |
| 286 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 287 | framework::dataset::make("DataType", { DataType::F16 }))) |
| 288 | { |
| 289 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 290 | } |
| 291 | |
| 292 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradInputTransformFixtureFP16, framework::DatasetMode::NIGHTLY, combine(combine(LargeWinogradInputTransformDatasetNCHW, |
| 293 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 294 | framework::dataset::make("DataType", { DataType::F16 }))) |
| 295 | { |
| 296 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 297 | } |
| 298 | TEST_SUITE_END() // FP16 |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 299 | TEST_SUITE_END() // NCHW |
| 300 | |
| 301 | TEST_SUITE(NHWC) |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 302 | TEST_SUITE(FP16) |
| 303 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradInputTransformFixtureFP16, framework::DatasetMode::PRECOMMIT, combine(combine(SmallWinogradInputTransformDatasetNHWC, |
| 304 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
| 305 | framework::dataset::make("DataType", { DataType::F16 }))) |
| 306 | { |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 307 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 308 | } |
| 309 | |
| 310 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradInputTransformFixtureFP16, framework::DatasetMode::NIGHTLY, combine(combine(LargeWinogradInputTransformDatasetNHWC, |
| 311 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
| 312 | framework::dataset::make("DataType", { DataType::F16 }))) |
| 313 | { |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 314 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 315 | } |
| 316 | TEST_SUITE_END() // FP16 |
| 317 | TEST_SUITE(FP32) |
Michele Di Giorgio | f955d51 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 318 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradInputTransformFixtureFP32, framework::DatasetMode::PRECOMMIT, combine(combine(SmallWinogradInputTransformDatasetNHWC_FP32, |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 319 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
| 320 | framework::dataset::make("DataType", { DataType::F32 }))) |
| 321 | { |
| 322 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 323 | } |
| 324 | |
Michele Di Giorgio | f955d51 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 325 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradInputTransformFixtureFP32, framework::DatasetMode::NIGHTLY, combine(combine(LargeWinogradInputTransformDatasetNHWC_FP32, |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 326 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
| 327 | framework::dataset::make("DataType", { DataType::F32 }))) |
| 328 | { |
| 329 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 330 | } |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 331 | TEST_SUITE_END() // FP32 |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 332 | TEST_SUITE_END() // NHWC |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 333 | TEST_SUITE_END() // InputTransform |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 334 | |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 335 | TEST_SUITE(FilterTransform) |
Giorgio Arena | 2d9de0a | 2018-03-15 17:58:20 +0000 | [diff] [blame] | 336 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip( |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 337 | framework::dataset::make("InputInfo",{ |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 338 | TensorInfo(TensorShape(3U, 3U, 5U, 3U), 1, DataType::F16), // F16 supported |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 339 | TensorInfo(TensorShape(3U, 3U, 5U, 3U), 1, DataType::QASYMM8), // QASYMM8 not supported |
| 340 | TensorInfo(TensorShape(5U, 5U, 5U, 3U), 1, DataType::F32), // Kernel size not supported |
Giorgio Arena | 2d9de0a | 2018-03-15 17:58:20 +0000 | [diff] [blame] | 341 | TensorInfo(TensorShape(3U, 3U), 1, DataType::F32), // Output tile not supported |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 342 | TensorInfo(TensorShape(3U, 3U, 5U, 3U), 1, DataType::F32), // valid |
| 343 | TensorInfo(TensorShape(3U, 3U, 37U, 2U), 1, DataType::F32), // valid |
| 344 | TensorInfo(TensorShape(3U, 3U, 37U, 22U), 1, DataType::F32) // valid |
| 345 | }), |
| 346 | framework::dataset::make("OutputInfo", { |
| 347 | TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::F16), |
| 348 | TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::QASYMM8), |
| 349 | TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::F32), |
| 350 | TensorInfo(TensorShape(1U, 1U, 16U), 1, DataType::F32), |
| 351 | TensorInfo(TensorShape(3U, 5U, 16U), 1, DataType::F32), |
| 352 | TensorInfo(TensorShape(2U, 37U, 16U), 1, DataType::F32), |
Giorgio Arena | 2d9de0a | 2018-03-15 17:58:20 +0000 | [diff] [blame] | 353 | TensorInfo(TensorShape(22U, 37U, 36U), 1, DataType::F32) |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 354 | })), |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 355 | framework::dataset::make("WinogradInfo", { |
| 356 | WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D() /* Not needed */, PadStrideInfo() /* Not needed */, DataLayout::NCHW /* Not needed */ ), |
| 357 | WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D() /* Not needed */, PadStrideInfo() /* Not needed */, DataLayout::NCHW /* Not needed */ ), |
| 358 | WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D() /* Not needed */, PadStrideInfo() /* Not needed */, DataLayout::NCHW /* Not needed */ ), |
| 359 | WinogradInfo(Size2D(3U, 3U), Size2D(3U, 3U), Size2D() /* Not needed */, PadStrideInfo() /* Not needed */, DataLayout::NCHW /* Not needed */ ), |
| 360 | WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D() /* Not needed */, PadStrideInfo() /* Not needed */, DataLayout::NCHW /* Not needed */ ), |
| 361 | WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D() /* Not needed */, PadStrideInfo() /* Not needed */, DataLayout::NCHW /* Not needed */ ), |
| 362 | WinogradInfo(Size2D(4U, 4U), Size2D(3U, 3U), Size2D() /* Not needed */, PadStrideInfo() /* Not needed */, DataLayout::NCHW /* Not needed */ ) |
| 363 | })), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 364 | framework::dataset::make("Expected", { true, false, false, false, true, true, true })), |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 365 | input_info, output_info, winograd_info, expected) |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 366 | { |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 367 | ARM_COMPUTE_EXPECT(bool(CLWinogradFilterTransformKernel::validate(&input_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), winograd_info)) == expected, framework::LogLevel::ERRORS); |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 368 | } |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 369 | |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 370 | using CLWinogradFilterTransform = CLSynthetizeFunctionWithZeroConstantBorder<CLWinogradFilterTransformKernel, 0>; |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 371 | using CLWinogradFilterTransformFixtureFP32 = WinogradFilterTransformValidationFixture<CLTensor, CLAccessor, CLWinogradFilterTransform, float>; |
| 372 | using CLWinogradFilterTransformFixtureFP16 = WinogradFilterTransformValidationFixture<CLTensor, CLAccessor, CLWinogradFilterTransform, half>; |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 373 | |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 374 | TEST_SUITE(NCHW) |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 375 | TEST_SUITE(FP32) |
| 376 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradFilterTransformFixtureFP32, framework::DatasetMode::PRECOMMIT, |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 377 | combine(combine(SmallWinogradFilterTransformDatasetNCHW, |
| 378 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 379 | framework::dataset::make("DataType", { DataType::F32 }))) |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 380 | { |
| 381 | // Validate output |
| 382 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 383 | } |
| 384 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 385 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradFilterTransformFixtureFP32, framework::DatasetMode::NIGHTLY, |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 386 | combine(combine(LargeWinogradFilterTransformDatasetNCHW, |
| 387 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 388 | framework::dataset::make("DataType", { DataType::F32 }))) |
| 389 | { |
| 390 | // Validate output |
| 391 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 392 | } |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 393 | TEST_SUITE_END() // FP32 |
| 394 | TEST_SUITE(FP16) |
| 395 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradFilterTransformFixtureFP16, framework::DatasetMode::PRECOMMIT, |
| 396 | combine(combine(SmallWinogradFilterTransformDatasetNCHW, |
| 397 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 398 | framework::dataset::make("DataType", { DataType::F16 }))) |
| 399 | { |
| 400 | // Validate output |
| 401 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 402 | } |
| 403 | |
| 404 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradFilterTransformFixtureFP16, framework::DatasetMode::NIGHTLY, |
| 405 | combine(combine(LargeWinogradFilterTransformDatasetNCHW, |
| 406 | framework::dataset::make("DataLayout", { DataLayout::NCHW })), |
| 407 | framework::dataset::make("DataType", { DataType::F16 }))) |
| 408 | { |
| 409 | // Validate output |
| 410 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 411 | } |
| 412 | TEST_SUITE_END() // FP16 |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 413 | TEST_SUITE_END() // NCHW |
| 414 | |
| 415 | TEST_SUITE(NHWC) |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 416 | TEST_SUITE(FP16) |
| 417 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradFilterTransformFixtureFP16, framework::DatasetMode::PRECOMMIT, |
Michele Di Giorgio | 881c684 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 418 | combine(combine(SmallWinogradFilterTransformDatasetNHWC_F16, |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 419 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
| 420 | framework::dataset::make("DataType", { DataType::F16 }))) |
| 421 | { |
| 422 | // Validate output |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 423 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 424 | } |
| 425 | |
| 426 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradFilterTransformFixtureFP16, framework::DatasetMode::NIGHTLY, |
Michele Di Giorgio | 881c684 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 427 | combine(combine(LargeWinogradFilterTransformDatasetNHWC_F16, |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 428 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
| 429 | framework::dataset::make("DataType", { DataType::F16 }))) |
| 430 | { |
| 431 | // Validate output |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 432 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 433 | } |
| 434 | TEST_SUITE_END() // FP16 |
| 435 | TEST_SUITE(FP32) |
| 436 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradFilterTransformFixtureFP32, framework::DatasetMode::PRECOMMIT, |
Michele Di Giorgio | 881c684 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 437 | combine(combine(SmallWinogradFilterTransformDatasetNHWC_F32, |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 438 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
| 439 | framework::dataset::make("DataType", { DataType::F32 }))) |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 440 | { |
| 441 | // Validate output |
| 442 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 443 | } |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 444 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 445 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradFilterTransformFixtureFP32, framework::DatasetMode::NIGHTLY, |
Michele Di Giorgio | 881c684 | 2019-02-27 14:26:51 +0000 | [diff] [blame] | 446 | combine(combine(LargeWinogradFilterTransformDatasetNHWC_F32, |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 447 | framework::dataset::make("DataLayout", { DataLayout::NHWC })), |
| 448 | framework::dataset::make("DataType", { DataType::F32 }))) |
| 449 | { |
| 450 | // Validate output |
| 451 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 452 | } |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 453 | TEST_SUITE_END() // FP32 |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 454 | TEST_SUITE_END() // NHWC |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 455 | TEST_SUITE_END() // FilterTransform |
| 456 | |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 457 | TEST_SUITE(OutputTransform) |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 458 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip( |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 459 | framework::dataset::make("InputInfo",{ |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 460 | TensorInfo(TensorShape(512U, 49U, 16U, 5U), 1, DataType::F16), // F16 supported |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 461 | TensorInfo(TensorShape(512U, 49U, 16U, 5U), 1, DataType::QASYMM8), // QASYMM8 not supported |
| 462 | TensorInfo(TensorShape(512U, 49U, 16U, 5U), 1, DataType::F32), // Kernel size not supported |
| 463 | TensorInfo(TensorShape(512U, 49U, 16U, 5U), 1, DataType::F32), // Valid |
| 464 | TensorInfo(TensorShape(13U, 108U, 16U, 4U), 1, DataType::F32), // Padding needed |
| 465 | TensorInfo(TensorShape(7U, 20U, 16U, 7U), 1, DataType::F32), // Valid |
Gian Marco Iodice | e52a300 | 2018-04-11 15:59:10 +0100 | [diff] [blame] | 466 | TensorInfo(TensorShape(7U, 20U, 16U, 7U), 1, DataType::F32), // Wrong WinogradInfo |
| 467 | TensorInfo(TensorShape(7U, 256U, 36U, 3U), 1, DataType::F32), // Valid |
| 468 | TensorInfo(TensorShape(7U, 256U, 16U, 3U), 1, DataType::F32) // Wrong number of batches |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 469 | }), |
| 470 | framework::dataset::make("BiasInfo", { |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 471 | TensorInfo(TensorShape(512U), 1, DataType::F16), |
| 472 | TensorInfo(TensorShape(512U), 1, DataType::QASYMM8), |
| 473 | TensorInfo(TensorShape(512U), 1, DataType::F32), |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 474 | TensorInfo(TensorShape(512U), 1, DataType::F32), |
| 475 | TensorInfo(TensorShape(13U), 1, DataType::F32), |
| 476 | TensorInfo(TensorShape(7U), 1, DataType::F32), |
Gian Marco Iodice | e52a300 | 2018-04-11 15:59:10 +0100 | [diff] [blame] | 477 | TensorInfo(TensorShape(7U), 1, DataType::F32), |
| 478 | TensorInfo(TensorShape(7U), 1, DataType::F32), |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 479 | TensorInfo(TensorShape(7U), 1, DataType::F32) |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 480 | })), |
| 481 | framework::dataset::make("OutputInfo", { |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 482 | TensorInfo(TensorShape(14U, 14U, 512U, 5U), 1, DataType::F16), |
| 483 | TensorInfo(TensorShape(14U, 14U, 512U, 5U), 1, DataType::QASYMM8), |
| 484 | TensorInfo(TensorShape(14U, 14U, 512U, 5U), 1, DataType::F32), |
| 485 | TensorInfo(TensorShape(14U, 14U, 512U, 5U), 1, DataType::F32), |
| 486 | TensorInfo(TensorShape(17U, 23U, 13U, 4U), 1, DataType::F32), |
| 487 | TensorInfo(TensorShape(8U, 10U, 7U, 7U), 1, DataType::F32), |
Gian Marco Iodice | e52a300 | 2018-04-11 15:59:10 +0100 | [diff] [blame] | 488 | TensorInfo(TensorShape(7U, 9U, 7U, 7U), 1, DataType::F32), |
| 489 | TensorInfo(TensorShape(64U, 64U, 7U, 3U), 1, DataType::F32), |
| 490 | TensorInfo(TensorShape(64U, 64U, 7U, 3U), 1, DataType::F32) |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 491 | })), |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 492 | framework::dataset::make("WinogradInfo", { |
| 493 | WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(14U, 14U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), |
| 494 | WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(14U, 14U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), |
| 495 | WinogradInfo(Size2D(2U, 2U), Size2D(5U, 5U), Size2D(14U, 14U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), |
| 496 | WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(14U, 14U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), |
| 497 | WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(17U, 23U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), |
| 498 | WinogradInfo(Size2D(2U, 2U), Size2D(3U, 3U), Size2D(8U, 10U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), |
| 499 | WinogradInfo(Size2D(2U, 3U), Size2D(3U, 3U), Size2D(8U, 10U), PadStrideInfo(1, 1, 0, 0), DataLayout::NCHW), |
Gian Marco Iodice | e52a300 | 2018-04-11 15:59:10 +0100 | [diff] [blame] | 500 | WinogradInfo(Size2D(4U, 4U), Size2D(3U, 3U), Size2D(64U, 64U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW), |
| 501 | WinogradInfo(Size2D(4U, 4U), Size2D(3U, 3U), Size2D(64U, 64U), PadStrideInfo(1, 1, 1, 1), DataLayout::NCHW) |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 502 | })), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 503 | framework::dataset::make("Expected", { true, false, false, true, false, true, false, true, false })), |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 504 | input_info, bias_info, output_info, winograd_info, expected) |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 505 | { |
Gian Marco Iodice | 247f52c | 2018-03-22 11:24:56 +0000 | [diff] [blame] | 506 | ARM_COMPUTE_EXPECT(bool(CLWinogradOutputTransformKernel::validate(&input_info.clone()->set_is_resizable(false), &bias_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), winograd_info)) == expected, framework::LogLevel::ERRORS); |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 507 | } |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 508 | |
| 509 | using CLWinogradOutputTransform = CLSynthetizeFunctionWithZeroConstantBorder<CLWinogradOutputTransformKernel, 0>; |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 510 | using CLWinogradOutputTransformFixtureFP32 = WinogradOutputTransformValidationFixture<CLTensor, CLAccessor, CLWinogradOutputTransform, float>; |
| 511 | using CLWinogradOutputTransformFixtureFP16 = WinogradOutputTransformValidationFixture<CLTensor, CLAccessor, CLWinogradOutputTransform, half>; |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 512 | |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 513 | TEST_SUITE(NCHW) |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 514 | TEST_SUITE(FP16) |
| 515 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradOutputTransformFixtureFP16, framework::DatasetMode::ALL, |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 516 | combine(combine(SmallWinogradOutputTransformDatasetNCHW, |
| 517 | framework::dataset::make("DataType", { DataType::F16 })), |
| 518 | framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 519 | { |
| 520 | // Validate output |
| 521 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 522 | } |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 523 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 524 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradOutputTransformFixtureFP16, framework::DatasetMode::NIGHTLY, |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 525 | combine(combine(LargeWinogradOutputTransformDatasetNCHW, |
| 526 | framework::dataset::make("DataType", { DataType::F16 })), |
| 527 | framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 528 | { |
| 529 | // Validate output |
| 530 | validate(CLAccessor(_target), _reference, tolerance_f16); |
| 531 | } |
| 532 | TEST_SUITE_END() // FP16 |
| 533 | TEST_SUITE(FP32) |
| 534 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradOutputTransformFixtureFP32, framework::DatasetMode::ALL, |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 535 | combine(combine(SmallWinogradOutputTransformDatasetNCHW, |
| 536 | framework::dataset::make("DataType", { DataType::F32 })), |
| 537 | framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 538 | { |
| 539 | // Validate output |
| 540 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 541 | } |
| 542 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 543 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradOutputTransformFixtureFP32, framework::DatasetMode::NIGHTLY, |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 544 | combine(combine(LargeWinogradOutputTransformDatasetNCHW, |
| 545 | framework::dataset::make("DataType", { DataType::F32 })), |
| 546 | framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 547 | { |
| 548 | // Validate output |
| 549 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 550 | } |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 551 | TEST_SUITE_END() // FP32 |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 552 | TEST_SUITE_END() // NCHW |
| 553 | |
| 554 | TEST_SUITE(NHWC) |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 555 | TEST_SUITE(FP16) |
| 556 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradOutputTransformFixtureFP16, framework::DatasetMode::ALL, |
giuros01 | 3bfacb2 | 2019-04-01 12:07:02 +0100 | [diff] [blame] | 557 | combine(combine(SmallWinogradOutputTransformDatasetNHWC_F16, |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 558 | framework::dataset::make("DataType", { DataType::F16 })), |
| 559 | framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 560 | { |
| 561 | // Validate output |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 562 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 563 | } |
| 564 | |
| 565 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradOutputTransformFixtureFP16, framework::DatasetMode::NIGHTLY, |
giuros01 | 3bfacb2 | 2019-04-01 12:07:02 +0100 | [diff] [blame] | 566 | combine(combine(LargeWinogradOutputTransformDatasetNHWC_F16, |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 567 | framework::dataset::make("DataType", { DataType::F16 })), |
| 568 | framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 569 | { |
| 570 | // Validate output |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 571 | validate(CLAccessor(_target), _reference, tolerance_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 572 | } |
| 573 | TEST_SUITE_END() // FP16 |
| 574 | TEST_SUITE(FP32) |
| 575 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradOutputTransformFixtureFP32, framework::DatasetMode::ALL, |
giuros01 | 3bfacb2 | 2019-04-01 12:07:02 +0100 | [diff] [blame] | 576 | combine(combine(SmallWinogradOutputTransformDatasetNHWC_F32, |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 577 | framework::dataset::make("DataType", { DataType::F32 })), |
| 578 | framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 579 | { |
| 580 | // Validate output |
| 581 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 582 | } |
| 583 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 584 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradOutputTransformFixtureFP32, framework::DatasetMode::NIGHTLY, |
giuros01 | 3bfacb2 | 2019-04-01 12:07:02 +0100 | [diff] [blame] | 585 | combine(combine(LargeWinogradOutputTransformDatasetNHWC_F32, |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 586 | framework::dataset::make("DataType", { DataType::F32 })), |
| 587 | framework::dataset::make("ActivationInfo",{ ActivationLayerInfo() }) )) |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 588 | { |
| 589 | // Validate output |
| 590 | validate(CLAccessor(_target), _reference, tolerance_f32); |
| 591 | } |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 592 | TEST_SUITE_END() // FP32 |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 593 | TEST_SUITE_END() // NHWC |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 594 | TEST_SUITE_END() // OutputTransform |
| 595 | |
| 596 | TEST_SUITE(ConvolutionLayer) |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 597 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip( |
| 598 | framework::dataset::make("InputInfo", { |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 599 | TensorInfo(TensorShape(17U, 31U, 2U), 1, DataType::F16), // Insufficient padding |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 600 | TensorInfo(TensorShape(17U, 31U, 2U), 1, DataType::F32), // Datatype mismatch |
| 601 | TensorInfo(TensorShape(23U, 27U, 5U, 4U), 1, DataType::F32), // Stride y not supported |
| 602 | TensorInfo(TensorShape(16U, 16U, 8U), 1, DataType::F32), // Padding needed |
| 603 | TensorInfo(TensorShape(33U, 27U, 7U, 4U), 1, DataType::F32) // Kernel size not supported |
| 604 | }), |
| 605 | framework::dataset::make("WeightsInfo", { |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 606 | TensorInfo(TensorShape(3U, 3U, 2U, 19U), 1, DataType::F16), |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 607 | TensorInfo(TensorShape(3U, 3U, 2U, 19U), 1, DataType::QASYMM8), |
| 608 | TensorInfo(TensorShape(3U, 3U, 5U, 21U), 1, DataType::F32), |
| 609 | TensorInfo(TensorShape(3U, 3U, 8U, 16U), 1, DataType::F32), |
| 610 | TensorInfo(TensorShape(5U, 5U, 7U, 16U), 1, DataType::F16) |
| 611 | })), |
| 612 | framework::dataset::make("BiasesInfo", { |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 613 | TensorInfo(TensorShape(19U), 1, DataType::F16), |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 614 | TensorInfo(TensorShape(19U), 1, DataType::F32), |
| 615 | TensorInfo(TensorShape(21U), 1, DataType::F32), |
| 616 | TensorInfo(TensorShape(16U), 1, DataType::F32), |
| 617 | TensorInfo(TensorShape(16U), 1, DataType::F32) |
| 618 | })), |
| 619 | framework::dataset::make("OutputInfo", { |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 620 | TensorInfo(TensorShape(17U, 31U, 19U), 1, DataType::F16), |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 621 | TensorInfo(TensorShape(15U, 15U, 19U), 1, DataType::F32), |
| 622 | TensorInfo(TensorShape(21U, 25U, 21U, 4U), 1, DataType::F32), |
| 623 | TensorInfo(TensorShape(16U, 16U, 16U), 1, DataType::F32), |
| 624 | TensorInfo(TensorShape(11U, 12U, 16U, 4U), 1, DataType::F32) |
| 625 | })), |
| 626 | framework::dataset::make("ConvInfo", { |
| 627 | PadStrideInfo(1, 1, 1, 1), |
| 628 | PadStrideInfo(1, 1, 1, 1), |
| 629 | PadStrideInfo(1, 2, 0, 0), |
| 630 | PadStrideInfo(1, 1, 1, 1), |
| 631 | PadStrideInfo(1, 1, 1, 0) |
| 632 | })), |
| 633 | framework::dataset::make("Expected", { false, false, false, false, false })), |
| 634 | input_info, weights_info, bias_info, output_info, conv_info, expected) |
| 635 | { |
| 636 | ARM_COMPUTE_EXPECT(bool(CLWinogradConvolutionLayer::validate(&input_info.clone()->set_is_resizable(false), &weights_info.clone()->set_is_resizable(false), &bias_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false), conv_info)) == expected, framework::LogLevel::ERRORS); |
| 637 | } |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 638 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 639 | TEST_SUITE(FP32) |
Gian Marco Iodice | 2213d4b | 2018-04-27 10:39:06 +0100 | [diff] [blame] | 640 | using CLWinogradConvolutionLayerFastMathFixture = WinogradConvolutionLayerFastMathValidationFixture<CLTensor, CLAccessor, CLWinogradConvolutionLayer, float>; |
Gian Marco Iodice | 6cf188c | 2018-05-04 16:36:50 +0100 | [diff] [blame] | 641 | TEST_SUITE(Conv3x3) |
Gian Marco Iodice | 2213d4b | 2018-04-27 10:39:06 +0100 | [diff] [blame] | 642 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::PRECOMMIT, |
Pablo Tello | 7282d56 | 2018-06-14 15:35:49 +0100 | [diff] [blame] | 643 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer3x3Dataset(), |
| 644 | framework::dataset::make("DataType", { DataType::F32 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 645 | ActivationFunctionsSmallDataset), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 646 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Gian Marco Iodice | 2213d4b | 2018-04-27 10:39:06 +0100 | [diff] [blame] | 647 | { |
| 648 | // Validate output |
Gian Marco Iodice | 4497e81 | 2018-05-08 16:36:52 +0100 | [diff] [blame] | 649 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
Gian Marco Iodice | 2213d4b | 2018-04-27 10:39:06 +0100 | [diff] [blame] | 650 | } |
| 651 | |
| 652 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::NIGHTLY, |
Pablo Tello | 7282d56 | 2018-06-14 15:35:49 +0100 | [diff] [blame] | 653 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer3x3Dataset(), |
| 654 | framework::dataset::make("DataType", { DataType::F32 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 655 | ActivationFunctionsDataset), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 656 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Gian Marco Iodice | 2213d4b | 2018-04-27 10:39:06 +0100 | [diff] [blame] | 657 | { |
| 658 | // Validate output |
Gian Marco Iodice | 4497e81 | 2018-05-08 16:36:52 +0100 | [diff] [blame] | 659 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
Gian Marco Iodice | 2213d4b | 2018-04-27 10:39:06 +0100 | [diff] [blame] | 660 | } |
Gian Marco Iodice | 6cf188c | 2018-05-04 16:36:50 +0100 | [diff] [blame] | 661 | TEST_SUITE_END() // Conv3x3 |
| 662 | |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 663 | TEST_SUITE(Conv3x1) |
| 664 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::PRECOMMIT, |
| 665 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer3x1Dataset(), |
| 666 | framework::dataset::make("DataType", { DataType::F32 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 667 | ActivationFunctionsSmallDataset), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 668 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 669 | { |
| 670 | // Validate output |
| 671 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
| 672 | } |
| 673 | |
| 674 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::NIGHTLY, |
| 675 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer3x1Dataset(), |
| 676 | framework::dataset::make("DataType", { DataType::F32 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 677 | ActivationFunctionsDataset), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 678 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 679 | { |
| 680 | // Validate output |
| 681 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
| 682 | } |
| 683 | TEST_SUITE_END() // Conv3x1 |
| 684 | |
| 685 | TEST_SUITE(Conv1x3) |
| 686 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::PRECOMMIT, |
| 687 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer1x3Dataset(), |
| 688 | framework::dataset::make("DataType", { DataType::F32 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 689 | ActivationFunctionsSmallDataset), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 690 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 691 | { |
| 692 | // Validate output |
| 693 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
| 694 | } |
| 695 | |
| 696 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::NIGHTLY, |
| 697 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer1x3Dataset(), |
| 698 | framework::dataset::make("DataType", { DataType::F32 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 699 | ActivationFunctionsDataset), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 700 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Gian Marco Iodice | f1c2bf0 | 2018-06-13 14:05:54 +0100 | [diff] [blame] | 701 | { |
| 702 | // Validate output |
| 703 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
| 704 | } |
| 705 | TEST_SUITE_END() // Conv1x3 |
| 706 | |
Gian Marco Iodice | 6cf188c | 2018-05-04 16:36:50 +0100 | [diff] [blame] | 707 | TEST_SUITE(Conv5x5) |
| 708 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::PRECOMMIT, |
Pablo Tello | 7282d56 | 2018-06-14 15:35:49 +0100 | [diff] [blame] | 709 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer5x5Dataset(), |
| 710 | framework::dataset::make("DataType", { DataType::F32 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 711 | ActivationFunctionsSmallDataset ), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 712 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Pablo Tello | 7282d56 | 2018-06-14 15:35:49 +0100 | [diff] [blame] | 713 | |
Gian Marco Iodice | 6cf188c | 2018-05-04 16:36:50 +0100 | [diff] [blame] | 714 | { |
| 715 | // Validate output |
Gian Marco Iodice | 4497e81 | 2018-05-08 16:36:52 +0100 | [diff] [blame] | 716 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
Gian Marco Iodice | 6cf188c | 2018-05-04 16:36:50 +0100 | [diff] [blame] | 717 | } |
| 718 | |
| 719 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::NIGHTLY, |
Pablo Tello | 7282d56 | 2018-06-14 15:35:49 +0100 | [diff] [blame] | 720 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer5x5Dataset(), |
| 721 | framework::dataset::make("DataType", { DataType::F32 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 722 | ActivationFunctionsDataset ), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 723 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Pablo Tello | 7282d56 | 2018-06-14 15:35:49 +0100 | [diff] [blame] | 724 | |
Gian Marco Iodice | 6cf188c | 2018-05-04 16:36:50 +0100 | [diff] [blame] | 725 | { |
| 726 | // Validate output |
Gian Marco Iodice | 4497e81 | 2018-05-08 16:36:52 +0100 | [diff] [blame] | 727 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
Gian Marco Iodice | 6cf188c | 2018-05-04 16:36:50 +0100 | [diff] [blame] | 728 | } |
| 729 | TEST_SUITE_END() // Conv5x5 |
Gian Marco Iodice | 2213d4b | 2018-04-27 10:39:06 +0100 | [diff] [blame] | 730 | |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 731 | TEST_SUITE(Conv5x1) |
| 732 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::PRECOMMIT, |
| 733 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer5x1Dataset(), |
| 734 | framework::dataset::make("DataType", { DataType::F32 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 735 | ActivationFunctionsSmallDataset), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 736 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 737 | |
| 738 | { |
| 739 | // Validate output |
| 740 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
| 741 | } |
| 742 | |
| 743 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::NIGHTLY, |
| 744 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer5x1Dataset(), |
| 745 | framework::dataset::make("DataType", { DataType::F32 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 746 | ActivationFunctionsDataset), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 747 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 748 | |
| 749 | { |
| 750 | // Validate output |
| 751 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
| 752 | } |
| 753 | TEST_SUITE_END() // Conv5x1 |
| 754 | |
| 755 | TEST_SUITE(Conv1x5) |
| 756 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::PRECOMMIT, |
| 757 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer1x5Dataset(), |
| 758 | framework::dataset::make("DataType", { DataType::F32 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 759 | ActivationFunctionsSmallDataset), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 760 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 761 | |
| 762 | { |
| 763 | // Validate output |
| 764 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
| 765 | } |
| 766 | |
| 767 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture, framework::DatasetMode::NIGHTLY, |
| 768 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer1x5Dataset(), |
| 769 | framework::dataset::make("DataType", { DataType::F32 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 770 | ActivationFunctionsDataset), |
Giorgio Arena | ea55f91 | 2018-07-12 15:41:35 +0100 | [diff] [blame] | 771 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
Gian Marco Iodice | 876be2a | 2018-07-03 12:22:09 +0100 | [diff] [blame] | 772 | |
| 773 | { |
| 774 | // Validate output |
| 775 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f32); |
| 776 | } |
| 777 | TEST_SUITE_END() // Conv1x5 |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 778 | TEST_SUITE_END() // FP32 |
| 779 | |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 780 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 781 | TEST_SUITE(FP16) |
| 782 | |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 783 | using CLWinogradConvolutionLayerFastMathFixture16 = WinogradConvolutionLayerFastMathValidationFixture<CLTensor, CLAccessor, CLWinogradConvolutionLayer, half, float>; |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 784 | TEST_SUITE(Conv3x3) |
| 785 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::PRECOMMIT, |
| 786 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer3x3Dataset(), |
| 787 | framework::dataset::make("DataType", { DataType::F16 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 788 | ActivationFunctionsSmallDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 789 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 790 | { |
| 791 | // Validate output |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 792 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 793 | } |
| 794 | |
| 795 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::NIGHTLY, |
| 796 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer3x3Dataset(), |
| 797 | framework::dataset::make("DataType", { DataType::F16 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 798 | ActivationFunctionsDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 799 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 800 | { |
| 801 | // Validate output |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 802 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 803 | } |
| 804 | TEST_SUITE_END() // Conv3x3 |
| 805 | |
| 806 | TEST_SUITE(Conv3x1) |
| 807 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::PRECOMMIT, |
| 808 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer3x1Dataset(), |
| 809 | framework::dataset::make("DataType", { DataType::F16 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 810 | ActivationFunctionsSmallDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 811 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 812 | { |
| 813 | // Validate output |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 814 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 815 | } |
| 816 | |
| 817 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::NIGHTLY, |
| 818 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer3x1Dataset(), |
| 819 | framework::dataset::make("DataType", { DataType::F16 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 820 | ActivationFunctionsDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 821 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 822 | { |
| 823 | // Validate output |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 824 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 825 | } |
| 826 | TEST_SUITE_END() // Conv3x1 |
| 827 | |
| 828 | TEST_SUITE(Conv1x3) |
| 829 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::PRECOMMIT, |
| 830 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer1x3Dataset(), |
| 831 | framework::dataset::make("DataType", { DataType::F16 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 832 | ActivationFunctionsSmallDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 833 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 834 | { |
| 835 | // Validate output |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 836 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 837 | } |
| 838 | |
| 839 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::NIGHTLY, |
| 840 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer1x3Dataset(), |
| 841 | framework::dataset::make("DataType", { DataType::F16 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 842 | ActivationFunctionsDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 843 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 844 | { |
| 845 | // Validate output |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 846 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 847 | } |
| 848 | TEST_SUITE_END() // Conv1x3 |
| 849 | |
| 850 | TEST_SUITE(Conv5x5) |
| 851 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::PRECOMMIT, |
| 852 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer5x5Dataset(), |
| 853 | framework::dataset::make("DataType", { DataType::F16 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 854 | ActivationFunctionsSmallDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 855 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 856 | |
| 857 | { |
| 858 | // Validate output |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 859 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 860 | } |
| 861 | |
| 862 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::NIGHTLY, |
| 863 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer5x5Dataset(), |
| 864 | framework::dataset::make("DataType", { DataType::F16 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 865 | ActivationFunctionsDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 866 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 867 | |
| 868 | { |
| 869 | // Validate output |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 870 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 871 | } |
| 872 | TEST_SUITE_END() // Conv5x5 |
| 873 | |
| 874 | TEST_SUITE(Conv5x1) |
| 875 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::PRECOMMIT, |
| 876 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer5x1Dataset(), |
| 877 | framework::dataset::make("DataType", { DataType::F16 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 878 | ActivationFunctionsSmallDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 879 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 880 | |
| 881 | { |
| 882 | // Validate output |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 883 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 884 | } |
| 885 | |
| 886 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::NIGHTLY, |
| 887 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer5x1Dataset(), |
| 888 | framework::dataset::make("DataType", { DataType::F16 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 889 | ActivationFunctionsDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 890 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 891 | |
| 892 | { |
| 893 | // Validate output |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 894 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 895 | } |
| 896 | TEST_SUITE_END() // Conv5x1 |
| 897 | |
| 898 | TEST_SUITE(Conv1x5) |
| 899 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::PRECOMMIT, |
| 900 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer1x5Dataset(), |
| 901 | framework::dataset::make("DataType", { DataType::F16 })), |
Michalis Spyrou | 8094325 | 2019-01-10 17:19:50 +0000 | [diff] [blame] | 902 | ActivationFunctionsSmallDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 903 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 904 | |
| 905 | { |
| 906 | // Validate output |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 907 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16, tolerance_num_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 908 | } |
| 909 | |
| 910 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::NIGHTLY, |
| 911 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer1x5Dataset(), |
| 912 | framework::dataset::make("DataType", { DataType::F16 })), |
Manuel Bottini | 0d0028c | 2018-10-02 16:41:52 +0100 | [diff] [blame] | 913 | ActivationFunctionsDataset), |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 914 | framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) |
| 915 | |
| 916 | { |
| 917 | // Validate output |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 918 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16); |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 919 | } |
| 920 | TEST_SUITE_END() // Conv1x5 |
| 921 | |
Pablo Tello | f1cf394 | 2019-09-19 16:39:04 +0100 | [diff] [blame] | 922 | TEST_SUITE(Conv1x7) |
| 923 | FIXTURE_DATA_TEST_CASE(RunSmall, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::PRECOMMIT, |
| 924 | combine(combine(combine(datasets::SmallWinogradConvolutionLayer1x7Dataset(), |
| 925 | framework::dataset::make("DataType", { DataType::F16 })), |
| 926 | ActivationFunctionsSmallDataset), |
| 927 | framework::dataset::make("DataLayout", { DataLayout::NHWC }))) |
| 928 | |
| 929 | { |
| 930 | // Validate output |
| 931 | validate(CLAccessor(_target), _reference, tolerance_convolution_layer_f16, tolerance_num_f16); |
| 932 | } |
| 933 | |
| 934 | FIXTURE_DATA_TEST_CASE(RunLarge, CLWinogradConvolutionLayerFastMathFixture16, framework::DatasetMode::NIGHTLY, |
| 935 | combine(combine(combine(datasets::LargeWinogradConvolutionLayer1x7Dataset(), |
| 936 | framework::dataset::make("DataType", { DataType::F16 })), |
| 937 | ActivationFunctionsDataset), |
| 938 | framework::dataset::make("DataLayout", { DataLayout::NHWC }))) |
| 939 | |
| 940 | { |
| 941 | // Validate output |
| 942 | validate(CLAccessor(_target), _reference, rel_tolerance_f16, tolerance_num, abs_tolerance_convolution_layer_f16); |
| 943 | } |
| 944 | TEST_SUITE_END() // Conv1x7 |
| 945 | |
Vidhya Sudhan Loganathan | 71ecf39 | 2018-08-31 16:10:16 +0100 | [diff] [blame] | 946 | TEST_SUITE_END() // FP16 |
Vidhya Sudhan Loganathan | a25d16c | 2018-11-16 11:33:12 +0000 | [diff] [blame] | 947 | |
Gian Marco Iodice | d2fab73 | 2018-03-02 11:18:12 +0000 | [diff] [blame] | 948 | TEST_SUITE_END() // ConvolutionLayer |
Gian Marco Iodice | 7e4b239 | 2018-02-22 16:17:20 +0000 | [diff] [blame] | 949 | TEST_SUITE_END() // Winograd |
| 950 | TEST_SUITE_END() // CL |
Giorgio Arena | 1f9ca1d | 2018-03-01 11:13:45 +0000 | [diff] [blame] | 951 | } // namespace validation |
| 952 | } // namespace test |
| 953 | } // namespace arm_compute |