Skip to content

[QNN:Bugfix] Guard against Conv/DepthwiseConv promotion to int8 when quantized weight is missing - #4760

Open
Qxinyu wants to merge 1 commit into
masterfrom
feature/qnn-conv-quant-weight-guard
Open

[QNN:Bugfix] Guard against Conv/DepthwiseConv promotion to int8 when quantized weight is missing#4760
Qxinyu wants to merge 1 commit into
masterfrom
feature/qnn-conv-quant-weight-guard

Conversation

@Qxinyu

@Qxinyu Qxinyu commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix _supportQuant in QNNBackend to check that Conv/DepthwiseConv actually has quantized weight data before returning true, mirroring the CPU backend's _convHasQuantWeight guard
  • Harden QNNConvolution and QNNConvDepthwise with null checks on ConvolutionCommon::load / getConvParameters return values
  • Check createWeightAndBias return value in onEncode to bail early on missing weights

Test plan

  • QNN conversion on a model with skip_quant_op_names containing a Conv op no longer crashes
  • Existing QNN regression tests pass

…quantized weight is missing

When a Conv/DepthwiseConv is listed in skip_quant_op_names but still
surrounded by int8 tensors, _supportQuant previously returned true,
causing the QNN Conv execution to dereference a null weight pointer
and crash. Add quantized-weight checks mirroring the CPU backend fix.
Also harden QNNConvolution/QNNConvDepthwise against null weight data
from ConvolutionCommon::load / getConvParameters.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants