aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/high_level_command_stream_generator.py
diff options
context:
space:
mode:
authorTim Hall <tim.hall@arm.com>2021-06-08 21:25:57 +0100
committerTim Hall <tim.hall@arm.com>2021-06-08 21:25:57 +0100
commitd784af7e8995a10fb403157af48371699c35bbfe (patch)
treebf40b35b030d560049cef9411293b51e3d70ff4a /ethosu/vela/high_level_command_stream_generator.py
parent225e19d3640288e991475ee4c49cb3ffd83cc83b (diff)
downloadethos-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/high_level_command_stream_generator.py')
-rw-r--r--ethosu/vela/high_level_command_stream_generator.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/ethosu/vela/high_level_command_stream_generator.py b/ethosu/vela/high_level_command_stream_generator.py
index ecd375e9..5a838f88 100644
--- a/ethosu/vela/high_level_command_stream_generator.py
+++ b/ethosu/vela/high_level_command_stream_generator.py
@@ -186,6 +186,7 @@ def generate_high_level_commands_for_sched_op(sched_op, schedule):
# 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 @@ def generate_high_level_commands_for_sched_op(sched_op, schedule):
ofm_box,
weight_tensor,
weight_box,
+ scale_tensor,
ifm2_tensor=ifm2_tensor,
ifm2_box=ifm2_box,
pad_top=pad_top,