diff options
author | Louis Verhaard <louis.verhaard@arm.com> | 2020-05-07 08:12:58 +0200 |
---|---|---|
committer | Tim Hall <tim.hall@arm.com> | 2020-06-18 17:53:52 +0100 |
commit | 3c07c97e0202c1cf01eba06c24b37a8f15ff7a7c (patch) | |
tree | 5856b7727a99b3c0baa00f5486f0c3b53e8e38e6 /ethosu/vela/compiler_driver.py | |
parent | 86d49935c3736c7aaa419abda07fa20c37c991a8 (diff) | |
download | ethos-u-vela-3c07c97e0202c1cf01eba06c24b37a8f15ff7a7c.tar.gz |
MLBEDSW-1941: Bug fix shared weights
If same weight tensor was used with different block configs,
errors would occur.
Fixed by always cloning weight tensors, using a global weight
compression cache and modifying the linear allocator to
detect multiple usage of same weight compression.
Change-Id: I91ca59176e1c59c66e0ac7a4227f2b5f0b47053f
Signed-off-by: Louis Verhaard <louis.verhaard@arm.com>
Diffstat (limited to 'ethosu/vela/compiler_driver.py')
-rw-r--r-- | ethosu/vela/compiler_driver.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ethosu/vela/compiler_driver.py b/ethosu/vela/compiler_driver.py index 64aff06b..b6a98a64 100644 --- a/ethosu/vela/compiler_driver.py +++ b/ethosu/vela/compiler_driver.py @@ -144,13 +144,14 @@ def compiler_driver(nng, arch, options, scheduler_options): # processed first during serialization into tensors first_npu_sg = nng.subgraphs[1] assert first_npu_sg.placement == PassPlacement.Npu + # Use the linear allocator for constant tensors tensor_allocation.allocate_tensors( nng, first_npu_sg, arch, permanent_storage, scheduler_options.use_ifm_ofm_overlap, - options.tensor_allocator, + TensorAllocator.LinearAlloc, options.verbose_allocation, options.show_minimum_possible_allocation, lr_graph_flash, @@ -195,7 +196,7 @@ def compiler_driver(nng, arch, options, scheduler_options): arch, permanent_storage, scheduler_options.use_ifm_ofm_overlap, - options.tensor_allocator, + TensorAllocator.LinearAlloc, options.verbose_allocation, options.show_minimum_possible_allocation, ) |