Skip to content

[Qualcomm] Fix InsertIOQDQ KeyError for dequantize encodings#18601

Merged
abhinaykukkadapu merged 0 commit intopytorch:fix-insert-io-qdq-keyerrorfrom
abhinaykukkadapu:fix-insert-io-qdq-keyerror
Mar 31, 2026
Merged

[Qualcomm] Fix InsertIOQDQ KeyError for dequantize encodings#18601
abhinaykukkadapu merged 0 commit intopytorch:fix-insert-io-qdq-keyerrorfrom
abhinaykukkadapu:fix-insert-io-qdq-keyerror

Conversation

@abhinaykukkadapu
Copy link
Copy Markdown
Contributor

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

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Mar 31, 2026

🔗 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.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 31, 2026
@abhinaykukkadapu abhinaykukkadapu force-pushed the fix-insert-io-qdq-keyerror branch from 220917a to 57b43d6 Compare March 31, 2026 02:54
@abhinaykukkadapu abhinaykukkadapu force-pushed the fix-insert-io-qdq-keyerror branch from 57b43d6 to 7ca2586 Compare March 31, 2026 02:56
@haowhsu-quic
Copy link
Copy Markdown
Collaborator

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.

@abhinaykukkadapu
Copy link
Copy Markdown
Contributor Author

abhinaykukkadapu commented Mar 31, 2026

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 list() semantics should pass the tests.

@abhinaykukkadapu abhinaykukkadapu force-pushed the fix-insert-io-qdq-keyerror branch from 7ca2586 to f217857 Compare March 31, 2026 20:16
@abhinaykukkadapu abhinaykukkadapu merged commit f217857 into pytorch:fix-insert-io-qdq-keyerror Mar 31, 2026
1 check passed
@abhinaykukkadapu abhinaykukkadapu force-pushed the fix-insert-io-qdq-keyerror branch from fe06326 to f217857 Compare March 31, 2026 20:21
@github-project-automation github-project-automation bot moved this from To triage to Done in ExecuTorch Core Mar 31, 2026
@abhinaykukkadapu abhinaykukkadapu deleted the fix-insert-io-qdq-keyerror branch March 31, 2026 20:35
@abhinaykukkadapu abhinaykukkadapu restored the fix-insert-io-qdq-keyerror branch March 31, 2026 20:43
@abhinaykukkadapu
Copy link
Copy Markdown
Contributor Author

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 list() semantics should pass the tests.

Something happened when force pushing the PR after rebase, it got merged to a feature branch with no files, opening a new PR: #18622

@abhinaykukkadapu abhinaykukkadapu deleted the fix-insert-io-qdq-keyerror branch March 31, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants