From 336830865beea9fc5bec21a53397de5241485763 Mon Sep 17 00:00:00 2001 From: Johan Alfven Date: Thu, 8 Feb 2024 15:05:23 +0100 Subject: MLBEDSW-8674: int16 VectorProduct should use Natural rounding - Fixed output diff for FullyConnect int16 - Problem was that wrong rounding mode was used - Reference uses Natural rounding for FullyConnect int16 Change-Id: I209313b6f89fed01678a448a935d5f6904b41057 Signed-off-by: Johan Alfven --- ethosu/vela/high_level_command_to_npu_op.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ethosu/vela/high_level_command_to_npu_op.py b/ethosu/vela/high_level_command_to_npu_op.py index 06d91a6..52d0718 100644 --- a/ethosu/vela/high_level_command_to_npu_op.py +++ b/ethosu/vela/high_level_command_to_npu_op.py @@ -144,7 +144,8 @@ def get_rounding_mode(op: Operation, fused_quantize: bool) -> NpuRoundingMode: if op.type.is_resize_op(): rounding_mode = NpuRoundingMode.NATURAL elif ( - op.original_type.npu_block_type in (NpuBlockType.ConvolutionMxN, NpuBlockType.ConvolutionDepthWise) + op.original_type.npu_block_type + in (NpuBlockType.ConvolutionMxN, NpuBlockType.ConvolutionDepthWise, NpuBlockType.VectorProduct) and op.ifm.dtype == DataType.int16 ): rounding_mode = NpuRoundingMode.NATURAL -- cgit v1.2.1