Commit 554aecf
authored
Arm backend: Decompose integral float pow exponents (pytorch#19693)
Treat positive integral float scalar exponents like integer exponents in
DecomposeIntPowPass. This avoids lowering pow(x, 2.0) to TOSA POW, whose
reference model rejects negative bases even when the exponent is
mathematically integral.
Test Plan:
- lintrunner on changed files
- pytest test_decompose_int_pow_pass.py
- TinySwin2SR FP/INT TOSA reference smoke
cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils
@Sebastian-Larsson @robell @rascani
Signed-off-by: Usamah Zaheer <usamah.zaheer@arm.com>1 parent 161376d commit 554aecf
3 files changed
Lines changed: 55 additions & 16 deletions
File tree
- backends/arm
- _passes
- test
- ops
- passes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
24 | 36 | | |
25 | 37 | | |
26 | 38 | | |
| |||
43 | 55 | | |
44 | 56 | | |
45 | 57 | | |
46 | | - | |
| 58 | + | |
| 59 | + | |
47 | 60 | | |
48 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
49 | 70 | | |
50 | 71 | | |
51 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | 144 | | |
154 | 145 | | |
155 | 146 | | |
156 | 147 | | |
157 | 148 | | |
158 | | - | |
159 | | - | |
160 | 149 | | |
161 | 150 | | |
162 | 151 | | |
| |||
211 | 200 | | |
212 | 201 | | |
213 | 202 | | |
214 | | - | |
215 | | - | |
216 | 203 | | |
217 | 204 | | |
218 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
51 | 53 | | |
| 54 | + | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
57 | 65 | | |
58 | 66 | | |
59 | 67 | | |
| |||
74 | 82 | | |
75 | 83 | | |
76 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
0 commit comments