aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/shared_buffer_allocation.py
diff options
context:
space:
mode:
authorDwight Lidman <dwight.lidman@arm.com>2020-05-13 12:00:08 +0200
committerTim Hall <tim.hall@arm.com>2020-06-18 17:53:52 +0100
commita9390f7fbd35dca75e80710835f67bb1d75d7c93 (patch)
treedf3606c28425e3a3504b29fe79ac8ddd0e2b8661 /ethosu/vela/shared_buffer_allocation.py
parent388e9c230898385df59e6175aa45012e5864c09a (diff)
downloadethos-u-vela-a9390f7fbd35dca75e80710835f67bb1d75d7c93.tar.gz
MLBEDSW-1971: Verify ifm block size calculation against specification
This commit ensures the IFM block size calculation in architecture_features.py matches the specification by correctly setting the ifm upscaling factor based on the upscaling mode. This requires adding an attribute to the Tensor object which stores the upscaling mode for that specific tensor and making sure that information is correctly carried over to shared_buffer_allocation.py. Signed-off-by: Dwight Lidman <dwight.lidman@arm.com> Change-Id: I4ab56086f4c694d3bf759bbad30cdb969b4a26db
Diffstat (limited to 'ethosu/vela/shared_buffer_allocation.py')
-rw-r--r--ethosu/vela/shared_buffer_allocation.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ethosu/vela/shared_buffer_allocation.py b/ethosu/vela/shared_buffer_allocation.py
index 2bfe5941..72caa1b6 100644
--- a/ethosu/vela/shared_buffer_allocation.py
+++ b/ethosu/vela/shared_buffer_allocation.py
@@ -85,6 +85,7 @@ class SharedBufferAllocation:
else:
assert self.ifm_bits == 8, "Unexpected IFM bitdepth"
+ self.ifm_resampling_mode = ifm_tensor.resampling_mode
self.ifm_block_depth = arch.calc_ifm_block_depth(self.ifm_depth, self.ifm_bits)
self.ofm_tensor = ofm_tensor
@@ -105,7 +106,7 @@ class SharedBufferAllocation:
def try_block(self, ofm_block: Block):
# Get IFM block configuration
ifm_block_depth = ofm_block.depth if self.is_equal_depth_op else self.ifm_block_depth
- ifm_block = self.arch.get_ifm_block_size(ifm_block_depth, ofm_block, self.kernel)
+ ifm_block = self.arch.get_ifm_block_size(ifm_block_depth, ofm_block, self.kernel, ifm_resampling_mode=self.ifm_resampling_mode)
ifm_config = self.arch.get_block_config(ifm_block.width, ifm_block.height, ifm_block.depth)
if ifm_config is None:
return None