diff options
Diffstat (limited to 'ethosu')
-rw-r--r-- | ethosu/vela/live_range.py | 7 | ||||
-rw-r--r-- | ethosu/vela/nn_graph.py | 5 | ||||
-rw-r--r-- | ethosu/vela/reader_util.py | 4 |
3 files changed, 11 insertions, 5 deletions
diff --git a/ethosu/vela/live_range.py b/ethosu/vela/live_range.py index e9806026..b18afecc 100644 --- a/ethosu/vela/live_range.py +++ b/ethosu/vela/live_range.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright 2020-2022 Arm Limited and/or its affiliates <open-source-office@arm.com> +# SPDX-FileCopyrightText: Copyright 2020-2023 Arm Limited and/or its affiliates <open-source-office@arm.com> # # SPDX-License-Identifier: Apache-2.0 # @@ -282,6 +282,11 @@ def extract_live_ranges_from_cascaded_passes( rng = lr_graph.get_or_create_range(tens, cpu_tensor_alignment) rng.mark_usage(end_time) + # Variable tensor live-range is for entire inference + for tens, rng in lr_graph.ranges.items(): + if tens.is_variable: + rng.mark_usage(0, end_time + 1) + # Add subgraph to set of processed subgraphs lr_graph.processed_subgraphs.add(sg) return lr_graph diff --git a/ethosu/vela/nn_graph.py b/ethosu/vela/nn_graph.py index 98979f64..846632df 100644 --- a/ethosu/vela/nn_graph.py +++ b/ethosu/vela/nn_graph.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright 2020-2022 Arm Limited and/or its affiliates <open-source-office@arm.com> +# SPDX-FileCopyrightText: Copyright 2020-2023 Arm Limited and/or its affiliates <open-source-office@arm.com> # # SPDX-License-Identifier: Apache-2.0 # @@ -197,7 +197,8 @@ class Subgraph: if op.type in (Op.Placeholder, Op.SubgraphInput): assert len(op.outputs) == 1 - self.input_tensors.append(op.outputs[0]) + if not op.outputs[0].is_variable: + self.input_tensors.append(op.outputs[0]) for out in op.outputs: if out not in visit_tensor_set: diff --git a/ethosu/vela/reader_util.py b/ethosu/vela/reader_util.py index 78eb4366..d30a7bb3 100644 --- a/ethosu/vela/reader_util.py +++ b/ethosu/vela/reader_util.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright 2021-2022 Arm Limited and/or its affiliates <open-source-office@arm.com> +# SPDX-FileCopyrightText: Copyright 2021-2023 Arm Limited and/or its affiliates <open-source-office@arm.com> # # SPDX-License-Identifier: Apache-2.0 # @@ -56,7 +56,7 @@ def fixup_tensors(input_tensors, tensors): for tens in tensors: if not tens.ops: - op = Operation(Op.Const, tens.name) + op = Operation(Op.Placeholder if tens.is_variable else Op.Const, tens.name) op.set_output_tensor(tens) |