-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add WhereDummyDq Transformer to form Node Unit #25576
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
Conversation
- Add a GraphTransformer WhereDummyDq to insert dummy DequantizeLinear on Where node's initializer input to form a Node Unit when Where node has one DQ and one scalar initializer input - Add corresponding unit test for the optimization
|
@microsoft-github-policy-service agree company="Qualcomm" |
|
Hi, the PR aims to improve the performance of QDQ models by removing additional QDQ nodes around where operator.
|
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 adds a new WhereDummyDq graph transformer to insert dummy DequantizeLinear nodes on Where node's initializer inputs to form Node Units when the Where node has one DQ input and one scalar initializer input. This optimization helps reduce additional Dequantize and Quantize nodes by enabling the WhereNodeGroupSelector::Check to pass.
Key changes:
- Added new
WhereDummyDqtransformer class that identifies Where nodes with mixed DQ and scalar inputs - Implemented logic to insert dummy DQ nodes with appropriate scale/zero-point values derived from existing DQ nodes
- Integrated the transformer into the optimization pipeline at Level1
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
where_dummy_dq.h |
Header file defining the WhereDummyDq transformer class interface |
where_dummy_dq.cc |
Implementation of the transformer logic including condition checking and dummy DQ insertion |
graph_transformer_utils.cc |
Integration of WhereDummyDq transformer into the Level1 optimization pipeline |
qdq_transformer_test.cc |
Unit tests covering various scenarios for the WhereDummyDq transformer |
|
/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline,Windows x64 QNN CI Pipeline |
|
Azure Pipelines successfully started running 5 pipeline(s). |
HectorSVC
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.
![]()
### Description - Add a GraphTransformer `WhereDummyDq` to insert dummy DequantizeLinear on Where node's initializer input to form a Node Unit when Where node has one DQ and one scalar initializer input - Add corresponding unit test for the optimization ### Motivation and Context - To reduce the additional Dequantize and Quantize nodes, we would like to pass `WhereNodeGroupSelector::Check`.
Description
WhereDummyDqto insert dummy DequantizeLinear on Where node's initializer input to form a Node Unit when Where node has one DQ and one scalar initializer inputMotivation and Context
WhereNodeGroupSelector::Check.