diff options
author | Tim Hall <tim.hall@arm.com> | 2021-06-08 21:25:57 +0100 |
---|---|---|
committer | Tim Hall <tim.hall@arm.com> | 2021-06-08 21:25:57 +0100 |
commit | d784af7e8995a10fb403157af48371699c35bbfe (patch) | |
tree | bf40b35b030d560049cef9411293b51e3d70ff4a /ethosu/vela/npu_serialisation.py | |
parent | 225e19d3640288e991475ee4c49cb3ffd83cc83b (diff) | |
download | ethos-u-vela-d784af7e8995a10fb403157af48371699c35bbfe.tar.gz |
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 <tim.hall@arm.com>
Change-Id: I7aae163438160a919cae04e235966e75355a6148
Diffstat (limited to 'ethosu/vela/npu_serialisation.py')
-rw-r--r-- | ethosu/vela/npu_serialisation.py | 2 |
1 files changed, 2 insertions, 0 deletions
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) |