Skip to content

Commit c231967

Browse files
Andrew Grebenisanfacebook-github-bot
authored andcommitted
Interface for swapping inputs and outputs based on cost model + working permute example (#18929)
Summary: I have seen the following pattern quite a bit so far where we have wrapper(x0), wrapper(x1), x2 -> op -> wrapper(o0), o1 for example, and it is semantically equivalent to instead run x0, x1, wrapper(x2) -> op -> o0, wrapper(o1) In case 1, we had 3 wrapper ops, and in case 2, we have 2, so it's better to run 2. This interface formalizes this idea. I also implemented the pass which uses this interface for the permute case. What is really nice about this interface is that in a single pass, we can do a LOT of cleanup. See the docs in the diff for a case for adds. Differential Revision: D100917820
1 parent 2ba1b77 commit c231967

3 files changed

Lines changed: 877 additions & 2 deletions

File tree

0 commit comments

Comments
 (0)