From aee5d7537ff81ffda5ba222721b72f914ce50fb8 Mon Sep 17 00:00:00 2001 From: Louis Verhaard Date: Wed, 30 Sep 2020 09:01:52 +0200 Subject: MLBEDSW-3148: Refactor Operation - op.type is now an enum instead of a string - Removed unused operator codes - Refactored some attributes like npu_block_type, fused_activation_function - Refactored operator index calculation - Refactored a number of operator sets Change-Id: I641f65ee375794b7aec42abc0664251ae37d78e8 Signed-off-by: Louis Verhaard --- ethosu/vela/live_range.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ethosu/vela/live_range.py') diff --git a/ethosu/vela/live_range.py b/ethosu/vela/live_range.py index 9a8ee580..23026c79 100644 --- a/ethosu/vela/live_range.py +++ b/ethosu/vela/live_range.py @@ -18,6 +18,7 @@ # Can work with either a pass packed subgraph or a scheduled subgraph. from .high_level_command_stream_generator import calc_allowed_ofm_ifm_overlap_for_cascaded_pass from .nn_graph import PassPlacement +from .operation import Op from .tensor import MemType from .tensor import Tensor @@ -262,7 +263,11 @@ def extract_live_ranges_from_cascaded_passes( cps_primary_op = cps.passes[0].primary_op - if cps_primary_op and cps_primary_op.type == "NpuOp" and MemType.Permanent_CPU not in target_mem_type_set: + if ( + cps_primary_op + and cps_primary_op.type == Op.CustomNpuOp + and MemType.Permanent_CPU not in target_mem_type_set + ): # If the primary-op is an NpuOp that means this is where an Npu subgraph # is called. Go into said subgraph and extract live ranges before continuing. # Use default allocation alignment of 16 for Npu tensors -- cgit v1.2.1