Commit 33e2146
authored
[Codegen] Add corner case for SwapExtractWithCollapsePattern (iree-org#21773)
Fix the second case in iree-org#21660.
The performance got regression because the `collapse_shape` wasn't fused
into the nested loops properly. The example is a special case that the
collapsed offset is not from `affine.apply` op but directly a block
argument. After this fix, the performance of the example configuration
is improved together with the pre-padding work. To get an idea of perf
change for
`convbfp16 -n 16 -c 40 -H 192 -W 128 -k 40 -y 3 -x 3 -p 1 -q 1 -u 2 -v 2
-l 1 -j 1 -m conv -g 1 -F 1 -t 1 --in_layout NHWC --out_layout NHWC
--fil_layout NHWC --iter 100`
- Baseline without pre-padding: 452 us.
- Pre-padding without the fix: 920 us.
- Pre-padding with the fix: 220 us.
---------
Signed-off-by: yzhang93 <[email protected]>1 parent f1e9219 commit 33e2146
File tree
2 files changed
+68
-30
lines changed- compiler/src/iree/compiler/Codegen/Common
- GPU/test
2 files changed
+68
-30
lines changedLines changed: 28 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
551 | 577 | | |
552 | | - | |
| 578 | + | |
553 | 579 | | |
554 | 580 | | |
555 | 581 | | |
556 | 582 | | |
557 | 583 | | |
558 | 584 | | |
559 | | - | |
| 585 | + | |
560 | 586 | | |
561 | 587 | | |
562 | 588 | | |
| |||
Lines changed: 40 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
491 | | - | |
492 | | - | |
493 | 479 | | |
494 | 480 | | |
495 | 481 | | |
496 | 482 | | |
497 | 483 | | |
498 | | - | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
511 | 523 | | |
512 | 524 | | |
513 | | - | |
| 525 | + | |
514 | 526 | | |
515 | 527 | | |
516 | 528 | | |
| |||
0 commit comments