Skip to content

Delete deprecated QDQLayout and related code#4146

Merged
jerryzh168 merged 16 commits intomainfrom
gh/jerryzh168/62/head
Mar 24, 2026
Merged

Delete deprecated QDQLayout and related code#4146
jerryzh168 merged 16 commits intomainfrom
gh/jerryzh168/62/head

Conversation

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Mar 23, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4146

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.

@jerryzh168 jerryzh168 added the module: not user facing Use this tag if you don't want this PR to show up in release notes label Mar 23, 2026
@jerryzh168 jerryzh168 requested a review from metascroy March 23, 2026 21:15
@jerryzh168
Copy link
Copy Markdown
Contributor Author

@claude review

@claude
Copy link
Copy Markdown

claude bot commented Mar 23, 2026

Claude finished @jerryzh168's task in 1m 29s —— View job


Review: Delete deprecated QDQLayout and related code

  • Gather context and read changed files
  • Review the diff for correctness and completeness
  • Post review feedback

This is a clean deletion of deprecated code. The changes are straightforward and correct.

Summary of changes:

  • Deletes torchao/dtypes/uintx/q_dq_layout.py (253 lines) — the entire QDQLayout, QDQTensorImpl, and associated linear/embedding dispatch functions
  • Removes QDQLayout from the uintx and dtypes __init__.py exports
  • Removes the _linear_q_dq_check/_linear_q_dq_impl dispatch entry from _register_aqt_quantized_linear_dispatches() and the _embedding_q_dq_check/_embedding_q_dq_impl call from the embedding dispatch in affine_quantized_tensor_ops.py
  • Updates StretchedIntxWeightConfig.layout default from QDQLayout() to None in config_torchao.py

Observations:

  1. No remaining references — I verified with a full codebase grep for QDQLayout, QDQTensorImpl, and q_dq_layout. Zero matches remain, so this is a complete removal.

  2. StretchedIntxWeightConfig.layout change is safe — The layout field was changed from QDQLayout() to Optional[Layout] = None. The handler function _int8_dynamic_activation_stretched_intx_transform (config_torchao.py:51-109) doesn't reference config.layout at all (it uses IntxUnpackedToInt8Tensor directly for version 2), so this default value change has no functional impact.

  3. Embedding dispatch fallback — Previously, the embedding __torch_function__ handler checked for QDQLayout first and dequantized if matched. With this removed, any model that was using QDQLayout for embeddings would now fall through to the PlainAQTTensorImpl assertion at affine_quantized_tensor_ops.py:212. This is fine since QDQLayout was already deprecated and emitting warnings, and this is a deliberate removal.

  4. Linear dispatch removal — The QDQ linear dispatch entry was a simple dequantize-then-call-F.linear implementation. Its removal from the dispatch table is clean — the surrounding entries are unaffected.

Verdict: LGTM. Clean and complete deletion of deprecated code with no dangling references.

@jerryzh168 jerryzh168 changed the base branch from gh/jerryzh168/62/base to main March 24, 2026 15:05
@jerryzh168 jerryzh168 merged commit 749f472 into main Mar 24, 2026
22 of 33 checks passed
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. module: not user facing Use this tag if you don't want this PR to show up in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants