Interface for swapping inputs and outputs based on cost model + working permute example#18929
Interface for swapping inputs and outputs based on cost model + working permute example#18929DrJessop wants to merge 2 commits intopytorch:mainfrom
Conversation
Summary: - Adds support to run to run passes on ExportedPrograms and EdgeProgramManager - EdgeProgramManager transform behaves basically like a pass manager Reviewed By: larryliu0820, ethansfng Differential Revision: D91725222
…ng permute example 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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18929
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New Failures, 1 Cancelled Job, 2 Unrelated FailuresAs of commit c5916b3 with merge base 2f339f0 ( NEW FAILURES - The following jobs have failed:
CANCELLED JOB - The following job was cancelled. Please retry:
BROKEN TRUNK - The following jobs failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@DrJessop has exported this pull request. If you are a Meta employee, you can view the originating Diff in D100917820. |
This PR needs a
|
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