Skip to content

Buck fwd-fix: wire up legalize_portable_dim_order_pass (#20971)#20971

Merged
psiddh merged 1 commit into
pytorch:mainfrom
psiddh:export-D112243998
Jul 16, 2026
Merged

Buck fwd-fix: wire up legalize_portable_dim_order_pass (#20971)#20971
psiddh merged 1 commit into
pytorch:mainfrom
psiddh:export-D112243998

Conversation

@psiddh

@psiddh psiddh commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary:

Forward fix for D111976876 (DiffTrain import of pytorch/executorch #20878). That diff added executorch/exir/passes/legalize_portable_dim_order_pass.py and imports LegalizePortableDimOrderPass at the top of exir/passes/__init__.py, but like every DiffTrain import it carried no Buck changes. Since exir/passes/BUCK uses explicit per-file srcs lists (no globs), the new module was never wired into any target, so importing executorch.exir.passes fails with ModuleNotFoundError: No module named 'executorch.exir.passes.legalize_portable_dim_order_pass'. This breaks every fbcode consumer of //executorch/exir/passes:lib, including the arm test listing for fold_scalar_mul_into_conv_pass (D112075757) and the residual backends/arm/test:* listing failures on D112027047.

This adds a legalize_portable_dim_order_pass runtime.python_library (deps mirror the sibling memory_format_ops_pass) and adds it to the :lib target deps, in both fbcode and xplat exir/passes/BUCK.

Authored with Claude Code.

Differential Revision: D112243998

@psiddh psiddh requested a review from JacobSzwejbka as a code owner July 16, 2026 01:16
Copilot AI review requested due to automatic review settings July 16, 2026 01:16
@psiddh psiddh requested a review from larryliu0820 as a code owner July 16, 2026 01:16
@pytorch-bot

pytorch-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ No Failures

As of commit d7b236f with merge base af62dce (image):
💚 Looks good so far! There are no failures yet. 💚

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 Jul 16, 2026
@meta-codesync

meta-codesync Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@psiddh has exported this pull request. If you are a Meta employee, you can view the originating Diff in D112243998.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Buck build wiring for LegalizePortableDimOrderPass by adding a dedicated runtime.python_library target for legalize_portable_dim_order_pass.py and ensuring it is pulled into executorch.exir.passes via the existing :lib target dependencies. This prevents ModuleNotFoundError when consumers import executorch.exir.passes under Buck.

Changes:

  • Add a new legalize_portable_dim_order_pass runtime.python_library target with the required deps.
  • Add :legalize_portable_dim_order_pass to the :lib target deps so the module is available when __init__.py imports it.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

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.

Summary:

Forward fix for D111976876 (DiffTrain import of pytorch/executorch pytorch#20878). That diff added `executorch/exir/passes/legalize_portable_dim_order_pass.py` and imports `LegalizePortableDimOrderPass` at the top of `exir/passes/__init__.py`, but like every DiffTrain import it carried no Buck changes. Since `exir/passes/BUCK` uses explicit per-file `srcs` lists (no globs), the new module was never wired into any target, so importing `executorch.exir.passes` fails with `ModuleNotFoundError: No module named 'executorch.exir.passes.legalize_portable_dim_order_pass'`. This breaks every fbcode consumer of `//executorch/exir/passes:lib`, including the arm test listing for `fold_scalar_mul_into_conv_pass` (D112075757) and the residual `backends/arm/test:*` listing failures on D112027047.

This adds a `legalize_portable_dim_order_pass` `runtime.python_library` (deps mirror the sibling `memory_format_ops_pass`) and adds it to the `:lib` target `deps`, in both `fbcode` and `xplat` `exir/passes/BUCK`.

Authored with Claude Code.

Differential Revision: D112243998
@meta-codesync meta-codesync Bot changed the title Buck fwd-fix: wire up legalize_portable_dim_order_pass Buck fwd-fix: wire up legalize_portable_dim_order_pass (#20971) Jul 16, 2026
@psiddh psiddh force-pushed the export-D112243998 branch from 9ce6799 to d7b236f Compare July 16, 2026 03:38
Copilot AI review requested due to automatic review settings July 16, 2026 03:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@psiddh psiddh merged commit 5decfcd into pytorch:main Jul 16, 2026
186 checks passed
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.

3 participants