aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/architecture_features.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/architecture_features.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/architecture_features.py')
-rw-r--r--ethosu/vela/architecture_features.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/ethosu/vela/architecture_features.py b/ethosu/vela/architecture_features.py
index 1bf9d950..b59122ea 100644
--- a/ethosu/vela/architecture_features.py
+++ b/ethosu/vela/architecture_features.py
@@ -22,6 +22,7 @@ from configparser import ConfigParser
import numpy as np
from .errors import OptionError
+from .ethos_u55_regs.ethos_u55_regs import resampling_mode
from .numeric_util import round_up
from .numeric_util import round_up_divide
from .operation import NpuBlockType
@@ -347,10 +348,10 @@ Note the difference between ArchitectureFeatures and CompilerOptions
return min(max_block_depth, ifm_depth)
# Calculate the size of the IFM block given a depth, target OFM block and a kernel
- def get_ifm_block_size(
- self, ifm_block_depth, ofm_block: Block, kernel: Kernel, subkernel: Block = Block(8, 8, 65536)
- ):
- upscaling = 1
+ def get_ifm_block_size(self, ifm_block_depth, ofm_block: Block,
+ kernel: Kernel, subkernel: Block = Block(8, 8, 65536),
+ ifm_resampling_mode=resampling_mode.NONE):
+ upscaling = 1 if ifm_resampling_mode == resampling_mode.NONE else 2
# Height
ifm_odd_2x_height_enable = 0
dilated_kernel_height = ((kernel.height - 1) * kernel.dilation.y) + 1