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/npu_performance.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'ethosu/vela/npu_performance.py') diff --git a/ethosu/vela/npu_performance.py b/ethosu/vela/npu_performance.py index e09fc9e1..fc148f38 100644 --- a/ethosu/vela/npu_performance.py +++ b/ethosu/vela/npu_performance.py @@ -41,10 +41,7 @@ def rolling_buffer_dims_from_passes(arch, ps1, block_config_ps1, ps2, block_conf if ps2.npu_block_type in set((NpuBlockType.ConvolutionMxN, NpuBlockType.VectorProduct)): op = ps2.primary_op - ifm_idx, _, _, _, _ = op.get_ifm_ifm2_weight_bias_ofm_indices() - ifm_block_depth = arch.calc_ifm_block_depth( - op.inputs[ifm_idx].shape[-1], op.inputs[ifm_idx].dtype.size_in_bits() - ) + ifm_block_depth = arch.calc_ifm_block_depth(op.ifm.shape[-1], op.ifm.dtype.size_in_bits()) else: ifm_block_depth = block_config_ps2[-1] @@ -237,8 +234,8 @@ def performance_metrics_for_pass(arch, ps, block_config=None, rewrite_list=[], f elif primary_op: skirt = primary_op.attrs.get("skirt", skirt) explicit_padding = primary_op.attrs.get("explicit_padding", explicit_padding) - assert primary_op.attrs["npu_block_type"] == ps.npu_block_type - npu_block_type = primary_op.attrs["npu_block_type"] + assert primary_op.type.npu_block_type == ps.npu_block_type + npu_block_type = primary_op.type.npu_block_type ifm_tensor, _, weight_tensor, ofm_tensor = ps.get_primary_op_ifm_ifm2_weights_ofm() -- cgit v1.2.1