[QNN EP] Refactor LPBQ lowering helpers across op builders - #755
Open
qti-ashimaj wants to merge 5 commits into
Open
qti-ashimaj wants to merge 5 commits into
qti-ashimaj wants to merge 5 commits into
Conversation
qti-ashimaj
force-pushed
the
dev/qti-ashimaj/lpbqrefactor
branch
from
September 10, 2026 10:40
02bcf39 to
8d68fb7
Compare
qti-ashimaj
marked this pull request as ready for review
September 10, 2026 10:46
qti-ashimaj
requested review from
minfhong-qti,
qti-ashwshan,
qti-chuteng,
qti-kromero,
qti-shubham,
qti-yuduo,
tirupath-qti and
yuhuchua-qti
as code owners
September 10, 2026 10:46
qti-ashimaj
force-pushed
the
dev/qti-ashimaj/lpbqrefactor
branch
from
September 22, 2026 05:29
8d68fb7 to
34e7b1a
Compare
Collaborator
|
Could you help rebase on mainline and resolve the conflicts? |
qti-ashimaj
force-pushed
the
dev/qti-ashimaj/lpbqrefactor
branch
from
September 25, 2026 04:39
34e7b1a to
2504fc1
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Refactors the block-quantized (BQ) and LPBQ weight lowering logic across the QNN EP op builders (Conv, MatMul, MatMulNBits) to eliminate code duplication and consolidate shared helpers.
qnn_bq_utils:RegisterWeightAsConv1x1Filter: registers an LPBQ weight[K, N]as a[1, 1, K, N]HWCN 1×1 Conv2D filter, updating the LPBQ quant axis.AddConv2DNodeforBQLowering: creates a QNN Conv2D node (stride=1, pad=0, dilation=1, group=1) shared by both LPBQ and BwFloatBlock lowering paths.qnn_utils:ProcessBiasForQuantizedOp: handles bias processing for quantized ops, requantizes INT32 bias if scales mismatch or quantizes float bias usingactivation_scale * weight_scale[c].conv_op_builder: removed duplicated helpers (GetActivationScale,BuildBiasQuantParams,AddStaticBiasTensor,ProcessRequantizeBias,ProcessFloatBias).matmul_op_builder/matmulnbits_op_builder: updated to use the new shared helpers.matmul_test: enabledMatMulOp_QDQ_BlockQuanton Windows in addition to Linux.Motivation and Context
The LPBQ lowering code was duplicated across various op builders like
conv_op_builder,matmul_op_builder, andmatmulnbits_op_builder. This refactor centralizes the shared logic intoqnn_bq_utilsandqnn_utils, making future changes (e.g., adding LPBQ support to new op builders) require only a single implementation.