Commit fb5b788
authored
Reland "Arm backend: Rerun duplicate-user fusion after TOSA lowering" (pytorch#21380)
Late TOSA transformations can introduce equivalent operations after the
first FuseDuplicateUsersPass invocation. Rerun it after TOSA and shape
transformations, before output nodes are made unique.
Run InsertRescalePass after the final FuseDuplicateUsersPass. Fusing
generated RESCALE users can merge distinct quantized paths and produce
incorrect results.
TOSA-FP operator comparisons:
| Model | Before | After | Reduction |
|--------------------|-------:|------:|----------:|
| SD3 | 1,591 | 1,527 | 64 (4.0%) |
| Conformer delegate | 544 | 498 | 46 (8.5%) |
Reference-output tests pass with late fusion enabled.
Add regression coverage for late fusion, rescale insertion, and output
uniqueness pass ordering.
Change-Id: Ia4e2335e05b18d16b93c7e035a5502b8f050855c
Signed-off-by: Yufeng Shi <yufeng.shi@arm.com>1 parent 3aeaa80 commit fb5b788
2 files changed
Lines changed: 67 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
667 | 667 | | |
668 | 668 | | |
669 | 669 | | |
670 | | - | |
671 | 670 | | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
672 | 674 | | |
| 675 | + | |
673 | 676 | | |
674 | 677 | | |
675 | 678 | | |
| |||
Lines changed: 63 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
11 | 17 | | |
12 | 18 | | |
| 19 | + | |
13 | 20 | | |
14 | 21 | | |
15 | 22 | | |
16 | 23 | | |
| 24 | + | |
17 | 25 | | |
| 26 | + | |
18 | 27 | | |
19 | 28 | | |
20 | 29 | | |
| |||
167 | 176 | | |
168 | 177 | | |
169 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
0 commit comments