diff options
author | Michael McGeagh <michael.mcgeagh@arm.com> | 2020-09-04 15:44:23 +0100 |
---|---|---|
committer | Michael McGeagh <michael.mcgeagh@arm.com> | 2020-09-08 15:17:39 +0100 |
commit | 34ad19b6bf7152a2e15834d152fa7bfa3131039e (patch) | |
tree | 0b63cbbb953921706bebef876cdc9da6ae490f27 | |
parent | 98a3499ec73b26880c633caf9a43bfe80f9ec1ed (diff) | |
download | ethos-u-vela-34ad19b6bf7152a2e15834d152fa7bfa3131039e.tar.gz |
optim: Fix issue with IFM streaming of LUT
Signed-off-by: Michael McGeagh <michael.mcgeagh@arm.com>
Change-Id: I3c3ed73a6db39615ddf5987dc5696b6b09682be0
-rw-r--r-- | ethosu/vela/high_level_command_stream_generator.py | 25 | ||||
-rw-r--r-- | ethosu/vela/supported_operators.py | 4 |
2 files changed, 16 insertions, 13 deletions
diff --git a/ethosu/vela/high_level_command_stream_generator.py b/ethosu/vela/high_level_command_stream_generator.py index 50b913d8..8486dadc 100644 --- a/ethosu/vela/high_level_command_stream_generator.py +++ b/ethosu/vela/high_level_command_stream_generator.py @@ -272,18 +272,21 @@ def generate_high_level_command_stream_for_pass(strat, passes, block_configs, id if ( intermediate is not None and intermediate.shape != [] - and intermediate.purpose == TensorPurpose.FeatureMap + and intermediate.purpose in (TensorPurpose.FeatureMap, TensorPurpose.LUT) ): - intermediate_box, _, _ = ofm_box.transform_with_strides_and_skirt( - strides, - skirt, - intermediate.shape, - npu_block_type, - concat_axis, - concat_offset, - split_offsets[0], - upscaling, - ) + if intermediate.purpose is TensorPurpose.FeatureMap: + intermediate_box, _, _ = ofm_box.transform_with_strides_and_skirt( + strides, + skirt, + intermediate.shape, + npu_block_type, + concat_axis, + concat_offset, + split_offsets[0], + upscaling, + ) + else: + intermediate_box = Box([0] * len(intermediate.shape), list(intermediate.shape)) yield from dma_if_necessary(ps, intermediate_box, intermediate) ifm_y_needed = 1 diff --git a/ethosu/vela/supported_operators.py b/ethosu/vela/supported_operators.py index 86cc3c07..b6551cf9 100644 --- a/ethosu/vela/supported_operators.py +++ b/ethosu/vela/supported_operators.py @@ -398,8 +398,8 @@ class SupportedOperators: if ( op.inputs[0].quantization is None - or not op.inputs[0].quantization.is_scaling_equal(op.inputs[1].quantization) - or not op.inputs[0].quantization.is_scaling_equal(op.outputs[0].quantization) + or not op.inputs[0].is_scaling_equal(op.inputs[1]) + or not op.inputs[0].is_scaling_equal(op.outputs[0]) ): print( "Warning: Input/output tensors with different quantization is unsupported for the", op.type, "operator" |