aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/extract_npu_subgraphs.py
diff options
context:
space:
mode:
authorJacob Bohlin <jacob.bohlin@arm.com>2020-09-11 10:04:15 +0200
committerpatrik.gustavsson <patrik.gustavsson@arm.com>2020-09-17 08:18:50 +0000
commit1a66697b80a527af6d6dd1ed235199264696767e (patch)
tree447f19903eedb0ed163348769da28267ccf3bf47 /ethosu/vela/extract_npu_subgraphs.py
parent1356c2ab034738bcf51822de18911cc499fa2e8e (diff)
downloadethos-u-vela-1a66697b80a527af6d6dd1ed235199264696767e.tar.gz
MLBEDSW-2809: Redo the Tensor addressing
Added a static class TensorAddressMap that stores all Tensor addresses based on their equivalence_id. Made the "address" field into a property which getter and setter looks up/sets the tensor's address in TensorAddressMap. This makes the references to cpu_tensor/npu_tensor obsolete and they have been removed. Addition to scheduler: avoid SRAM spilling if an op has consumers in other subgraphs. Minor rework in LUTState; it will now assign a unique equivalence_id to the SHRAM lut tensor to avoid issues with addressing. The equivalent checks in LUTState now compares the values of the LUT instead of the the equivalence_id. Updated LUT unit tests accordingly. Signed-off-by: Jacob Bohlin <jacob.bohlin@arm.com> Change-Id: I41de5a8a4e5f07b77d6544d8d4034b754993e503
Diffstat (limited to 'ethosu/vela/extract_npu_subgraphs.py')
-rw-r--r--ethosu/vela/extract_npu_subgraphs.py6
1 files changed, 0 insertions, 6 deletions
diff --git a/ethosu/vela/extract_npu_subgraphs.py b/ethosu/vela/extract_npu_subgraphs.py
index 4adddc17..c0430b5d 100644
--- a/ethosu/vela/extract_npu_subgraphs.py
+++ b/ethosu/vela/extract_npu_subgraphs.py
@@ -70,10 +70,7 @@ def rewrite_tensor_cpu_producer_npu_consumers(
orig_tens, call_ps, startup_init_ps, npu_subgraph, cpu_subgraph, subgraph_for_pass
):
is_const = orig_tens.ops[0].type == "Const"
-
new_tens = orig_tens.clone("_npu")
- orig_tens.npu_tensor = new_tens
- new_tens.cpu_tensor = orig_tens
op_type = "SubgraphInput"
if is_const:
@@ -107,9 +104,6 @@ def rewrite_tensor_npu_producer_cpu_consumers(
):
new_tens = orig_tens.clone("_cpu")
- new_tens.npu_tensor = orig_tens
- orig_tens.cpu_tensor = new_tens
-
npu_subgraph.output_tensors.append(orig_tens)
call_ps.outputs.append(new_tens)