From d784af7e8995a10fb403157af48371699c35bbfe Mon Sep 17 00:00:00 2001 From: Tim Hall Date: Tue, 8 Jun 2021 21:25:57 +0100 Subject: MLBEDSW-4602: Fix Deepspeech scale & bias reuse issue. - Deepspeech reuses identical weights and biases throughout the network. Since biases are now interleaved with weights there is a scaling issue when the ifm scales differ between operations using the same weight and scale tensor. - This commit uses interleaved weights/scales on their first use but separates scales to source memory on subsequent use (if the ifm scale is different). Signed-off-by: Tim Hall Change-Id: I7aae163438160a919cae04e235966e75355a6148 --- ethosu/vela/npu_serialisation.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ethosu/vela/npu_serialisation.py') diff --git a/ethosu/vela/npu_serialisation.py b/ethosu/vela/npu_serialisation.py index 39a7f21f..f462168a 100644 --- a/ethosu/vela/npu_serialisation.py +++ b/ethosu/vela/npu_serialisation.py @@ -98,6 +98,8 @@ def serialise_npu_subgraph_into_tensors(sg, arch, scratch_tens, scratch_fast_ten op_info = sg.schedule.cost_map[sched_op] if op_info.npu_weights_tensor: copy_compressed_values_to_memory_tensor(sg.flash_tensor, op_info.npu_weights_tensor) + if op_info.npu_scales_tensor: + copy_compressed_values_to_memory_tensor(sg.flash_tensor, op_info.npu_scales_tensor) if ifm_tensor and ifm_tensor.mem_type not in (MemType.Scratch, MemType.Scratch_fast): copy_ifm_values_to_memory_tensor(sg.flash_tensor, ifm_tensor) -- cgit v1.2.1