Skip to content

[ExecuTorch][ez] Propagate ops_to_not_decompose to config exception list#17404

Merged
meta-codesync[bot] merged 1 commit intogh/SS-JIA/427/basefrom
gh/SS-JIA/427/head
Feb 12, 2026
Merged

[ExecuTorch][ez] Propagate ops_to_not_decompose to config exception list#17404
meta-codesync[bot] merged 1 commit intogh/SS-JIA/427/basefrom
gh/SS-JIA/427/head

Conversation

@SS-JIA
Copy link
Copy Markdown
Contributor

@SS-JIA SS-JIA commented Feb 11, 2026

Stack from ghstack (oldest at bottom):

When a partitioner declares ops in ops_to_not_decompose(), the framework preserves them from decomposition during _gen_edge_manager_for_partitioners and passes them to EdgeProgramManager.__init__ as core_aten_ops_exception_list. However, EdgeProgramManager does not store this list, so when transform() is called later (e.g. with I64toI32 passes), its EXIREdgeDialectVerifier creates a fresh verifier without the exception list. This causes a SpecViolationError for any preserved op that is not in the core ATen opset.

This was discovered while adding torch.ops.aten.pixel_shuffle.default to the Vulkan backend's ops_not_to_decompose list. The op was correctly preserved from decomposition, but the subsequent transform() call in to_edge_transform_and_lower rejected it with: "Operator torch._ops.aten.pixel_shuffle.default is not in Core ATen opset".

The fix merges ops_to_not_decompose into config._core_aten_ops_exception_list before creating the EdgeProgramManager. Since the config object is propagated through transform() and its verifier, the exception list is now available at every verification point. This eliminates the need for callers to manually set _core_aten_ops_exception_list for ops that their partitioner already declares as not-to-decompose.

Differential Revision: D93024955

When a partitioner declares ops in `ops_to_not_decompose()`, the framework preserves them from decomposition during `_gen_edge_manager_for_partitioners` and passes them to `EdgeProgramManager.__init__` as `core_aten_ops_exception_list`. However, `EdgeProgramManager` does not store this list, so when `transform()` is called later (e.g. with `I64toI32` passes), its `EXIREdgeDialectVerifier` creates a fresh verifier without the exception list. This causes a `SpecViolationError` for any preserved op that is not in the core ATen opset.

This was discovered while adding `torch.ops.aten.pixel_shuffle.default` to the Vulkan backend's `ops_not_to_decompose` list. The op was correctly preserved from decomposition, but the subsequent `transform()` call in `to_edge_transform_and_lower` rejected it with: "Operator torch._ops.aten.pixel_shuffle.default is not in Core ATen opset".

The fix merges `ops_to_not_decompose` into `config._core_aten_ops_exception_list` before creating the `EdgeProgramManager`. Since the config object is propagated through `transform()` and its verifier, the exception list is now available at every verification point. This eliminates the need for callers to manually set `_core_aten_ops_exception_list` for ops that their partitioner already declares as not-to-decompose.

Differential Revision: [D93024955](https://our.internmc.facebook.com/intern/diff/D93024955/)

[ghstack-poisoned]
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Feb 11, 2026

🔗 Helpful Links

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

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

⏳ No Failures, 1 Pending

As of commit 40462bb with merge base 964c565 (image):
💚 Looks good so far! There are no failures yet. 💚

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

SS-JIA pushed a commit that referenced this pull request Feb 11, 2026
When a partitioner declares ops in `ops_to_not_decompose()`, the framework preserves them from decomposition during `_gen_edge_manager_for_partitioners` and passes them to `EdgeProgramManager.__init__` as `core_aten_ops_exception_list`. However, `EdgeProgramManager` does not store this list, so when `transform()` is called later (e.g. with `I64toI32` passes), its `EXIREdgeDialectVerifier` creates a fresh verifier without the exception list. This causes a `SpecViolationError` for any preserved op that is not in the core ATen opset.

This was discovered while adding `torch.ops.aten.pixel_shuffle.default` to the Vulkan backend's `ops_not_to_decompose` list. The op was correctly preserved from decomposition, but the subsequent `transform()` call in `to_edge_transform_and_lower` rejected it with: "Operator torch._ops.aten.pixel_shuffle.default is not in Core ATen opset".

The fix merges `ops_to_not_decompose` into `config._core_aten_ops_exception_list` before creating the `EdgeProgramManager`. Since the config object is propagated through `transform()` and its verifier, the exception list is now available at every verification point. This eliminates the need for callers to manually set `_core_aten_ops_exception_list` for ops that their partitioner already declares as not-to-decompose.

Differential Revision: [D93024955](https://our.internmc.facebook.com/intern/diff/D93024955/)

ghstack-source-id: 340487662
Pull Request resolved: #17404
@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 Feb 11, 2026
@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.

Copy link
Copy Markdown
Contributor

@larryliu0820 larryliu0820 left a comment

Choose a reason for hiding this comment

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

Review automatically exported from Phabricator review in Meta.

@meta-codesync meta-codesync Bot merged commit 08659c6 into gh/SS-JIA/427/base Feb 12, 2026
188 of 192 checks passed
@meta-codesync meta-codesync Bot deleted the gh/SS-JIA/427/head branch February 12, 2026 04:51
SS-JIA pushed a commit that referenced this pull request Feb 12, 2026
When a partitioner declares ops in `ops_to_not_decompose()`, the framework preserves them from decomposition during `_gen_edge_manager_for_partitioners` and passes them to `EdgeProgramManager.__init__` as `core_aten_ops_exception_list`. However, `EdgeProgramManager` does not store this list, so when `transform()` is called later (e.g. with `I64toI32` passes), its `EXIREdgeDialectVerifier` creates a fresh verifier without the exception list. This causes a `SpecViolationError` for any preserved op that is not in the core ATen opset.

This was discovered while adding `torch.ops.aten.pixel_shuffle.default` to the Vulkan backend's `ops_not_to_decompose` list. The op was correctly preserved from decomposition, but the subsequent `transform()` call in `to_edge_transform_and_lower` rejected it with: "Operator torch._ops.aten.pixel_shuffle.default is not in Core ATen opset".

The fix merges `ops_to_not_decompose` into `config._core_aten_ops_exception_list` before creating the `EdgeProgramManager`. Since the config object is propagated through `transform()` and its verifier, the exception list is now available at every verification point. This eliminates the need for callers to manually set `_core_aten_ops_exception_list` for ops that their partitioner already declares as not-to-decompose.

Differential Revision: [D93024955](https://our.internmc.facebook.com/intern/diff/D93024955/)

ghstack-source-id: 340487662
Pull Request resolved: #17404
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants