Skip to content

Move backend-neutral Cadence passes to backends/transforms - #24469

Open
mcremon-meta wants to merge 1 commit into
mainfrom
export-D129173244
Open

mcremon-meta wants to merge 1 commit into
mainfrom
export-D129173244

Conversation

@mcremon-meta

Copy link
Copy Markdown
Contributor

Summary:
These 23 passes in backends/cadence/aot are not Cadence-specific in what
they do, so they move to backends/transforms where any backend can use them:

  • Three (FuseCascadedTransposeOrPermuteOps, FuseCascadedViewOps,
    ReplaceNopTransposeOrPermuteWithViewPass) were already empty subclasses of a
    backends/transforms pass, and stay as they are here.
  • The other 20 (including RemoveNopAsStridedCopyOpPass) move to
    backends/transforms, one module and target each. The ones that listed
    Cadence's q/dq ops alongside quantized_decomposed's now take those op sets as
    class attributes holding only the standard ops. Cadence keeps each pass under
    its old name as a thin subclass that adds its own ops back, so Cadence's
    behavior is unchanged.
  • FuseQuantDequantToRequantizePass needs a requantize op to fuse a pair whose
    qparams differ, and there is no backend-neutral one. The shared pass takes a
    requantize_op (default None) and defaults to allow_requantize=False;
    Cadence sets its op and keeps True.
  • permute_pass_utils gains get_overload_packet and get_placeholders, and
    quantize_reorder_utils holds the two op sets the reorder passes share.

Differential Revision: D129173244

Summary:
These 23 passes in `backends/cadence/aot` are not Cadence-specific in what
they do, so they move to `backends/transforms` where any backend can use them:

- Three (`FuseCascadedTransposeOrPermuteOps`, `FuseCascadedViewOps`,
  `ReplaceNopTransposeOrPermuteWithViewPass`) were already empty subclasses of a
  `backends/transforms` pass, and stay as they are here.
- The other 20 (including `RemoveNopAsStridedCopyOpPass`) move to
  `backends/transforms`, one module and target each. The ones that listed
  Cadence's q/dq ops alongside `quantized_decomposed`'s now take those op sets as
  class attributes holding only the standard ops. Cadence keeps each pass under
  its old name as a thin subclass that adds its own ops back, so Cadence's
  behavior is unchanged.
- `FuseQuantDequantToRequantizePass` needs a requantize op to fuse a pair whose
  qparams differ, and there is no backend-neutral one. The shared pass takes a
  `requantize_op` (default `None`) and defaults to `allow_requantize=False`;
  Cadence sets its op and keeps `True`.
- `permute_pass_utils` gains `get_overload_packet` and `get_placeholders`, and
  `quantize_reorder_utils` holds the two op sets the reorder passes share.

Differential Revision: D129173244
@mcremon-meta
mcremon-meta requested a review from rascani as a code owner November 2, 2026 21:40
@pytorch-bot

pytorch-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/24469

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure, 2 Unclassified Failures

As of commit 50d4ef5 with merge base 9975a72 (image):

NEW FAILURE - The following job has failed:

UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 2, 2026
@meta-codesync

meta-codesync Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

@mcremon-meta has exported this pull request. If you are a Meta employee, you can view the originating Diff in D129173244.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

This branch was previously deployed

1 inactive deployment
cadence — 50d4ef5d Deployed Nov 2, 2026 by mcremon-meta via hifi-op-test / hifi4 #36095
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant