From 9070f0f1d9ee0fbf2cc3ee62a60f9b600bd62055 Mon Sep 17 00:00:00 2001 From: Johan Alfven Date: Tue, 7 Feb 2023 13:01:03 +0100 Subject: MLBEDSW-7316: Fix crash for networks with resource variables - The problem was that networks with resource variables have not been thought of. The major problem was the graph traversal where these ops were not visited resulting in an empty subgraph that resulted in the crash. - Fixed the problem by attaching virtual tensors to the ops simulating subgraph output. These tensors are only used to get the graph traversal to work. - Fixed serializing of attribute container and shared_name - Fixed subgraph index for operator CallOnce - All resource variable ops are pushed to the CPU Change-Id: I815f9c81baf7a3fbb686e895980b462f58208b6e Signed-off-by: Johan Alfven --- ethosu/vela/mark_tensors.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ethosu/vela/mark_tensors.py') diff --git a/ethosu/vela/mark_tensors.py b/ethosu/vela/mark_tensors.py index 64cc7883..4b5bf1dc 100644 --- a/ethosu/vela/mark_tensors.py +++ b/ethosu/vela/mark_tensors.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright 2020-2021 Arm Limited and/or its affiliates +# SPDX-FileCopyrightText: Copyright 2020-2023 Arm Limited and/or its affiliates # # SPDX-License-Identifier: Apache-2.0 # @@ -41,6 +41,8 @@ def mark_purpose(tens, arch, purpose): # Sets tensor's purpose, format, mem_area and mem_type if tens.purpose == TensorPurpose.Unknown: tens.purpose = purpose + elif tens.purpose == TensorPurpose.Virtual: + return elif tens.purpose not in (purpose, TensorPurpose.LUT): assert 0, "Cannot resolve tensor purpose {} and {} for tensor {}".format(tens.purpose, purpose, tens) -- cgit v1.2.1