diff options
author | Viet-Hoa Do <viet-hoa.do@arm.com> | 2022-10-27 15:36:20 +0100 |
---|---|---|
committer | Viet-Hoa Do <viet-hoa.do@arm.com> | 2022-11-01 17:12:01 +0000 |
commit | 0ae31d1761b61ce0952b032816de2929e606d3c1 (patch) | |
tree | 23bd262bdc35f06f59ab49c3578e1b59c6b02449 /src/cpu/kernels | |
parent | a7077e9b8cc2d93a84249ee665776d09963e08a0 (diff) | |
download | ComputeLibrary-0ae31d1761b61ce0952b032816de2929e606d3c1.tar.gz |
Fix fixed-point quantized addition
* The range check condition is incorrect. The maximum value
of 8-bit quantized data is 255, not 1023.
* Use 256 to make the check slightly stricter than it should.
Resolves: COMPMID-5458
Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com>
Change-Id: I5c071680531574b409a7ce71a732f6480caa10d8
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8537
Reviewed-by: Jakub Sujak <jakub.sujak@arm.com>
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/cpu/kernels')
-rw-r--r-- | src/cpu/kernels/add/generic/neon/impl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cpu/kernels/add/generic/neon/impl.cpp b/src/cpu/kernels/add/generic/neon/impl.cpp index 0d4402e332..5adb39682e 100644 --- a/src/cpu/kernels/add/generic/neon/impl.cpp +++ b/src/cpu/kernels/add/generic/neon/impl.cpp @@ -144,7 +144,7 @@ bool add_q8_neon_fixedpoint_possible(const ITensorInfo *src0, const ITensorInfo } const auto offset = float(oq.offset) - scale0 * float(iq0.offset) - scale1 * float(iq1.offset); - const auto max_acc = (std::abs(scale0) + std::abs(scale1)) * 1024.f + std::abs(offset); + const auto max_acc = (std::abs(scale0) + std::abs(scale1)) * 256.f + std::abs(offset); if(max_acc > 2097151.f) // 2^21 - 1 { |