diff options
author | Andreas Nevalainen <andreas.nevalainen@arm.com> | 2020-10-28 15:42:08 +0100 |
---|---|---|
committer | patrik.gustavsson <patrik.gustavsson@arm.com> | 2020-11-11 08:34:16 +0000 |
commit | 897cc14968e017b1f48f376f7f7cefc515c5fe88 (patch) | |
tree | 27d17a59f1529c1ed0b1cc59e60438ee7f5d29d2 /ethosu/vela/high_level_command_stream_generator.py | |
parent | 73320a48dfa711f5938b0e3d8e03b9858558b899 (diff) | |
download | ethos-u-vela-897cc14968e017b1f48f376f7f7cefc515c5fe88.tar.gz |
MLBEDSW-3222: Bias tensors in fast storage
For IFM streamed cascades bias tensors are read several times.
Moves these tensors to fast storage and add DMA commands.
Change-Id: I630f6275986c1b5e3f126c925b11e22500fb1128
Signed-off-by: Andreas Nevalainen <andreas.nevalainen@arm.com>
Diffstat (limited to 'ethosu/vela/high_level_command_stream_generator.py')
-rw-r--r-- | ethosu/vela/high_level_command_stream_generator.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ethosu/vela/high_level_command_stream_generator.py b/ethosu/vela/high_level_command_stream_generator.py index 01fab0e8..871a0486 100644 --- a/ethosu/vela/high_level_command_stream_generator.py +++ b/ethosu/vela/high_level_command_stream_generator.py @@ -238,6 +238,7 @@ def generate_high_level_command_stream_for_pass(strat, passes, block_configs, id y_step = y_dim weight_box = None + scale_box = None for start in range(y_start, y_dim, y_step): end = min(start + y_step, y_dim) @@ -299,6 +300,10 @@ def generate_high_level_command_stream_for_pass(strat, passes, block_configs, id if ifm_y_present >= ifm_y_needed: break + if scale_tensor is not None and scale_tensor.purpose == TensorPurpose.FSBias and scale_box is None: + scale_box = Box([0] * len(scale_tensor.shape), list(scale_tensor.shape)) + yield from dma_if_necessary(ps, scale_box, scale_tensor) + if weight_tensor is not None and weight_box is None: weight_box = Box.make_weight_box( weight_tensor.shape, npu_block_type, weights_transposed=weight_tensor.weight_transpose_depthwise |