From 9d0c4deb760efc2ca07e5e0b8218995201ad8a1f Mon Sep 17 00:00:00 2001 From: Gunes Bayir Date: Thu, 13 Apr 2023 18:22:58 +0100 Subject: Add quantized CL MatMul kernels for Lhs NT/T, Rhs NT Implement OpenCL kernels for batched Matrix Multiplication for the quantized data types QASYMM8 and QASYMM8_SIGNED. Quantized MatMul is supported with the following MatMul attributes: * adj_x = false, adj_y = false * adj_x = true, adj_y = false We consider native format kernels only. In other words, no reshaping of the operand matrices is done. Resolves: COMPMID-5921, COMPMID-5922 Change-Id: I99e0f68054a2bd635c60ec2641acc2e7ff398473 Signed-off-by: Omar Al Khatib Signed-off-by: Gunes Bayir Signed-off-by: Jakub Sujak Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9435 Reviewed-by: SiCong Li Reviewed-by: Viet-Hoa Do Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins Benchmark: Arm Jenkins --- tests/validation/Helpers.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'tests/validation/Helpers.h') diff --git a/tests/validation/Helpers.h b/tests/validation/Helpers.h index 2e48a6b8c6..3449239e45 100644 --- a/tests/validation/Helpers.h +++ b/tests/validation/Helpers.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2022 Arm Limited. + * Copyright (c) 2017-2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -21,8 +21,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef ARM_COMPUTE_TEST_VALIDATION_HELPERS_H -#define ARM_COMPUTE_TEST_VALIDATION_HELPERS_H +#ifndef ACL_TESTS_VALIDATION_HELPERS +#define ACL_TESTS_VALIDATION_HELPERS #include "arm_compute/core/Types.h" #include "arm_compute/core/Utils.h" @@ -250,7 +250,12 @@ void add_padding_x(std::initializer_list tensors, const DataLayout &d * @note This function adds padding to the input tensors only if data_layout == DataLayout::NHWC */ void add_padding_y(std::initializer_list tensors, const DataLayout &data_layout = DataLayout::NHWC); + +/** For MatMulLowp, given the Lhs/Rhs matrix quantization informations and the matrix multiplication dimensions, + * calculate a suitable output quantization for obtaining non-saturated outputs with high probability. + */ +QuantizationInfo calculate_mat_mul_dst_q_info(const QuantizationInfo &lhs_q_info, const QuantizationInfo &rhs_q_info, int m, int n, int k, DataType data_type); } // namespace validation } // namespace test } // namespace arm_compute -#endif /* ARM_COMPUTE_TEST_VALIDATION_HELPERS_H */ +#endif /* ACL_TESTS_VALIDATION_HELPERS */ -- cgit v1.2.1