diff options
author | Viet-Hoa Do <viet-hoa.do@arm.com> | 2023-04-11 17:16:27 +0100 |
---|---|---|
committer | Viet-Hoa Do <viet-hoa.do@arm.com> | 2023-04-19 08:40:45 +0000 |
commit | 9c7c2d2d23693877867bb3284c577b33cfbff471 (patch) | |
tree | f470a88b23498c1b5d13c5f9578caaf9d0599b74 /arm_compute/core | |
parent | 9d0c4deb760efc2ca07e5e0b8218995201ad8a1f (diff) | |
download | ComputeLibrary-9c7c2d2d23693877867bb3284c577b33cfbff471.tar.gz |
Add quantized support for CPU MatMul
Resolves: COMPMID-5899
Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com>
Change-Id: I89d96e292c3492ba9b1900a3e5683f9dcd11dfc6
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9440
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core')
-rw-r--r-- | arm_compute/core/utils/quantization/AsymmHelpers.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/arm_compute/core/utils/quantization/AsymmHelpers.h b/arm_compute/core/utils/quantization/AsymmHelpers.h index c9d0930c3a..9e1e9668fb 100644 --- a/arm_compute/core/utils/quantization/AsymmHelpers.h +++ b/arm_compute/core/utils/quantization/AsymmHelpers.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2021 Arm Limited. + * Copyright (c) 2017-2021, 2023 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -81,6 +81,19 @@ Status calculate_quantized_multipliers(const QuantizationInfo &iq_info, * @return min and max values for the quantized data type */ std::pair<int, int> get_min_max_values_from_quantized_data_type(DataType data_type); + +/** Get minimum and maximum output of the activation function after quantization. + * + * Only ReLU, upper bounded ReLU and lower+upper bounded ReLU are supported. + * + * @param[in] q_info Output quantization info. + * @param[in] act_info Activation function information. + * @param[in] data_type Output data type (either QASYMM8 or QASYMM8_SIGNED). + * + * @return The minimum and maximum output of the activation function after quantization. + */ +std::tuple<PixelValue, PixelValue> get_quantized_asymmetric_output_min_max(const QuantizationInfo &q_info, const ActivationLayerInfo &act_info, DataType data_type); + /** Compute quantized per-channel multipliers and shifts. As many multipliers * and shifts as output channels are computed. If weights are not quantized * per-channel, multipliers and shifts will end up being the same for each |