Mohammed Suhail Munshi | a1b1e41 | 2023-03-23 22:21:31 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2023 Arm Limited. |
| 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 | #include "arm_compute/core/Types.h" |
| 25 | #include "arm_compute/runtime/NEON/functions/NEMatMul.h" |
| 26 | |
| 27 | #include "tests/NEON/Accessor.h" |
| 28 | #include "tests/framework/Asserts.h" |
| 29 | #include "tests/framework/Macros.h" |
| 30 | #include "tests/framework/datasets/Datasets.h" |
| 31 | #include "tests/validation/Validation.h" |
| 32 | |
| 33 | #include "tests/datasets/LargeMatMulDataset.h" |
| 34 | #include "tests/datasets/SmallMatMulDataset.h" |
| 35 | #include "tests/validation/fixtures/MatMulFixture.h" |
| 36 | |
| 37 | namespace arm_compute |
| 38 | { |
| 39 | namespace test |
| 40 | { |
| 41 | namespace validation |
| 42 | { |
| 43 | TEST_SUITE(NEON) |
| 44 | TEST_SUITE(MatMul) |
| 45 | |
Viet-Hoa Do | 9c7c2d2 | 2023-04-11 17:16:27 +0100 | [diff] [blame] | 46 | constexpr AbsoluteTolerance<float> tolerance_fp32(0.001f); /**< Tolerance value for comparing reference's output against implementation's output for FP32 data types */ |
| 47 | const AbsoluteTolerance<half> tolerance_fp16(half(0.1f)); |
Ramy Elgammal | af15076 | 2023-04-25 17:19:27 +0100 | [diff] [blame^] | 48 | #ifdef __aarch64__ |
Viet-Hoa Do | 9c7c2d2 | 2023-04-11 17:16:27 +0100 | [diff] [blame] | 49 | constexpr AbsoluteTolerance<uint8_t> tolerance_qasymm8(0); |
| 50 | constexpr AbsoluteTolerance<uint8_t> tolerance_qasymm8_signed(0); |
Ramy Elgammal | af15076 | 2023-04-25 17:19:27 +0100 | [diff] [blame^] | 51 | #endif // __aarch64__ |
Mohammed Suhail Munshi | a1b1e41 | 2023-03-23 22:21:31 +0000 | [diff] [blame] | 52 | |
| 53 | // clang-format off |
| 54 | // *INDENT-OFF* |
| 55 | // Validation Tests |
| 56 | DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip( |
| 57 | framework::dataset::make("InputAInfo", { TensorInfo(TensorShape(9U, 6U), 1, DataType::F32), // Mismatching datatype |
| 58 | TensorInfo(TensorShape(9U, 6U), 1, DataType::S32), // Unsupported datatypes |
| 59 | TensorInfo(TensorShape(9U, 6U, 2U), 1, DataType::F32), // Broadcasting in batch dimension not supported |
| 60 | TensorInfo(TensorShape(9U, 6U), 1, DataType::F32), // Invalid shape for multiplication |
| 61 | TensorInfo(TensorShape(9U, 6U), 1, DataType::F32), |
| 62 | TensorInfo(TensorShape(9U, 6U , 12U) , 1 , DataType::F32), |
| 63 | TensorInfo(TensorShape(9U, 6U , 12U) , 1 , DataType::F32), // Tensors are not dynamic |
Viet-Hoa Do | 9c7c2d2 | 2023-04-11 17:16:27 +0100 | [diff] [blame] | 64 | TensorInfo(TensorShape(9U, 6U), 1, DataType::QASYMM8), |
| 65 | TensorInfo(TensorShape(9U, 6U), 1, DataType::QASYMM8_SIGNED), |
| 66 | TensorInfo(TensorShape(9U, 6U), 1, DataType::QASYMM8_SIGNED), // Mismatching data type |
Mohammed Suhail Munshi | a1b1e41 | 2023-03-23 22:21:31 +0000 | [diff] [blame] | 67 | }), |
| 68 | framework::dataset::make("InputBInfo",{ TensorInfo(TensorShape(5U, 9U), 1, DataType::QASYMM8), |
| 69 | TensorInfo(TensorShape(5U, 9U), 1, DataType::S32), |
| 70 | TensorInfo(TensorShape(5U, 9U, 1U), 1, DataType::F32), |
| 71 | TensorInfo(TensorShape(5U, 12U), 1, DataType::F32), |
| 72 | TensorInfo(TensorShape(5U, 9U), 1, DataType::F32), |
| 73 | TensorInfo(TensorShape(5U, 9U, 12U), 1, DataType::F32), |
| 74 | TensorInfo(TensorShape(5U, 9U, 12U), 1, DataType::F32), |
Viet-Hoa Do | 9c7c2d2 | 2023-04-11 17:16:27 +0100 | [diff] [blame] | 75 | TensorInfo(TensorShape(5U, 9U), 1, DataType::QASYMM8), |
| 76 | TensorInfo(TensorShape(5U, 9U), 1, DataType::QASYMM8_SIGNED), |
| 77 | TensorInfo(TensorShape(5U, 9U), 1, DataType::QASYMM8_SIGNED), |
Mohammed Suhail Munshi | a1b1e41 | 2023-03-23 22:21:31 +0000 | [diff] [blame] | 78 | })), |
| 79 | framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(5U, 6U), 1, DataType::F32), |
| 80 | TensorInfo(TensorShape(5U, 6U), 1, DataType::S32), |
| 81 | TensorInfo(TensorShape(5U, 6U, 2U), 1, DataType::F32), |
| 82 | TensorInfo(TensorShape(5U, 6U), 1, DataType::F32), |
| 83 | TensorInfo(TensorShape(5U, 6U), 1, DataType::F32), |
| 84 | TensorInfo(TensorShape(5U, 6U, 12U) , 1, DataType::F32), |
| 85 | TensorInfo(TensorShape(5U, 6U, 12U) , 1, DataType::F32), |
Viet-Hoa Do | 9c7c2d2 | 2023-04-11 17:16:27 +0100 | [diff] [blame] | 86 | TensorInfo(TensorShape(5U, 6U), 1, DataType::QASYMM8), |
| 87 | TensorInfo(TensorShape(5U, 6U), 1, DataType::QASYMM8_SIGNED), |
| 88 | TensorInfo(TensorShape(5U, 6U), 1, DataType::QASYMM8), |
Mohammed Suhail Munshi | a1b1e41 | 2023-03-23 22:21:31 +0000 | [diff] [blame] | 89 | })), |
Viet-Hoa Do | 9c7c2d2 | 2023-04-11 17:16:27 +0100 | [diff] [blame] | 90 | framework::dataset::make( "TensorIsConst", {false, false, false, false, false , false, true, false, false, false} )), |
| 91 | framework::dataset::make("Expected", { false, false, false, false, true, true, false, true, true, false })), |
Mohammed Suhail Munshi | a1b1e41 | 2023-03-23 22:21:31 +0000 | [diff] [blame] | 92 | a_info, b_info, output_info, are_tensors_const, expected) |
| 93 | { |
| 94 | TensorInfo a{a_info}; |
| 95 | TensorInfo b{b_info}; |
| 96 | a.set_are_values_constant(are_tensors_const); |
| 97 | b.set_are_values_constant(are_tensors_const); |
| 98 | Status status = NEMatMul::validate(&a, |
| 99 | &b, |
| 100 | &output_info, |
| 101 | MatMulInfo(), |
| 102 | CpuMatMulSettings()); |
| 103 | ARM_COMPUTE_EXPECT(bool(status) == expected, framework::LogLevel::ERRORS); |
| 104 | } |
| 105 | // *INDENT-ON* |
| 106 | // clang-format on |
| 107 | |
| 108 | // Generic Template |
| 109 | template <typename T> |
| 110 | using NEMatMulFixture = MatMulValidationWithActivationFixture<Tensor, Accessor, NEMatMul, CpuMatMulSettings, T>; |
| 111 | |
| 112 | // Fast math Template |
| 113 | template <typename T> |
| 114 | using NEMatMulFastMathFixture = MatMulGenericValidationFixture<Tensor, Accessor, NEMatMul, CpuMatMulSettings, T>; |
| 115 | |
| 116 | template <typename T> |
| 117 | using NEMatMulDynamicTensorsFixture = MatMulValidationWithDynamicTensorsFixture<Tensor, Accessor, NEMatMul, CpuMatMulSettings, T>; |
| 118 | |
Viet-Hoa Do | 9c7c2d2 | 2023-04-11 17:16:27 +0100 | [diff] [blame] | 119 | template <typename T> |
| 120 | using NEQuantizedMatMulFixture = QuantizedMatMulValidationFixture<Tensor, Accessor, NEMatMul, CpuMatMulSettings, T>; |
| 121 | |
Mohammed Suhail Munshi | a1b1e41 | 2023-03-23 22:21:31 +0000 | [diff] [blame] | 122 | TEST_SUITE(Float) |
| 123 | TEST_SUITE(FP32) |
| 124 | FIXTURE_DATA_TEST_CASE(RunSmall, NEMatMulFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallMatMulDataset(), |
| 125 | framework::dataset::make("TransposeA", { false, true })), |
| 126 | framework::dataset::make("TransposeB", { false, true })), |
| 127 | framework::dataset::make("DataType", DataType::F32)), |
| 128 | framework::dataset::make("ActivationInfo", { ActivationLayerInfo(), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) }))) |
| 129 | { |
| 130 | // Validate output |
| 131 | validate(Accessor(_target), _reference, tolerance_fp32); |
| 132 | } |
| 133 | FIXTURE_DATA_TEST_CASE(RunLarge, NEMatMulFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeMatMulDataset(), |
| 134 | framework::dataset::make("TransposeA", { false, true })), |
| 135 | framework::dataset::make("TransposeB", { false, true })), |
| 136 | framework::dataset::make("DataType", DataType::F32)), |
| 137 | framework::dataset::make("ActivationInfo", { ActivationLayerInfo(), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) }))) |
| 138 | { |
| 139 | // Validate output |
| 140 | validate(Accessor(_target), _reference, tolerance_fp32); |
| 141 | } |
| 142 | FIXTURE_DATA_TEST_CASE(RunHighDimensions, NEMatMulFixture<float>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::HighDimensionalMatMulDataset(), |
| 143 | framework::dataset::make("TransposeA", { false, true })), |
| 144 | framework::dataset::make("TransposeB", { false, true })), |
| 145 | framework::dataset::make("DataType", DataType::F32)), |
| 146 | framework::dataset::make("ActivationInfo", { ActivationLayerInfo(), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) }))) |
| 147 | { |
| 148 | // Validate output |
| 149 | validate(Accessor(_target), _reference, tolerance_fp32); |
| 150 | } |
| 151 | |
| 152 | FIXTURE_DATA_TEST_CASE(RunStressDynamicTensors, NEMatMulDynamicTensorsFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(datasets::SmallMatMulDataset(), |
| 153 | framework::dataset::make("TransposeA", { false, true })), |
| 154 | framework::dataset::make("TransposeB", { false, true })), |
| 155 | framework::dataset::make("DataType", DataType::F32)), |
| 156 | framework::dataset::make("ActivationInfo", { ActivationLayerInfo(), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) })), |
| 157 | framework::dataset::make("NumberOfRuns", 5))) |
| 158 | { |
| 159 | // Validate output |
| 160 | validate(Accessor(_target), _reference, tolerance_fp32); |
| 161 | } |
| 162 | TEST_SUITE_END() // FP32 |
| 163 | |
| 164 | #ifdef ARM_COMPUTE_ENABLE_BF16 |
| 165 | /* Note : MatMul BF16 is enabled by specifying FP32 datatype and enabling the fast math setting */ |
| 166 | constexpr AbsoluteTolerance<float> tolerance_bf16(0.001f); |
| 167 | TEST_SUITE(BF16) |
Viet-Hoa Do | 9c7c2d2 | 2023-04-11 17:16:27 +0100 | [diff] [blame] | 168 | FIXTURE_DATA_TEST_CASE(RunSmall, NEMatMulFastMathFixture<float>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(combine(combine(combine(combine( |
| 169 | datasets::SmallMatMulDataset(), |
| 170 | framework::dataset::make("TransposeA", { false, true })), |
| 171 | framework::dataset::make("TransposeB", { false, true })), |
| 172 | framework::dataset::make("DataType", DataType::F32)), |
| 173 | framework::dataset::make("ActivationInfo", { ActivationLayerInfo() })), |
| 174 | framework::dataset::make("RunTimes", { 0 })), |
| 175 | framework::dataset::make("Settings", { CpuMatMulSettings().fast_math(true) })), |
| 176 | framework::dataset::make("LhsQInfo", { QuantizationInfo() })), |
| 177 | framework::dataset::make("RhsQInfo", { QuantizationInfo() })), |
| 178 | framework::dataset::make("OutQInfo", { QuantizationInfo() })) |
| 179 | ) |
Mohammed Suhail Munshi | a1b1e41 | 2023-03-23 22:21:31 +0000 | [diff] [blame] | 180 | { |
| 181 | // Validate output |
| 182 | validate(Accessor(_target), _reference, tolerance_bf16); |
| 183 | } |
| 184 | TEST_SUITE_END() // BF16 |
| 185 | #endif /* ARM_COMPUTE_ENABLE_BF16 */ |
| 186 | |
| 187 | #ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC |
| 188 | TEST_SUITE(FP16) |
| 189 | FIXTURE_DATA_TEST_CASE(RunSmall, NEMatMulFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(datasets::SmallMatMulDataset(), |
| 190 | framework::dataset::make("TransposeA", { false, true })), |
| 191 | framework::dataset::make("TransposeB", { false, true })), |
| 192 | framework::dataset::make("DataType", DataType::F16)), |
| 193 | framework::dataset::make("ActivationInfo", { ActivationLayerInfo(), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) }))) |
| 194 | { |
| 195 | // Validate output |
| 196 | validate(Accessor(_target), _reference, tolerance_fp16); |
| 197 | } |
| 198 | FIXTURE_DATA_TEST_CASE(RunLarge, NEMatMulFixture<half>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(datasets::LargeMatMulDataset(), |
| 199 | framework::dataset::make("TransposeA", { false, true })), |
| 200 | framework::dataset::make("TransposeB", { false, true })), |
| 201 | framework::dataset::make("DataType", DataType::F16)), |
| 202 | framework::dataset::make("ActivationInfo", { ActivationLayerInfo(), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) }))) |
| 203 | { |
| 204 | // Validate output |
| 205 | validate(Accessor(_target), _reference, tolerance_fp16); |
| 206 | } |
| 207 | FIXTURE_DATA_TEST_CASE(RunStressDynamicTensors, NEMatMulDynamicTensorsFixture<half>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(datasets::SmallMatMulDataset(), |
| 208 | framework::dataset::make("TransposeA", { false, true })), |
| 209 | framework::dataset::make("TransposeB", { false, true })), |
| 210 | framework::dataset::make("DataType", DataType::F16)), |
| 211 | framework::dataset::make("ActivationInfo", { ActivationLayerInfo(), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) })), |
| 212 | framework::dataset::make("NumberOfRuns", 5))) |
| 213 | { |
| 214 | // Validate output |
| 215 | validate(Accessor(_target), _reference, tolerance_fp16); |
| 216 | } |
| 217 | TEST_SUITE_END() // FP16 |
| 218 | #endif /* __ARM_FEATURE_FP16_VECTOR_ARITHMETIC */ |
| 219 | |
| 220 | TEST_SUITE_END() // Float |
| 221 | |
Ramy Elgammal | 05a65e3 | 2023-04-24 01:58:21 +0100 | [diff] [blame] | 222 | #ifdef __aarch64__ // All the GeMM CPU assembly kernels for integer datatypes require aarch64 |
Viet-Hoa Do | 9c7c2d2 | 2023-04-11 17:16:27 +0100 | [diff] [blame] | 223 | TEST_SUITE(Quantized) |
| 224 | |
| 225 | TEST_SUITE(QASYMM8) |
| 226 | |
| 227 | FIXTURE_DATA_TEST_CASE(RunSmall, NEQuantizedMatMulFixture<uint8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(combine(combine(combine( |
| 228 | datasets::SmallMatMulDataset(), |
| 229 | framework::dataset::make("TransposeA", { false, true })), |
| 230 | framework::dataset::make("TransposeB", { false, true })), |
| 231 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 232 | framework::dataset::make("ActivationInfo", { ActivationLayerInfo(), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) })), |
| 233 | framework::dataset::make("NumberOfExtraRuns", { 0, 1 })), |
| 234 | framework::dataset::make("LhsQInfo", { QuantizationInfo(1.f / 50, 1) })), |
| 235 | framework::dataset::make("RhsQInfo", { QuantizationInfo(1.f / 30, -1) })), |
| 236 | framework::dataset::make("OutQInfo", { QuantizationInfo(1.f, 2) })) |
| 237 | ) |
| 238 | { |
| 239 | // Validate output |
| 240 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 241 | } |
| 242 | |
| 243 | FIXTURE_DATA_TEST_CASE(RunSmallExtraActivation, NEQuantizedMatMulFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(combine(combine( |
| 244 | datasets::SmallerMatMulDataset(), |
| 245 | framework::dataset::make("TransposeA", { false, true })), |
| 246 | framework::dataset::make("TransposeB", { false, true })), |
| 247 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 248 | framework::dataset::make("ActivationInfo", { ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU) })), |
| 249 | framework::dataset::make("NumberOfExtraRuns", { 0, 1 })), |
| 250 | framework::dataset::make("LhsQInfo", { QuantizationInfo(1.f / 50, 1) })), |
| 251 | framework::dataset::make("RhsQInfo", { QuantizationInfo(1.f / 30, -1) })), |
| 252 | framework::dataset::make("OutQInfo", { QuantizationInfo(1.f, 2) })) |
| 253 | ) |
| 254 | { |
| 255 | // Validate output |
| 256 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 257 | } |
| 258 | |
| 259 | FIXTURE_DATA_TEST_CASE(RunLarge, NEQuantizedMatMulFixture<uint8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(combine(combine( |
| 260 | datasets::LargeMatMulDataset(), |
| 261 | framework::dataset::make("TransposeA", { false, true })), |
| 262 | framework::dataset::make("TransposeB", { false, true })), |
| 263 | framework::dataset::make("DataType", DataType::QASYMM8)), |
| 264 | framework::dataset::make("ActivationInfo", { ActivationLayerInfo(), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) })), |
| 265 | framework::dataset::make("NumberOfExtraRuns", { 0, 1 })), |
| 266 | framework::dataset::make("LhsQInfo", { QuantizationInfo(1.f / 100, 1) })), |
| 267 | framework::dataset::make("RhsQInfo", { QuantizationInfo(1.f / 200, -1) })), |
| 268 | framework::dataset::make("OutQInfo", { QuantizationInfo(1.f, 2) })) |
| 269 | ) |
| 270 | { |
| 271 | // Validate output |
| 272 | validate(Accessor(_target), _reference, tolerance_qasymm8); |
| 273 | } |
| 274 | |
| 275 | TEST_SUITE_END() // QASYMM8 |
| 276 | |
| 277 | TEST_SUITE(QASYMM8_SIGNED) |
| 278 | |
| 279 | FIXTURE_DATA_TEST_CASE(RunSmall, NEQuantizedMatMulFixture<int8_t>, framework::DatasetMode::PRECOMMIT, combine(combine(combine(combine(combine(combine(combine(combine( |
| 280 | datasets::SmallMatMulDataset(), |
| 281 | framework::dataset::make("TransposeA", { false, true })), |
| 282 | framework::dataset::make("TransposeB", { false, true })), |
| 283 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 284 | framework::dataset::make("ActivationInfo", { ActivationLayerInfo(), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) })), |
| 285 | framework::dataset::make("NumberOfExtraRuns", { 0, 1 })), |
| 286 | framework::dataset::make("LhsQInfo", { QuantizationInfo(1.f / 40, -2) })), |
| 287 | framework::dataset::make("RhsQInfo", { QuantizationInfo(1.f / 50, 1) })), |
| 288 | framework::dataset::make("OutQInfo", { QuantizationInfo(1.f, 1) })) |
| 289 | ) |
| 290 | { |
| 291 | // Validate output |
| 292 | validate(Accessor(_target), _reference, tolerance_qasymm8_signed); |
| 293 | } |
| 294 | |
| 295 | FIXTURE_DATA_TEST_CASE(RunSmallExtraActivation, NEQuantizedMatMulFixture<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(combine(combine( |
| 296 | datasets::SmallerMatMulDataset(), |
| 297 | framework::dataset::make("TransposeA", { false, true })), |
| 298 | framework::dataset::make("TransposeB", { false, true })), |
| 299 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 300 | framework::dataset::make("ActivationInfo", { ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::BOUNDED_RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::LU_BOUNDED_RELU) })), |
| 301 | framework::dataset::make("NumberOfExtraRuns", { 0, 1 })), |
| 302 | framework::dataset::make("LhsQInfo", { QuantizationInfo(1.f / 40, -2) })), |
| 303 | framework::dataset::make("RhsQInfo", { QuantizationInfo(1.f / 50, 1) })), |
| 304 | framework::dataset::make("OutQInfo", { QuantizationInfo(1.f, 1) })) |
| 305 | ) |
| 306 | { |
| 307 | // Validate output |
| 308 | validate(Accessor(_target), _reference, tolerance_qasymm8_signed); |
| 309 | } |
| 310 | |
| 311 | FIXTURE_DATA_TEST_CASE(RunLarge, NEQuantizedMatMulFixture<int8_t>, framework::DatasetMode::NIGHTLY, combine(combine(combine(combine(combine(combine(combine(combine( |
| 312 | datasets::LargeMatMulDataset(), |
| 313 | framework::dataset::make("TransposeA", { false, true })), |
| 314 | framework::dataset::make("TransposeB", { false, true })), |
| 315 | framework::dataset::make("DataType", DataType::QASYMM8_SIGNED)), |
| 316 | framework::dataset::make("ActivationInfo", { ActivationLayerInfo(), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU) })), |
| 317 | framework::dataset::make("NumberOfExtraRuns", { 0, 1 })), |
| 318 | framework::dataset::make("LhsQInfo", { QuantizationInfo(1.f / 150, -2) })), |
| 319 | framework::dataset::make("RhsQInfo", { QuantizationInfo(1.f / 250, 1) })), |
| 320 | framework::dataset::make("OutQInfo", { QuantizationInfo(1.f, 1) })) |
| 321 | ) |
| 322 | { |
| 323 | // Validate output |
| 324 | validate(Accessor(_target), _reference, tolerance_qasymm8_signed); |
| 325 | } |
| 326 | |
| 327 | TEST_SUITE_END() // QASYMM8_SIGNED |
| 328 | |
| 329 | TEST_SUITE_END() // Quantized |
Ramy Elgammal | 05a65e3 | 2023-04-24 01:58:21 +0100 | [diff] [blame] | 330 | #endif // __aarch64__ |
Viet-Hoa Do | 9c7c2d2 | 2023-04-11 17:16:27 +0100 | [diff] [blame] | 331 | |
Mohammed Suhail Munshi | a1b1e41 | 2023-03-23 22:21:31 +0000 | [diff] [blame] | 332 | TEST_SUITE_END() // MatMul |
| 333 | TEST_SUITE_END() // NEON |
| 334 | } // namespace validation |
| 335 | } // namespace test |
| 336 | } // namespace arm_compute |