Commit e022e34
authored
Arm backend: Make all partitioned Batchnorm2D to conv (#11148)
Batchnorm2Ds can be fused with preceeding convs.
For float, this is done in the FuseBatchnorm2dPass which with this patch
is updated to insert 'transparent' convs before stand-alone bns. This
way all bns are fused with convs instead of decomposed, so
DecomposeBatchNorm2DPass is removed.
For quantized, this is done by _fuse_conv_bn_(model) in the prepare_p2e
function, before the transform_for_annotation pipeline. This does not
allow us to modify the graph before the transform. Running our own
DecomposeBatchNorm2dPass before quantization on the other hand requires
modifying constant tensors before the export step which is a non trival
effort.
Since stand-alone batchnorms are not likely to be seen in real graphs,
instead simply do not accept quantized stand-alone batchnorms for now.
tosa_supported_operators is updated to give a better explanation in this
case.
Additionally refactors batchnorm unittest no be more brief and to more
properly reflect what works and not.
Signed-off-by: Adrian Lundell <[email protected]>1 parent 8edf7ab commit e022e34
File tree
8 files changed
+363
-684
lines changed- backends/arm
- _passes
- operator_support
- scripts
- test
- ops
- passes
8 files changed
+363
-684
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| |||
85 | 84 | | |
86 | 85 | | |
87 | 86 | | |
88 | | - | |
89 | 87 | | |
90 | 88 | | |
91 | 89 | | |
| |||
143 | 141 | | |
144 | 142 | | |
145 | 143 | | |
146 | | - | |
147 | 144 | | |
148 | 145 | | |
149 | 146 | | |
| |||
This file was deleted.
0 commit comments