Skip to content

Delete deprecated GemlitePackedLayout and GemliteUIntXWeightOnlyConfig#4144

Merged
jerryzh168 merged 12 commits intomainfrom
gh/jerryzh168/60/head
Mar 24, 2026
Merged

Delete deprecated GemlitePackedLayout and GemliteUIntXWeightOnlyConfig#4144
jerryzh168 merged 12 commits intomainfrom
gh/jerryzh168/60/head

Conversation

@jerryzh168
Copy link
Copy Markdown
Contributor

@jerryzh168 jerryzh168 commented Mar 23, 2026

Stack from ghstack (oldest at bottom):

Deprecation Notes:
GemliteUIntXWeightOnlyConfig is now replaced with torchao.prototype.UIntxWeightOnlyConfig and Int8DynamicActivationUIntxWeightConfig

# 0.16:
GemliteUIntXWeightOnlyConfig(group_size, bit_width, packing_bitwidth, mode="weight_only")
GemliteUIntXWeightOnlyConfig(group_size, bit_width, packing_bitwidth, mode="dynamic")
# 0.17
UIntxWeightOnlyConfig(group_size, bit_width, packing_bitwidth)
Int8DynamicActivationUIntxWeightConfig(group_size, bit_width, packing_bitwidth)

@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/4144

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: deprecation Use this tag if this PR deprecates a feature label Mar 23, 2026
…GemliteUIntXWeightOnlyConfig"



Deprecation Notes:
GemliteUIntXWeightOnlyConfig is now replaced with torchao.prototype.UIntxWeightOnlyConfig and Int8DynamicActivationUIntxWeightConfig
```
# 0.16:
GemliteUIntXWeightOnlyConfig(group_size, bit_width, packing_bitwidth, mode="weight_only")
GemliteUIntXWeightOnlyConfig(group_size, bit_width, packing_bitwidth, mode="dynamic")
# 0.17
UIntxWeightOnlyConfig(group_size, bit_width, packing_bitwidth)
Int8DynamicActivationUIntxWeightConfig(group_size, bit_width, packing_bitwidth)
```


[ghstack-poisoned]
…htOnlyConfig"



Deprecation Notes:
GemliteUIntXWeightOnlyConfig is now replaced with torchao.prototype.UIntxWeightOnlyConfig and Int8DynamicActivationUIntxWeightConfig
```
# 0.16:
GemliteUIntXWeightOnlyConfig(group_size, bit_width, packing_bitwidth, mode="weight_only")
GemliteUIntXWeightOnlyConfig(group_size, bit_width, packing_bitwidth, mode="dynamic")
# 0.17
UIntxWeightOnlyConfig(group_size, bit_width, packing_bitwidth)
Int8DynamicActivationUIntxWeightConfig(group_size, bit_width, packing_bitwidth)
```


[ghstack-poisoned]
@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 9s —— View job


Review: Delete deprecated GemlitePackedLayout and GemliteUIntXWeightOnlyConfig

  • Gather context and read the diff
  • Review deleted files for completeness
  • Review modified files for correctness
  • Check for any remaining references to deleted code
  • Post review feedback

Overall this is a clean deprecation removal. The diff is straightforward — removing the deprecated GemliteUIntXWeightOnlyConfig, GemlitePackedLayout, and all associated code (layout implementation, dispatch registration, tests). The replacement APIs (UIntxWeightOnlyConfig and Int8DynamicActivationUIntxWeightConfig) in torchao.prototype remain intact.

Findings

Leftover references to deleted code (not cleaned up in this PR):

  1. benchmarks/microbenchmarks/utils.py:19,244 — Still imports and uses GemliteUIntXWeightOnlyConfig. This will cause an ImportError at runtime when the benchmarking utils are used with the gemlitewo config string.

    Fix this →

  2. docs/source/contributing/benchmarking_api_guide.md:34 — Still references GemliteUIntXWeightOnlyConfig as an example in the docs.

    Fix this →

  3. torchao/testing/utils.py:180 — The skip_if_no_gemlite() test decorator is still defined. While it's not necessarily wrong to keep it (gemlite is still used by the prototype UIntxWeightOnlyConfig), this PR removes the only test file that imported it (test_affine_quantized.py removed its import). Worth checking if any other tests still use it.

