Commit 9703bda
authored
[mlir][xegpu] Add OptimizeBlockLoads pass. (#165483)
This pass rewrites certain xegpu `CreateNd` and `LoadNd` operations that
feeds into `vector.transpose` to more optimal form to improve
performance. Specifically, low precision (bitwidth < 32) `LoadNd` ops
that feeds into transpose ops are rewritten to i32 loads with a valid
transpose layout such that later passes can use the load with transpose
HW feature to accelerate such load ops.
**Update:**
Pass is renamed to `OptimizeBlockLoads ` because later we plan to add
the array length optimization into this pass as well. This will break
down a larger load (like `32x32xf16`) into more DPAS-favorable array
length loads (`32x16xf16` with array length = 2). Both these
optmizations require rewriting `CreateNd` and `LoadNd` and it makes
sense to have a common pass for both.1 parent 2141edf commit 9703bda
File tree
8 files changed
+827
-30
lines changed- mlir
- include/mlir/Dialect/XeGPU
- Transforms
- Utils
- lib/Dialect/XeGPU
- Transforms
- Utils
- test/Dialect/XeGPU
8 files changed
+827
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
88 | 100 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
169 | 178 | | |
170 | 179 | | |
171 | 180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
Lines changed: 490 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 7 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | 207 | | |
230 | 208 | | |
231 | 209 | | |
| |||
505 | 483 | | |
506 | 484 | | |
507 | 485 | | |
508 | | - | |
| 486 | + | |
509 | 487 | | |
510 | 488 | | |
511 | 489 | | |
| |||
514 | 492 | | |
515 | 493 | | |
516 | 494 | | |
517 | | - | |
| 495 | + | |
518 | 496 | | |
519 | 497 | | |
520 | 498 | | |
| |||
634 | 612 | | |
635 | 613 | | |
636 | 614 | | |
637 | | - | |
| 615 | + | |
638 | 616 | | |
639 | 617 | | |
640 | 618 | | |
641 | 619 | | |
642 | 620 | | |
643 | 621 | | |
644 | 622 | | |
645 | | - | |
| 623 | + | |
646 | 624 | | |
647 | 625 | | |
648 | 626 | | |
| |||
662 | 640 | | |
663 | 641 | | |
664 | 642 | | |
665 | | - | |
| 643 | + | |
666 | 644 | | |
667 | 645 | | |
668 | 646 | | |
| |||
691 | 669 | | |
692 | 670 | | |
693 | 671 | | |
694 | | - | |
| 672 | + | |
695 | 673 | | |
696 | 674 | | |
697 | 675 | | |
| |||
700 | 678 | | |
701 | 679 | | |
702 | 680 | | |
703 | | - | |
| 681 | + | |
704 | 682 | | |
705 | 683 | | |
706 | 684 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
0 commit comments