From b02c8d954b9c7b8452a2c9adbcdd14a787a352a5 Mon Sep 17 00:00:00 2001 From: Charles Xu Date: Thu, 25 Jun 2020 16:05:25 +0200 Subject: MLBEDSW-2552: Skip npu cycle calculation for cpu op Signed-off-by: Charles Xu Change-Id: Ief50c934b9e9b0bd3024d3ed0bbaa7b655971952 --- ethosu/vela/npu_performance.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ethosu/vela/npu_performance.py b/ethosu/vela/npu_performance.py index 98626de6..1663c26b 100644 --- a/ethosu/vela/npu_performance.py +++ b/ethosu/vela/npu_performance.py @@ -232,7 +232,9 @@ def performance_metrics_for_pass(arch, ps, block_config=None, rewrite_list=[], f explicit_padding = (0, 0, 0, 0) primary_op = ps.primary_op replacement_read_bws = {} - if primary_op: + if ps.placement == PassPlacement.Cpu: + cycles[PassCycles.Cpu] = arch.cpu_cycle_estimate(ps.ops[0]) + 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 @@ -397,9 +399,6 @@ def performance_metrics_for_pass(arch, ps, block_config=None, rewrite_list=[], f cycles[PassCycles.ElementWise] = numeric_util.round_up_divide(elms, arch.num_elem_wise_units) - if ps.placement == PassPlacement.Cpu: - cycles[PassCycles.Cpu] = arch.cpu_cycle_estimate(ps.ops[0]) - # apply the desired rewrites for rewrite_op, tens, _, _, _, ps_to_rewrite in rewrite_list: if ps != ps_to_rewrite: -- cgit v1.2.1