From cda4fcb0fd3e9766a161cf3e5aa7c3283e7f7c9e Mon Sep 17 00:00:00 2001 From: Tim Hall Date: Thu, 19 May 2022 12:36:58 +0100 Subject: MLBEDSW-6563: networks failing with memory area exceeded in vela - For allocations that have a hard memory limit the Hill Climb allocator should be given more attempts to find a solution that would fit - The fix is to use a memory limit when there is a hard constraint, and a minimum iteration count, reset on every improvement, when there is a soft constraint - Added maximum number iterations CLI option Signed-off-by: Tim Hall Change-Id: I19ff53a0b68412de280263626778a3102cbe52fa --- ethosu/vela/register_command_stream_generator.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ethosu/vela/register_command_stream_generator.py') diff --git a/ethosu/vela/register_command_stream_generator.py b/ethosu/vela/register_command_stream_generator.py index 0e68b140..2bdfda20 100644 --- a/ethosu/vela/register_command_stream_generator.py +++ b/ethosu/vela/register_command_stream_generator.py @@ -151,7 +151,7 @@ class CommandStreamEmitter: payload_mode = CmdMode(code & CmdMode.Mask) - s = f"0x{offset:06x}:" + s = f"{offset:#08x}:" if payload_mode == CmdMode.NoPayload: s += f" {'':8}" @@ -291,7 +291,11 @@ def check_mem_limits(memory_accesses: MemoryAccessSet, mem_limits: Dict[int, int if offset < 0: raise VelaError(f"Negative address offset: {offset}, region: {region}") if offset > max: - raise VelaError(f"Address offset out of range: {offset}, region: {region}, max: {max}") + raise VelaError( + f"Address offset out of range: {offset}, region: {region}, max: {max}. Perhaps try running" + f" with the HillClimb tensor allocator and/or increasing the maximum iteration of that" + f" allocator" + ) def quantise(value: float, quant: Optional[NpuQuantization]) -> int: -- cgit v1.2.1