Qualcomm AI Engine Direct - Move QCOM_AXIS_ORDER pop into LayoutTransform pass - #21630
Qualcomm AI Engine Direct - Move QCOM_AXIS_ORDER pop into LayoutTransform pass#21630paul1106 wants to merge 1 commit into
Conversation
…form pass
Summary:
- The pop of QCOM_AXIS_ORDER was previously done in
QnnBackend._build_op_wrappers before calling
transform_for_preprocess_pipeline. Moving it into
LayoutTransform.call() when insert_permute=True keeps the cleanup
logic co-located with the code that depends on it.
The pop is necessary because the delegated subgraph is created via
deepcopy, which carries over the QCOM_AXIS_ORDER tags written by the
to-edge LayoutTransform run. Without clearing them, is_transformed_node()
returns True for every sensitive node in the
main for-loop, causing all traversals to be skipped and no permute
nodes to be inserted.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21630
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Cancelled Job, 1 Unclassified FailureAs of commit 08860de with merge base a2ae4b3 ( UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:
CANCELLED JOB - The following job was cancelled. Please retry:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
Hi @paul1106! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
|
This PR needs a
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a Qualcomm QNN preprocess pipeline issue by relocating cleanup of the QCOM_AXIS_ORDER FX-node metadata tag into the LayoutTransform pass, so the logic that depends on the tag also owns its lifecycle. This prevents a deep-copied delegated subgraph from incorrectly appearing “already transformed,” which previously caused layout-sensitive traversal to be skipped and permute insertion to be missed.
Changes:
- Remove
QCOM_AXIS_ORDERmetadata cleanup fromQnnBackend._build_op_wrappers. - Clear
QCOM_AXIS_ORDERinsideLayoutTransform.call()wheninsert_permuteis enabled, immediately before the permute-insertion traversal.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| backends/qualcomm/qnn_preprocess.py | Removes the pre-pass cleanup of QCOM_AXIS_ORDER from the backend wrapper build step. |
| backends/qualcomm/_passes/layout_transform.py | Adds targeted cleanup of QCOM_AXIS_ORDER within the LayoutTransform permute-insertion flow to avoid skipping sensitive nodes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
hi @psiddh could u have a look for my pr please, thanks ! |
|
@pytorchbot label "release notes: qualcomm" |
|
@claude review this pr |
|
Claude finished @psiddh's task in 1m 51s —— View job PR Review: Move
|
|
@paul1106 can you address this pls ? Meta CLA Check — Missing Contributor License Agreement! |
qti-horodnic
left a comment
There was a problem hiding this comment.
LGTM.
Minor: With this change, the following code block is now dead: https://github.com/pytorch/executorch/blob/main/backends/qualcomm/tests/rework/passes/passes_helper.py#L290-L295
Can you also remove it as part of this PR and run test_layout_transform in the rework framework to validate?
|
I you may want to rebase your PR to get past the Lint / link-check / lint-urls (pull_request) |
winskuo-quic
left a comment
There was a problem hiding this comment.
LGTM.
Thanks for moving this inside the LayoutTransform to improve readability.
|
@paul1106 can you complete Meta CLA Check ? |
Summary:
- The pop of QCOM_AXIS_ORDER was previously done in
QnnBackend._build_op_wrappers before calling
transform_for_preprocess_pipeline. Moving it into
LayoutTransform.call() when insert_permute=True keeps the cleanup
logic co-located with the code that depends on it.
The pop is necessary because the delegated subgraph is created via
deepcopy, which carries over the QCOM_AXIS_ORDER tags written by the
to-edge LayoutTransform run. Without clearing them, is_transformed_node()
returns True for every sensitive node in the
main for-loop, causing all traversals to be skipped and no permute
nodes to be inserted.
Test plan
cc @cccclai @winskuo-quic @shewu-quic @haowhsu-quic @DannyYuyang-quic @cbilgin @abhinaykukkadapu @psiddh