From 1bd531dec0b4eb745fb8856d14c1aba2b8a73026 Mon Sep 17 00:00:00 2001 From: Tim Hall Date: Sun, 1 Nov 2020 20:59:36 +0000 Subject: MLBEDSW-3249: Vela config file examples - Added sample vela.ini config file - Changed vela config format, split into system config and memory mode - Removed unused CPU cycle performance estimation - Added new CLI options for --memory-mode and --verbose-config - Changed CLI option --config to take multiple files - Removed CLI option --global-memory-clock-scales - Changed error helper functions to raise a VelaError exception - Refactored to create a new is_spilling_enabled function Signed-off-by: Tim Hall Change-Id: I27c41577e37a3859edb9524cd99784be10ef0a0d --- ethosu/vela/high_level_command_to_npu_op.py | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'ethosu/vela/high_level_command_to_npu_op.py') diff --git a/ethosu/vela/high_level_command_to_npu_op.py b/ethosu/vela/high_level_command_to_npu_op.py index f7864442..efd8a03d 100644 --- a/ethosu/vela/high_level_command_to_npu_op.py +++ b/ethosu/vela/high_level_command_to_npu_op.py @@ -171,20 +171,17 @@ def create_padding(cmd: NpuStripe, primary_op: Operation) -> NpuPadding: def get_region(tens: Tensor, arch: ArchitectureFeatures) -> int: - if arch.feature_map_storage_mem_area == arch.fast_storage_mem_area: - base_ptr_idx_map = { - MemType.Permanent_NPU: BasePointerIndex.WeightTensor, - MemType.Permanent_CPU: BasePointerIndex.WeightTensor, - MemType.Scratch: BasePointerIndex.ScratchTensor, - MemType.Scratch_fast: BasePointerIndex.ScratchTensor, - } + base_ptr_idx_map = { + MemType.Permanent_NPU: BasePointerIndex.WeightTensor, + MemType.Permanent_CPU: BasePointerIndex.WeightTensor, + MemType.Scratch: BasePointerIndex.ScratchTensor, + } + + if arch.is_spilling_enabled(): + base_ptr_idx_map[MemType.Scratch_fast] = BasePointerIndex.ScratchFastTensor else: - base_ptr_idx_map = { - MemType.Permanent_NPU: BasePointerIndex.WeightTensor, - MemType.Permanent_CPU: BasePointerIndex.WeightTensor, - MemType.Scratch: BasePointerIndex.ScratchTensor, - MemType.Scratch_fast: BasePointerIndex.ScratchFastTensor, - } + base_ptr_idx_map[MemType.Scratch_fast] = BasePointerIndex.ScratchTensor + return int(base_ptr_idx_map[tens.mem_type]) -- cgit v1.2.1