aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Xu <charles.xu@arm.com>2020-08-11 12:31:58 +0200
committerFredrik Knutsson <fredrik.knutsson.hunnebo@gmail.com>2020-08-12 12:42:55 +0000
commit89a6bbffaa85d72cd79fd73f457c01486b9258bb (patch)
treeb4e4f573462c84c90ebf32b26ae5552bc4a22f15
parentde2a57f81197f475a9c74b65b02ac3d5c1e949bb (diff)
downloadethos-u-vela-89a6bbffaa85d72cd79fd73f457c01486b9258bb.tar.gz
MLBEDSW-2681: Ceiling the upscale for OFM/IFM
Signed-off-by: Charles Xu <charles.xu@arm.com> Change-Id: I566abd5a1ffc367c6b9b8f37d5a26b61d27e840b
-rw-r--r--ethosu/vela/high_level_command_stream_generator.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/ethosu/vela/high_level_command_stream_generator.py b/ethosu/vela/high_level_command_stream_generator.py
index 2297a3bf..d34fb75b 100644
--- a/ethosu/vela/high_level_command_stream_generator.py
+++ b/ethosu/vela/high_level_command_stream_generator.py
@@ -23,6 +23,7 @@ from .high_level_command_stream import DMA
from .high_level_command_stream import NpuStripe
from .nn_graph import PassPlacement
from .nn_graph import SchedulingStrategy
+from .numeric_util import round_up_divide
from .operation import NpuBlockType
from .tensor import TensorPurpose
@@ -77,8 +78,10 @@ def generate_high_level_command_stream_for_pass(strat, passes, block_configs, id
if ps.primary_op is not None:
strides = ps.primary_op.attrs.get("strides", None)
skirt = ps.primary_op.attrs.get("skirt", None)
- if ps.primary_op.type in set(("Conv2DBackpropInputSwitchedBias", "ResizeBilinear")):
+ if ps.primary_op.type == "Conv2DBackpropInputSwitchedBias":
upscaling = ofm_tensor.shape[-3] // ifm_tensor.shape[-3]
+ elif ps.primary_op.type == "ResizeBilinear":
+ upscaling = round_up_divide(ofm_tensor.shape[-3], ifm_tensor.shape[-3])
concat_axis = 0
concat_offset = 0
@@ -235,7 +238,7 @@ def generate_high_level_command_stream_for_pass(strat, passes, block_configs, id
ofm_box = Box(ofm_start, ofm_end)
k_height = 1
- if npu_block_type == set((NpuBlockType.Pooling, NpuBlockType.ReduceSum)):
+ if npu_block_type in (NpuBlockType.Pooling, NpuBlockType.ReduceSum):
if ps.primary_op is not None:
k_height = ps.primary_op.attrs["ksize"][1]
else: