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
diff --git a/ethosu/vela/high_level_command_stream_generator.py b/ethosu/vela/high_level_command_stream_generator.py
index ecd375e..5a838f8 100644
--- a/ethosu/vela/high_level_command_stream_generator.py
+++ b/ethosu/vela/high_level_command_stream_generator.py
@@ -186,6 +186,7 @@
# Calculate the weight box - i.e. the subshape of weights needed for this NpuStripe command
weight_tensor = op_info.npu_weights_tensor
+ scale_tensor = op_info.npu_scales_tensor
if op_info.npu_weights_tensor:
weight_box = Box([0, 0, 0, start_channel], [1, 1, 1, end_channel])
@@ -211,6 +212,7 @@
ofm_box,
weight_tensor,
weight_box,
+ scale_tensor,
ifm2_tensor=ifm2_tensor,
ifm2_box=ifm2_box,
pad_top=pad_top,