aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/npu_performance.py
diff options
context:
space:
mode:
authorTim Hall <tim.hall@arm.com>2020-11-01 20:59:36 +0000
committerTim Hall <tim.hall@arm.com>2020-11-20 12:55:47 +0000
commit1bd531dec0b4eb745fb8856d14c1aba2b8a73026 (patch)
treea0265a0accd2395277fe88be27164d09541abc7f /ethosu/vela/npu_performance.py
parentc8a73868d40cf63380f634baeb51aa7aa993fc0c (diff)
downloadethos-u-vela-1bd531dec0b4eb745fb8856d14c1aba2b8a73026.tar.gz
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 <tim.hall@arm.com> Change-Id: I27c41577e37a3859edb9524cd99784be10ef0a0d
Diffstat (limited to 'ethosu/vela/npu_performance.py')
-rw-r--r--ethosu/vela/npu_performance.py32
1 files changed, 7 insertions, 25 deletions
diff --git a/ethosu/vela/npu_performance.py b/ethosu/vela/npu_performance.py
index 29e0df9a..d1be5a50 100644
--- a/ethosu/vela/npu_performance.py
+++ b/ethosu/vela/npu_performance.py
@@ -60,7 +60,6 @@ def rolling_buffer_dims_from_passes(arch, ps1, block_config_ps1, ps2, block_conf
class PassCycles(IntEnum):
Npu = 0
- Cpu = auto()
SramAccess = auto()
DramAccess = auto()
OnChipFlashAccess = auto()
@@ -69,34 +68,19 @@ class PassCycles(IntEnum):
Size = auto()
def display_name(self):
- return (
- "NPU",
- "CPU",
- "SRAM Access",
- "DRAM Access",
- "On-chip Flash Access",
- "Off-chip Flash Access",
- "Total",
- "Size",
- )[self.value]
+ return ("NPU", "SRAM Access", "DRAM Access", "On-chip Flash Access", "Off-chip Flash Access", "Total", "Size",)[
+ self.value
+ ]
def identifier_name(self):
- return (
- "npu",
- "cpu",
- "sram_access",
- "dram_access",
- "on_chip_flash_access",
- "off_chip_flash_access",
- "total",
- "size",
- )[self.value]
+ return ("npu", "sram_access", "dram_access", "on_chip_flash_access", "off_chip_flash_access", "total", "size",)[
+ self.value
+ ]
@staticmethod
def all():
return (
PassCycles.Npu,
- PassCycles.Cpu,
PassCycles.SramAccess,
PassCycles.DramAccess,
PassCycles.OnChipFlashAccess,
@@ -460,9 +444,7 @@ def performance_metrics_for_pass(arch, ps, block_config=None, rewrite_list=[], f
ofm_block = Block(block_config[1], block_config[0], block_config[3])
ifm_block = Block(block_config[1], block_config[0], block_config[3])
- if ps.placement == PassPlacement.Cpu:
- cycles[PassCycles.Cpu] = arch.cpu_cycle_estimate(ps.ops[0])
- elif primary_op:
+ if ps.placement == PassPlacement.Npu and primary_op:
skirt = primary_op.attrs.get("skirt", skirt)
explicit_padding = primary_op.attrs.get("explicit_padding", explicit_padding)
assert primary_op.type.npu_block_type == ps.npu_block_type