[Qualcomm] Fix InsertIOQDQ KeyError for dequantize encodings#18601
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18601
Note: Links to docs will display an error until the docs builds have been completed. This comment was automatically generated by Dr. CI and updates every 15 minutes. |
220917a to
57b43d6
Compare
57b43d6 to
7ca2586
Compare
|
Hi @abhinaykukkadapu, the root cause of #17732 was having too many shards due to unsupported op like #16690. I believe the solution of #17732 has already been addressed in #17194. |
Thanks for taking a look, right this task is not 1-1 mapping but there is a comment on the task that refers to unavail dq in the map: #17732 (comment) Also #17194 got reverted in #17385 this change with |
7ca2586 to
f217857
Compare
f217857
into
pytorch:fix-insert-io-qdq-keyerror
fe06326 to
f217857
Compare
Something happened when force pushing the PR after rebase, it got merged to a feature branch with no files, opening a new PR: #18622 |
Summary:
q_dq_map only contains quantize ops as keys, so when a node with a dequantize encoding (e.g. a pre-quantized LLM parameter) feeds the output node, the lookup crashes with a KeyError.
Use q_dq_map.get(encoding, encoding) so that dequantize encodings fall back to themselves — which is already the correct dequantize target for output boundary insertion.
Fixes #17732