Skip to content

Commit 8491d62

Browse files
committed
updated scale for FP16
1 parent b10d1c6 commit 8491d62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/plugins/intel_cpu/src/nodes/kernels/scaled_attn/attn_quant_kernel.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ void quant_u8(const T* src, uint8_t* dst, size_t n, float& scale, float& zp) {
190190
#ifdef __ARM_FEATURE_FP16_VECTOR_ARITHMETIC
191191
// For FP16 in ARM we use FP16 accumulator
192192
if constexpr (std::is_same_v<T, ov::float16>) {
193-
scale = 0.05f;
193+
scale = std::max(0.05f, std::abs(min) / 65504.0f);
194194
}
195195
#endif
196196
}

0 commit comments

Comments
 (0)