Repository navigation
[QNN EP] Add 2-bit BQ STD Symmetric Support - #787
Open
qti-ashwshan wants to merge 13 commits into
Open
qti-ashwshan wants to merge 13 commits into
qti-ashwshan wants to merge 13 commits into
Conversation
…encoding Use QNN_QUANTIZATION_ENCODING_BW_BLOCK_MAPPED with STANDARD_SYMMETRIC mapping for 2-bit weights with symmetric zero-points and 16-bit quantized activations. This keeps activations in int16 natively without the int16->fp16 Dequantize workaround needed by the BW_FLOAT_BLOCK path. - Add BwBlockMapped() factory and deep-copy support in QnnQuantParamsWrapper - Add IsBwBlockMapped() predicate and include in IsBlockQuantized() - Wire BW_BLOCK_MAPPED path in MatMulNBits op builder (ProcessInputs) - Skip DQ insertion and use native output dtype for BW_BLOCK_MAPPED (ProcessAttributesAndOutputs) - Add unit tests for W2A16 std symmetric with/without explicit ZP tensor
- Add unit test coverage
qti-ashwshan
force-pushed
the
dev/ashwshan/w2a16-bw-block-mapped
branch
from
September 12, 2026 04:36
dbbab47 to
e8e4368
Compare
qti-ashwshan
marked this pull request as ready for review
September 25, 2026 17:10
qti-ashwshan
requested review from
minfhong-qti,
qti-chuteng,
qti-shubham,
qti-yuduo,
tirupath-qti and
yuhuchua-qti
as code owners
September 25, 2026 17:10
1duo
reviewed
Sep 25, 2026
1duo
left a comment
Collaborator
There was a problem hiding this comment.
A few comments inline. #1 (matmulnbits_op_builder.cc, asymmetric W2A16 path) is blocking: it breaks the build on QAIRT ≥ 2.51 after the merge from main.
Also: BwBlockMapped() and the BW_BLOCK_MAPPED deep copy in Init (copy constructor and operator=) have no host-side tests in qnn_quant_params_wrapper_test.cc. The only coverage is the HTP integration tests, which need aarch64/Linux with V69+. A small host test should check that copies own their own blockSize/scaleOffset buffers, and that bitwidth and mapping survive the copy.
minfhong-qti
reviewed
Oct 1, 2026
qti-ashimaj
reviewed
Oct 5, 2026
qti-ashimaj
reviewed
Oct 5, 2026
qti-ashimaj
reviewed
Oct 9, 2026
Collaborator
|
@qti-ashwshan, Could you please check the failing existing as well as the BwBlockMapped TCs |
- Restrict native W2A16 to standard symmetry, SDK 2.52+, and supported v81+ shapes. - Preserve ONNX block-scale order and sign-extend unpacked INT2 weights. - Retain BW_FLOAT_BLOCK fallback and align native and wrapper tests.
- Keep SDK-version definitions for native W2A16 test gating. - Retain mainline accuracy-test enablement alongside the 2-bit changes.
- Scope SDK version macros to MatMulNBits tests. - Fix MatMulNBits clang-format alignment.
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
Motivation and Context