Minor observation in the diff:

  1. In test/quantization/test_quant_api.py, the removal of the try: import gemlite block also moved the MXDynamicActivationMXWeightConfig / NVFP4DynamicActivationNVFP4WeightConfig imports to a different position in the file (from after the gemlite block to before the torchao.quantization imports). This is fine — just import reordering with no functional change.

  2. In test/quantization/test_quant_api.py:362, after the removal of the two GemliteUIntXWeightOnlyConfig conditionals, there's a dangling blank line left behind (the elif and the dtype override are removed, leaving an extra blank line before dtype = torch.bfloat16). Very minor nit, no functional impact.

Verdict

The core deletion is correct and complete. The two leftover references in benchmarks/ and docs/ (items 1 and 2) should be addressed to avoid import errors and stale documentation. These could be fixed in this PR or a follow-up.


…GemliteUIntXWeightOnlyConfig"



Deprecation Notes:
GemliteUIntXWeightOnlyConfig is now replaced with torchao.prototype.UIntxWeightOnlyConfig and Int8DynamicActivationUIntxWeightConfig
```
# 0.16:
GemliteUIntXWeightOnlyConfig(group_size, bit_width, packing_bitwidth, mode="weight_only")
GemliteUIntXWeightOnlyConfig(group_size, bit_width, packing_bitwidth, mode="dynamic")
# 0.17
UIntxWeightOnlyConfig(group_size, bit_width, packing_bitwidth)
Int8DynamicActivationUIntxWeightConfig(group_size, bit_width, packing_bitwidth)
```


[ghstack-poisoned]
…htOnlyConfig"



Deprecation Notes:
GemliteUIntXWeightOnlyConfig is now replaced with torchao.prototype.UIntxWeightOnlyConfig and Int8DynamicActivationUIntxWeightConfig
```
# 0.16:
GemliteUIntXWeightOnlyConfig(group_size, bit_width, packing_bitwidth, mode="weight_only")
GemliteUIntXWeightOnlyConfig(group_size, bit_width, packing_bitwidth, mode="dynamic")
# 0.17
UIntxWeightOnlyConfig(group_size, bit_width, packing_bitwidth)
Int8DynamicActivationUIntxWeightConfig(group_size, bit_width, packing_bitwidth)
```


[ghstack-poisoned]
…GemliteUIntXWeightOnlyConfig"



Deprecation Notes:
GemliteUIntXWeightOnlyConfig is now replaced with torchao.prototype.UIntxWeightOnlyConfig and Int8DynamicActivationUIntxWeightConfig
```
# 0.16:
GemliteUIntXWeightOnlyConfig(group_size, bit_width, packing_bitwidth, mode="weight_only")
GemliteUIntXWeightOnlyConfig(group_size, bit_width, packing_bitwidth, mode="dynamic")
# 0.17
UIntxWeightOnlyConfig(group_size, bit_width, packing_bitwidth)
Int8DynamicActivationUIntxWeightConfig(group_size, bit_width, packing_bitwidth)
```


[ghstack-poisoned]
…htOnlyConfig"



Deprecation Notes:
GemliteUIntXWeightOnlyConfig is now replaced with torchao.prototype.UIntxWeightOnlyConfig and Int8DynamicActivationUIntxWeightConfig
```
# 0.16:
GemliteUIntXWeightOnlyConfig(group_size, bit_width, packing_bitwidth, mode="weight_only")
GemliteUIntXWeightOnlyConfig(group_size, bit_width, packing_bitwidth, mode="dynamic")
# 0.17
UIntxWeightOnlyConfig(group_size, bit_width, packing_bitwidth)
Int8DynamicActivationUIntxWeightConfig(group_size, bit_width, packing_bitwidth)
```


[ghstack-poisoned]
@jerryzh168 jerryzh168 changed the base branch from gh/jerryzh168/60/base to main March 24, 2026 00:11
@jerryzh168 jerryzh168 merged commit fe98658 into main Mar 24, 2026
35 of 38 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: deprecation Use this tag if this PR deprecates a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants