Skip to content

Conversation

@qti-mattsinc
Copy link
Contributor

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.

@HectorSVC HectorSVC added the ep:QNN issues related to QNN exeution provider label Sep 16, 2025
@HectorSVC
Copy link
Contributor

/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
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

Copy link
Contributor

Copilot AI left a 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.

Copy link
Member

@yuslepukhin yuslepukhin left a comment

Choose a reason for hiding this comment

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

:shipit:

@yuslepukhin
Copy link
Member

Please, rebase off main

@qti-mattsinc qti-mattsinc force-pushed the dev/mattsinc/AISW-148002 branch 2 times, most recently from 1161fcd to ebaa0cd Compare January 12, 2026 23:29
@qti-mattsinc
Copy link
Contributor Author

Rebased on top of tip

@yuslepukhin
Copy link
Member

/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
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@qti-mattsinc
Copy link
Contributor Author

qti-mattsinc commented Jan 15, 2026

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?

@yuslepukhin
Copy link
Member

yuslepukhin commented Jan 15, 2026

Can you rebase/merge from main? #Resolved

@qti-mattsinc qti-mattsinc force-pushed the dev/mattsinc/AISW-148002 branch from ebaa0cd to 591cbe1 Compare January 15, 2026 22:47
@yuslepukhin
Copy link
Member

Please, refrain from force pushing, this makes things longer.

@qti-mattsinc
Copy link
Contributor Author

Can you rebase/merge from main?

Rebased on top of current tip of main (1c02b79)

@qti-mattsinc
Copy link
Contributor Author

qti-mattsinc commented Jan 15, 2026

Please, refrain from force pushing, this makes things longer.

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.

@yuslepukhin
Copy link
Member

Please, refrain from force pushing, this makes things longer.

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.

@yuslepukhin
Copy link
Member

/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
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@yuslepukhin
Copy link
Member

/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
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@yuslepukhin
Copy link
Member

/azp run Windows ARM64 QNN CI Pipeline

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yuslepukhin yuslepukhin merged commit e7dfd69 into microsoft:main Jan 16, 2026
90 of 91 checks passed
alex-spacemit pushed a commit to spacemit-com/onnxruntime that referenced this pull request Jan 20, 2026
…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.
tianleiwu pushed a commit that referenced this pull request Jan 21, 2026
…#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.

(cherry picked from commit e7dfd69)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ep:QNN issues related to QNN exeution provider release:1.24.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants