aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/high_level_command_stream_generator.py
diff options
context:
space:
mode:
Diffstat (limited to 'ethosu/vela/high_level_command_stream_generator.py')
-rw-r--r--ethosu/vela/high_level_command_stream_generator.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/ethosu/vela/high_level_command_stream_generator.py b/ethosu/vela/high_level_command_stream_generator.py
index 3d0a1e5..f0d7409 100644
--- a/ethosu/vela/high_level_command_stream_generator.py
+++ b/ethosu/vela/high_level_command_stream_generator.py
@@ -82,7 +82,7 @@ def generate_high_level_commands_for_sched_op(sched_op, schedule):
elif sched_op.op_type == Op.ResizeBilinear:
upscaling = round_up_divide(ofm_shape.height, ifm.shape.height)
- # Get Kernel height
+ # Get kernel height and height dilation
k_height = 1
if npu_block_type in (NpuBlockType.Pooling, NpuBlockType.ReduceSum):
if parent_op is not None:
@@ -91,6 +91,11 @@ def generate_high_level_commands_for_sched_op(sched_op, schedule):
if uncomp_weight_tensor is not None:
k_height = uncomp_weight_tensor.shape[0]
+ k_height_dilation = parent_op.attrs.get("dilation", (_, 1, _, _))[-3]
+
+ # Calculate dilated kernel height
+ k_dilated_height = k_height_dilation * (k_height - 1) + 1
+
# Define Start and End coordinates for the OFM
ofm_start = Shape4D(0, 0, 0, op_info.ofm_depth_slices[0])
ofm_end = ofm_shape
@@ -150,9 +155,9 @@ def generate_high_level_commands_for_sched_op(sched_op, schedule):
ifm.shape,
npu_block_type,
write_offset.as_list(),
+ k_dilated_height,
read_offsets[0],
read_shapes[0],
- k_height,
upscaling,
)
@@ -164,9 +169,9 @@ def generate_high_level_commands_for_sched_op(sched_op, schedule):
ifm2.shape,
npu_block_type,
write_offset.as_list(),
+ k_dilated_height,
read_offsets[1],
read_shapes[1],
- k_height,
upscaling,
)