Move optimization passes from opt_level=0 to opt_level=1 (#18206)#18206
Move optimization passes from opt_level=0 to opt_level=1 (#18206)#18206meta-codesync[bot] merged 4 commits intomainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18206
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit 0626c21 with merge base 569cf41 ( 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. |
|
@mcremon-meta has exported this pull request. If you are a Meta employee, you can view the originating Diff in D96766073. |
This PR needs a
|
digantdesai
left a comment
There was a problem hiding this comment.
Any OSS visible impact from this? Stamping to unblock you.
d0dbde5 to
2748715
Compare
Summary: Pull Request resolved: #18239 As titled. Should perform better and also allow removing some permutes when convolutions are also moved to channel last. Differential Revision: D96869747 Reviewed By: hsharma35
Summary: Pull Request resolved: #18240 As titled. Calls into nnlib directly. Differential Revision: D96874522 Reviewed By: hsharma35
…better (#18256) Summary: Pull Request resolved: #18256 As titled. It is currently not cleaning up as much as it should, and the pass is only capable of handling single input cases. Result: from 9 to 1 (minimum by construction) permutes on Wake Gesture. Differential Revision: D96940254 Reviewed By: abeakkas
2748715 to
681810c
Compare
Summary:
Many passes in the cadence backend were incorrectly placed at opt_level=0
with outdated comments claiming ops like `mm`, `repeat`, `scalar_tensor`, `full_like`
were 'not supported'. These ops have portable kernel fallbacks, so
the passes are optimizations, not correctness requirements.
This diff:
1. Moves 18 passes from opt_level=0 to opt_level=1:
- replace_ops.py: ReplaceLogicalNotBooleanWhereWithWherePass,
ReplaceSafeSoftmaxWithSoftmax, ReplaceSqueezeAndUnsqueezeWithViewPass,
ReplaceFunctionallyEquivalentOpTargets, ReplaceMMWithAddMMPass,
ReplaceConvolutionOptionalArgsWithConcreteArgsPass, ReplaceRepeatWithCatPass,
ReplaceScalarTensorWithFullPass, ReplaceFullLikeWithFullPass,
ReplaceInfArgInFullWithValuePass, ReplaceMatmulWithTransposedMatmulPass
- remove_ops.py: RemoveCloneOpsTransformImported, RemoveDetachCopyPass,
RemoveZeroSizedCatArgsPass, RemoveNopExpandOpPass, RemoveToOpsPass,
RemoveAliasCopyOpPass
- decompose_ops.py: DecomposeAtenApproxGeluPass
- simplify_ops.py: SimplifySliceOpPass
2. Updates docstrings to remove incorrect 'not supported' claims and
clarify these are optimizations with portable fallbacks available.
Reviewed By: ethansfng
Differential Revision: D96766073
Summary:
Many passes in the cadence backend were incorrectly placed at opt_level=0
with outdated comments claiming ops like `mm`, `repeat`, `scalar_tensor`, `full_like`
were 'not supported'. These ops have portable kernel fallbacks, so
the passes are optimizations, not correctness requirements.
This diff:
1. Moves 18 passes from opt_level=0 to opt_level=1:
- replace_ops.py: ReplaceLogicalNotBooleanWhereWithWherePass,
ReplaceSafeSoftmaxWithSoftmax, ReplaceSqueezeAndUnsqueezeWithViewPass,
ReplaceFunctionallyEquivalentOpTargets, ReplaceMMWithAddMMPass,
ReplaceConvolutionOptionalArgsWithConcreteArgsPass, ReplaceRepeatWithCatPass,
ReplaceScalarTensorWithFullPass, ReplaceFullLikeWithFullPass,
ReplaceInfArgInFullWithValuePass, ReplaceMatmulWithTransposedMatmulPass
- remove_ops.py: RemoveCloneOpsTransformImported, RemoveDetachCopyPass,
RemoveZeroSizedCatArgsPass, RemoveNopExpandOpPass, RemoveToOpsPass,
RemoveAliasCopyOpPass
- decompose_ops.py: DecomposeAtenApproxGeluPass
- simplify_ops.py: SimplifySliceOpPass
2. Updates docstrings to remove incorrect 'not supported' claims and
clarify these are optimizations with portable fallbacks available.
Reviewed By: ethansfng
Differential Revision: D96766073
681810c to
a2eab64
Compare
Summary: Pull Request resolved: #18206 Many passes in the cadence backend were incorrectly placed at opt_level=0 with outdated comments claiming ops like `mm`, `repeat`, `scalar_tensor`, `full_like` were 'not supported'. These ops have portable kernel fallbacks, so the passes are optimizations, not correctness requirements. This diff: 1. Moves 18 passes from opt_level=0 to opt_level=1: - replace_ops.py: ReplaceLogicalNotBooleanWhereWithWherePass, ReplaceSafeSoftmaxWithSoftmax, ReplaceSqueezeAndUnsqueezeWithViewPass, ReplaceFunctionallyEquivalentOpTargets, ReplaceMMWithAddMMPass, ReplaceConvolutionOptionalArgsWithConcreteArgsPass, ReplaceRepeatWithCatPass, ReplaceScalarTensorWithFullPass, ReplaceFullLikeWithFullPass, ReplaceInfArgInFullWithValuePass, ReplaceMatmulWithTransposedMatmulPass - remove_ops.py: RemoveCloneOpsTransformImported, RemoveDetachCopyPass, RemoveZeroSizedCatArgsPass, RemoveNopExpandOpPass, RemoveToOpsPass, RemoveAliasCopyOpPass - decompose_ops.py: DecomposeAtenApproxGeluPass - simplify_ops.py: SimplifySliceOpPass 2. Updates docstrings to remove incorrect 'not supported' claims and clarify these are optimizations with portable fallbacks available. Reviewed By: ethansfng Differential Revision: D96766073
a2eab64 to
0626c21
Compare
)" This reverts commit bf2243a.
Summary:
Many passes in the cadence backend were incorrectly placed at opt_level=0
with outdated comments claiming ops like
mm,repeat,scalar_tensor,full_likewere 'not supported'. These ops have portable kernel fallbacks, so
the passes are optimizations, not correctness requirements.
This diff:
Moves 18 passes from opt_level=0 to opt_level=1:
ReplaceSafeSoftmaxWithSoftmax, ReplaceSqueezeAndUnsqueezeWithViewPass,
ReplaceFunctionallyEquivalentOpTargets, ReplaceMMWithAddMMPass,
ReplaceConvolutionOptionalArgsWithConcreteArgsPass, ReplaceRepeatWithCatPass,
ReplaceScalarTensorWithFullPass, ReplaceFullLikeWithFullPass,
ReplaceInfArgInFullWithValuePass, ReplaceMatmulWithTransposedMatmulPass
RemoveZeroSizedCatArgsPass, RemoveNopExpandOpPass, RemoveToOpsPass,
RemoveAliasCopyOpPass
Updates docstrings to remove incorrect 'not supported' claims and
clarify these are optimizations with portable fallbacks available.
Reviewed By: ethansfng
Differential Revision: D96766073