-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[QNN-EP] Support alternate Layernorm fusion pattern in QNN preprocess #26060
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[QNN-EP] Support alternate Layernorm fusion pattern in QNN preprocess #26060
Conversation
|
/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline |
|
Azure Pipelines successfully started running 4 pipeline(s). |
There was a problem hiding this comment.
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 extends the QNN preprocessor's LayerNorm fusion capability to recognize an alternate pattern where a Mul node (with both inputs being the same tensor) is used instead of a Pow node (with exponent 2.0) for computing the squared values. This is mathematically equivalent since x² = x * x, and some model exporters may generate this pattern.
Key Changes:
- Added documentation for the Mul-based LayerNorm fusion pattern
- Extended pattern matching to recognize Mul nodes in place of Pow nodes
- Added validation logic to ensure Mul nodes have matching inputs
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
yuslepukhin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![]()
|
Please, rebase off main |
1161fcd to
ebaa0cd
Compare
|
Rebased on top of tip |
|
/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows GPU CUDA CI Pipeline, Windows GPU DML CI Pipeline, Windows GPU Doc Gen CI Pipeline, Windows GPU TensorRT CI Pipeline, Windows OpenVINO CI Pipeline, Windows x64 QNN CI Pipeline |
|
Azure Pipelines successfully started running 4 pipeline(s). |
|
The CI error does not seem related to the change based on the logs. Not sure if this is known flaky behavior. @yuslepukhin, maybe worth retriggering it? |
|
Can you rebase/merge from main? #Resolved |
ebaa0cd to
591cbe1
Compare
|
Please, refrain from force pushing, this makes things longer. |
Rebased on top of current tip of main (1c02b79) |
My bad. For future reference, would it have been correct just to merge main into this branch, then? I'm much more familiar with stacked diff workflows (Gerrit), which would have would have preserved CI checks after a force-push to rebase. |
Yes, simply merging from main is the easiest and preferred way. |
|
/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows GPU CUDA CI Pipeline, Windows GPU DML CI Pipeline, Windows GPU Doc Gen CI Pipeline, Windows GPU TensorRT CI Pipeline, Windows OpenVINO CI Pipeline, Windows x64 QNN CI Pipeline |
|
Azure Pipelines successfully started running 4 pipeline(s). |
|
/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline |
|
Azure Pipelines successfully started running 4 pipeline(s). |
|
/azp run Windows ARM64 QNN CI Pipeline |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…microsoft#26060) ### Description Small change to allow QNN Preprocess to allow a Mul node (with A=B) instead of a Pow node (with Y=2) for layernorm fusion.
Description
Small change to allow QNN Preprocess to allow a Mul node (with A=B) instead of a Pow node (with Y=2) for layernorm fusion.