Repository navigation
Conversation
Summary: As PropagateViewCopyPermuteDownPass walks a permute down, it rewrites each node it crosses for the permute's input layout: the dims of a slice or reduction, and a binary op's constant input, which it permutes in place. When the fork at the end of the walk could not be split, the pass fell back to a pointwise region move planned from the permute's original position. That region stops at the first node it cannot include, such as a slice, a reduction or a backend op that is not pointwise, and left the crossed nodes from there on applying their rewritten dims or constants to the permuted tensor. For example, `permute(x, [0, 3, 1, 2]) -> clamp -> slice_copy(dim=1, 0, 4)` feeding both `permute(0, 2, 3, 1)` and `neg`, the pattern Arm's RewriteConvPass leaves around a channel split between convs, became `slice_copy(clamp(x), 2, 0, 4)`: for x of shape [1, 3, 5, 8] the outputs had shapes [1, 3, 4, 8] and [1, 8, 3, 4] instead of [1, 3, 5, 4] and [1, 4, 3, 5]. A keepdim sum in the same place made the pass raise while re-tracing, and a constant added after a crossed backend op that is not pointwise failed to broadcast or was broadcast along the wrong axis. Plan the region move only when the walk has not advanced. Otherwise the permute moves past the frontier, where every rewrite is valid, and the next iteration retries the fork from there. The test target now also depends on `//executorch/exir:lib`, for `to_edge`. Differential Revision: D130233379
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24739
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 Pending, 1 Unclassified FailureAs of commit 5b7c155 with merge base 97971ca ( UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@apullin has exported this pull request. If you are a Meta employee, you can view the originating Diff in D130233379. |
This PR needs a
|
Summary:
As PropagateViewCopyPermuteDownPass walks a permute down, it rewrites each node it crosses for the permute's input layout: the dims of a slice or reduction, and a binary op's constant input, which it permutes in place. When the fork at the end of the walk could not be split, the pass fell back to a pointwise region move planned from the permute's original position. That region stops at the first node it cannot include, such as a slice, a reduction or a backend op that is not pointwise, and left the crossed nodes from there on applying their rewritten dims or constants to the permuted tensor.
For example,
permute(x, [0, 3, 1, 2]) -> clamp -> slice_copy(dim=1, 0, 4)feeding bothpermute(0, 2, 3, 1)andneg, the pattern Arm's RewriteConvPass leaves around a channel split between convs, becameslice_copy(clamp(x), 2, 0, 4): for x of shape [1, 3, 5, 8] the outputs had shapes [1, 3, 4, 8] and [1, 8, 3, 4] instead of [1, 3, 5, 4] and [1, 4, 3, 5]. A keepdim sum in the same place made the pass raise while re-tracing, and a constant added after a crossed backend op that is not pointwise failed to broadcast or was broadcast along the wrong axis.Plan the region move only when the walk has not advanced. Otherwise the permute moves past the frontier, where every rewrite is valid, and the next iteration retries the fork from there.
The test target now also depends on
//executorch/exir:lib, forto_edge.Differential Revision: D130233379