Repository navigation
Commit 2521ccb
authored
[xegpu] Generalize reduction schedule to work with nD inputs (#278)
Updates `reduction_schedule` so that KernelBench `level1/36_RMSNorm_.py`
case can be executed.
- Generalized `reduction_schedule` parameters: `wg_tile`, `sg_tile`,
`reduction_tile` parameters are n-D lists.
- Adds optional `wg_subtile` parameter to add a persistent for loop to
reduce WG tile size.
- Reductions are tiled with `tile_using_for`; avoids iter dim
permutation issue caused by `tile_reduction_using_for`.
- Applies `math-expand-ops` pass after vectorization; e.g. pow(x, 2) ->
x*x
- Adds `sink_extract_slice_into_loop` transform_ext op to avoid spurious
`vector.transfer_read/write` patterns.
- The common `vectorize` function takes
`disable_multi_reduction_to_contract_patterns` argument; Setting it
avoids converting `vector.multi_reduction` ops to `vector.contract`
which xegpu lowering does not support correctly at the moment.
Assisted-by: Claude1 parent 6968443 commit 2521ccb
8 files changed
Lines changed: 826 additions & 85 deletions
File tree
- examples/xegpu
- lighthouse
- dialects/transform/transform_ext
- ops
- schedule/xegpu
- test/transform
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
184 | 187 | | |
185 | 188 | | |
186 | 189 | | |
| |||
189 | 192 | | |
190 | 193 | | |
191 | 194 | | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
| 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 | + | |
200 | 220 | | |
201 | 221 | | |
202 | 222 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
211 | 239 | | |
212 | 240 | | |
213 | 241 | | |
| |||
609 | 637 | | |
610 | 638 | | |
611 | 639 | | |
612 | | - | |
| 640 | + | |
613 | 641 | | |
614 | 642 | | |
615 | 643 | | |
| |||
647 | 675 | | |
648 | 676 | | |
649 | 677 | | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
650 | 682 | | |
651 | 683 | | |
652 | 684 | | |
653 | 685 | | |
654 | 686 | | |
655 | | - | |
| 687 | + | |
656 | 688 | | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
657 | 692 | | |
658 | 693 | | |
659 | 694 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
265 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
266 | 267 | | |
267 | | - | |
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
255 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
256 | 257 | | |
257 | | - | |
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
0 commit comments