Skip to content

Delete deprecated Int4XPULayout and related code#4147

Merged
jerryzh168 merged 18 commits intomainfrom
gh/jerryzh168/63/head
Mar 24, 2026
Merged

Delete deprecated Int4XPULayout and related code#4147
jerryzh168 merged 18 commits intomainfrom
gh/jerryzh168/63/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/4147

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
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 2m 21s —— View job


Review: Delete deprecated Int4XPULayout and related code

  • Gather context and read the diff
  • Check for remaining references to deleted code
  • Review each changed file
  • Post review summary

LGTM - This is a clean deletion of deprecated code with no loose ends.

Summary

This PR removes the deprecated Int4XPULayout class and all associated code (481 lines deleted). The changes span 5 files and are straightforward.

File-by-file review

  1. torchao/dtypes/uintx/int4_xpu_layout.py (deleted) - The entire file is removed. It contained Int4XPULayout, Int4XPUAQTTensorImpl, and two linear dispatch implementations. All of these were already marked deprecated with warnings pointing to issue #2752.

  2. torchao/dtypes/uintx/__init__.py - Clean removal of the Int4XPULayout import and __all__ entry. Remaining exports are intact.

  3. torchao/dtypes/__init__.py - Clean removal of Int4XPULayout from the import and __all__ list.

  4. torchao/dtypes/affine_quantized_tensor_ops.py - Removes the import of the four XPU-specific dispatch functions and their registration entries in _register_aqt_quantized_linear_dispatches(). The remaining dispatch registrations are unaffected.

  5. torchao/quantization/quant_api.py - Removes Int4XPULayout from the import, LAYOUT_TO_ZERO_POINT_DOMAIN, and LAYOUT_TO_PRESERVE_ZEROS dictionaries. Both dictionaries are still used by QAT code (torchao/quantization/qat/fake_quantize_config.py:393-397) with the remaining layouts.

Verification

I searched the entire codebase for any remaining references to Int4XPULayout, int4_xpu_layout, or Int4XPUAQTTensorImpl - no references remain. The deletion is complete.

No issues found.


@jerryzh168 jerryzh168 changed the base branch from gh/jerryzh168/63/base to main March 24, 2026 15:07
@jerryzh168 jerryzh168 changed the base branch from main to gh/jerryzh168/63/base March 24, 2026 15:08
@jerryzh168 jerryzh168 changed the base branch from gh/jerryzh168/63/base to main March 24, 2026 15:08
@jerryzh168 jerryzh168 merged commit bca91b0 into main Mar 24, 2026
17 of 19 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