-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[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
base: main
Are you sure you want to change the base?
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 |
71d4556 to
1161fcd
Compare
1161fcd to
ebaa0cd
Compare
|
Rebased on top of tip |
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.