diff options
author | Patrik Gustavsson <patrik.gustavsson@arm.com> | 2020-10-01 08:22:10 +0200 |
---|---|---|
committer | Patrik Gustavsson <patrik.gustavsson@arm.com> | 2020-10-02 12:34:38 +0200 |
commit | 3010d9b5c90628e07c7d0f0c33e7355b8bc3e19d (patch) | |
tree | f0383ad0a88785e97ff4cf764f9a27b1be27f1dd /ethosu/vela/rewrite_graph.py | |
parent | 8912c5311d4ccf2ad1bbb57fdc71c1f25037f56e (diff) | |
download | ethos-u-vela-3010d9b5c90628e07c7d0f0c33e7355b8bc3e19d.tar.gz |
MLBEDSW-3060 Adjust check if weights fit in sram
When deciding if weights fit sram:
A compression of the weights has been added when a
weight compression test limit makes it impossible to
fit weights in a double buffer in sram.
The worst compression ratio from compression, is used
to decide if weights can be fit in sram.
Signed-off-by: Patrik Gustavsson <patrik.gustavsson@arm.com>
Change-Id: I9458769866b3f9fc15659185aae09658ed10fb38
Diffstat (limited to 'ethosu/vela/rewrite_graph.py')
-rw-r--r-- | ethosu/vela/rewrite_graph.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ethosu/vela/rewrite_graph.py b/ethosu/vela/rewrite_graph.py index e76e9617..e71b228a 100644 --- a/ethosu/vela/rewrite_graph.py +++ b/ethosu/vela/rewrite_graph.py @@ -24,7 +24,7 @@ # Post-order traversal, this does not support rewrites. Therefore, functions must return the original value. -def rewrite_graph_pre_order(sg, arch, tensor_rewrite_list, op_rewrite_list, rewrite_unsupported=True): +def rewrite_graph_pre_order(nng, sg, arch, tensor_rewrite_list, op_rewrite_list, rewrite_unsupported=True): op_visit_dict = dict() tens_visit_dict = dict() @@ -38,7 +38,7 @@ def rewrite_graph_pre_order(sg, arch, tensor_rewrite_list, op_rewrite_list, rewr prev_res = res for rewrite in op_rewrite_list: if res.run_on_npu or rewrite_unsupported: - res = rewrite(res, arch) + res = rewrite(res, arch, nng) op_visit_dict[op] = res op_visit_dict[res] = res @@ -64,7 +64,7 @@ def rewrite_graph_pre_order(sg, arch, tensor_rewrite_list, op_rewrite_list, rewr while prev_res != res: prev_res = res for rewrite in tensor_rewrite_list: - res = rewrite(res, arch) + res = rewrite(res, arch, nng) tens_visit_dict[tens] = res tens_visit_dict[res] = res |