Commit 4d20289
authored
Optimize folding transposes that operate on splats (#2863)
Instead of expanding and iterating over the splat to create the new
constant, we now just replace the splat constant's dimensions as
specified by the transpose op.
When tested on the same input program that brought this issue to light,
this fix improved the optimizer's execution time from 8.68 s to 0.80 s,
a 985% speedup.1 parent ef07ca9 commit 4d20289
File tree
1 file changed
+4
-2
lines changed- stablehlo/transforms/optimization
1 file changed
+4
-2
lines changedLines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1549 | 1549 | | |
1550 | 1550 | | |
1551 | 1551 | | |
1552 | | - | |
1553 | 1552 | | |
1554 | | - | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
1555 | 1557 | | |
1556 | 1558 | | |
1557 | 1559 | | |
| |||
0 commit comments