[ExecuTorch][ez] Propagate ops_to_not_decompose to config exception list#17404
[ExecuTorch][ez] Propagate ops_to_not_decompose to config exception list#17404meta-codesync[bot] merged 1 commit intogh/SS-JIA/427/basefrom
Conversation
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]
🔗 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 PendingAs of commit 40462bb with merge base 964c565 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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
This PR needs a
|
larryliu0820
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
08659c6
into
gh/SS-JIA/427/base
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
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_partitionersand passes them toEdgeProgramManager.__init__ascore_aten_ops_exception_list. However,EdgeProgramManagerdoes not store this list, so whentransform()is called later (e.g. withI64toI32passes), itsEXIREdgeDialectVerifiercreates a fresh verifier without the exception list. This causes aSpecViolationErrorfor any preserved op that is not in the core ATen opset.This was discovered while adding
torch.ops.aten.pixel_shuffle.defaultto the Vulkan backend'sops_not_to_decomposelist. The op was correctly preserved from decomposition, but the subsequenttransform()call into_edge_transform_and_lowerrejected it with: "Operator torch._ops.aten.pixel_shuffle.default is not in Core ATen opset".The fix merges
ops_to_not_decomposeintoconfig._core_aten_ops_exception_listbefore creating theEdgeProgramManager. Since the config object is propagated throughtransform()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_listfor ops that their partitioner already declares as not-to-decompose.Differential Revision: D93024955