Skip to content

Deprecate AQT and related classes#4074

Merged
andrewor14 merged 1 commit into
mainfrom
deprecate-aqt
Mar 13, 2026
Merged

Deprecate AQT and related classes#4074
andrewor14 merged 1 commit into
mainfrom
deprecate-aqt

Conversation

@andrewor14

@andrewor14 andrewor14 commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

Summary: Deprecate AffineQuantizedTensor, AQTTensorImpl, Layout, and all subclasses of the above in torchao.dtypes. We are planning to remove these classes in the future, so we deprecate them here in advance.

● Here are all the classes that now have new deprecation warnings:

  Base classes (torchao/dtypes/utils.py):
  1. Layout
  2. PlainLayout
  3. AQTTensorImpl

  torchao/dtypes/affine_quantized_tensor.py:
  4. AffineQuantizedTensor

  torchao/dtypes/floatx/:
  5. Float8Layout
  6. Float8AQTTensorImpl
  7. CutlassSemiSparseLayout
  8. CutlassSemiSparseTensorImpl

  torchao/dtypes/uintx/:
  9. TensorCoreTiledLayout
  10. TensorCoreTiledAQTTensorImpl
  11. SemiSparseLayout
  12. SemiSparseAQTTensorImpl
  13. Int4CPULayout
  14. Int4CPUAQTTensorImpl
  15. Int4XPULayout
  16. Int4XPUAQTTensorImpl
  17. QDQLayout
  18. QDQTensorImpl
  19. PlainAQTTensorImpl
  20. PackedLinearInt8DynamicActivationIntxWeightLayout
  21. PackedLinearInt8DynamicActivationIntxWeightAQTTensorImpl

More context here: #2752

Test Plan:
Manual testing

@pytorch-bot

pytorch-bot Bot commented Mar 13, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (2 Unrelated Failures)

As of commit 1415fd9 with merge base 95d366c (image):

BROKEN TRUNK - The following jobs failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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 13, 2026
@andrewor14 andrewor14 added module: deprecation Use this tag if this PR deprecates a feature and removed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Mar 13, 2026
@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 13, 2026
Comment thread test/dtypes/test_affine_quantized.py Outdated
common_utils.instantiate_parametrized_tests(TestAffineQuantizedBasic)


class TestAQTDeprecation(TestCase):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just delete this, I don't think we should test Python stl

def __post_init__(self):
super().__post_init__()
warnings.warn(
"Deprecation: CutlassSemiSparseLayout is deprecated and will be removed in a future release of torchao"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should link to an github issue with more info, you can use the main AQT deprecation issue

**Summary:** Deprecate AffineQuantizedTensor, AQTTensorImpl,
Layout, and all subclasses of the above in torchao.dtypes.
We are planning to remove these classes in the future, so
we deprecate them here in advance.

```
● Here are all the classes that now have new deprecation warnings:

  Base classes (torchao/dtypes/utils.py):
  1. Layout
  2. PlainLayout
  3. AQTTensorImpl

  torchao/dtypes/affine_quantized_tensor.py:
  4. AffineQuantizedTensor

  torchao/dtypes/floatx/:
  5. Float8Layout
  6. Float8AQTTensorImpl
  7. CutlassSemiSparseLayout
  8. CutlassSemiSparseTensorImpl

  torchao/dtypes/uintx/:
  9. TensorCoreTiledLayout
  10. TensorCoreTiledAQTTensorImpl
  11. SemiSparseLayout
  12. SemiSparseAQTTensorImpl
  13. Int4CPULayout
  14. Int4CPUAQTTensorImpl
  15. Int4XPULayout
  16. Int4XPUAQTTensorImpl
  17. QDQLayout
  18. QDQTensorImpl
  19. PlainAQTTensorImpl
  20. PackedLinearInt8DynamicActivationIntxWeightLayout
  21. PackedLinearInt8DynamicActivationIntxWeightAQTTensorImpl
```

More context here: #2752

**Test Plan:**
Manual testing
@jerryzh168

Copy link
Copy Markdown
Contributor

maybe just delete some of the layouts? we have been talking about deprecation of the corresponding v1 configs for a while

@andrewor14

Copy link
Copy Markdown
Contributor Author

maybe just delete some of the layouts? we have been talking about deprecation of the corresponding v1 configs for a while

Yeah we can, I think we can also just delete them in 0.18.0 with everything else, which may be simpler

@andrewor14 andrewor14 merged commit eb64bfb into main Mar 13, 2026
21 of 23 checks passed
danielvegamyhre pushed a commit that referenced this pull request Mar 13, 2026
**Summary:** Deprecate AffineQuantizedTensor, AQTTensorImpl,
Layout, and all subclasses of the above in torchao.dtypes.
We are planning to remove these classes in the future, so
we deprecate them here in advance.

```
● Here are all the classes that now have new deprecation warnings:

  Base classes (torchao/dtypes/utils.py):
  1. Layout
  2. PlainLayout
  3. AQTTensorImpl

  torchao/dtypes/affine_quantized_tensor.py:
  4. AffineQuantizedTensor

  torchao/dtypes/floatx/:
  5. Float8Layout
  6. Float8AQTTensorImpl
  7. CutlassSemiSparseLayout
  8. CutlassSemiSparseTensorImpl

  torchao/dtypes/uintx/:
  9. TensorCoreTiledLayout
  10. TensorCoreTiledAQTTensorImpl
  11. SemiSparseLayout
  12. SemiSparseAQTTensorImpl
  13. Int4CPULayout
  14. Int4CPUAQTTensorImpl
  15. Int4XPULayout
  16. Int4XPUAQTTensorImpl
  17. QDQLayout
  18. QDQTensorImpl
  19. PlainAQTTensorImpl
  20. PackedLinearInt8DynamicActivationIntxWeightLayout
  21. PackedLinearInt8DynamicActivationIntxWeightAQTTensorImpl
```

More context here: #2752

**Test Plan:**
Manual testing
danielvegamyhre pushed a commit that referenced this pull request Mar 13, 2026
**Summary:** Deprecate AffineQuantizedTensor, AQTTensorImpl,
Layout, and all subclasses of the above in torchao.dtypes.
We are planning to remove these classes in the future, so
we deprecate them here in advance.

```
● Here are all the classes that now have new deprecation warnings:

  Base classes (torchao/dtypes/utils.py):
  1. Layout
  2. PlainLayout
  3. AQTTensorImpl

  torchao/dtypes/affine_quantized_tensor.py:
  4. AffineQuantizedTensor

  torchao/dtypes/floatx/:
  5. Float8Layout
  6. Float8AQTTensorImpl
  7. CutlassSemiSparseLayout
  8. CutlassSemiSparseTensorImpl

  torchao/dtypes/uintx/:
  9. TensorCoreTiledLayout
  10. TensorCoreTiledAQTTensorImpl
  11. SemiSparseLayout
  12. SemiSparseAQTTensorImpl
  13. Int4CPULayout
  14. Int4CPUAQTTensorImpl
  15. Int4XPULayout
  16. Int4XPUAQTTensorImpl
  17. QDQLayout
  18. QDQTensorImpl
  19. PlainAQTTensorImpl
  20. PackedLinearInt8DynamicActivationIntxWeightLayout
  21. PackedLinearInt8DynamicActivationIntxWeightAQTTensorImpl
```

More context here: #2752

**Test Plan:**
Manual testing
andrewor14 added a commit that referenced this pull request Mar 23, 2026
**Summary:** #4074 and #4100 deprecated a few classes, but this
triggered the following warnings when the user imports torchao
from the top-level. This commit suppresses these warnings
in this case.

Before:
```
/data/users/andrewor/ao/torchao/dtypes/utils.py:89: UserWarning: Deprecation: PlainLayout is deprecated and will be removed in a future release of torchao, see #2752 for more details
  warnings.warn(
/data/users/andrewor/ao/torchao/quantization/quant_primitives.py:95: UserWarning: Deprecation: TorchAODType is deprecated, please use the torch.intN dtype instead (e.g. TorchAODType.INT4 -> torch.int4)
  warnings.warn(
/data/users/andrewor/ao/torchao/dtypes/utils.py:89: UserWarning: Deprecation: PlainLayout is deprecated and will be removed in a future release of torchao, see #2752 for more details
  warnings.warn(
```

After:
```
```

**Test Plan:** Manual testing.
andrewor14 added a commit that referenced this pull request Mar 23, 2026
**Summary:** #4074 and #4100 deprecated a few classes, but this
triggered the following warnings when the user imports torchao
from the top-level. This commit suppresses these warnings
in this case.

Before:
```
import torchao
/data/users/andrewor/ao/torchao/dtypes/utils.py:89: UserWarning: Deprecation: PlainLayout is deprecated and will be removed in a future release of torchao, see #2752 for more details
  warnings.warn(
/data/users/andrewor/ao/torchao/quantization/quant_primitives.py:95: UserWarning: Deprecation: TorchAODType is deprecated, please use the torch.intN dtype instead (e.g. TorchAODType.INT4 -> torch.int4)
  warnings.warn(
/data/users/andrewor/ao/torchao/dtypes/utils.py:89: UserWarning: Deprecation: PlainLayout is deprecated and will be removed in a future release of torchao, see #2752 for more details
  warnings.warn(
```

After:
```
import torchao
\# No warnings
```

**Test Plan:** Manual testing.
andrewor14 added a commit that referenced this pull request Mar 23, 2026
**Summary:** #4074 and #4100 deprecated a few classes, but this
triggered the following warnings when the user imports torchao
from the top-level. This commit suppresses these warnings
in this case.

Before:
```
import torchao
/data/users/andrewor/ao/torchao/dtypes/utils.py:89: UserWarning: Deprecation: PlainLayout is deprecated and will be removed in a future release of torchao, see #2752 for more details
  warnings.warn(
/data/users/andrewor/ao/torchao/quantization/quant_primitives.py:95: UserWarning: Deprecation: TorchAODType is deprecated, please use the torch.intN dtype instead (e.g. TorchAODType.INT4 -> torch.int4)
  warnings.warn(
/data/users/andrewor/ao/torchao/dtypes/utils.py:89: UserWarning: Deprecation: PlainLayout is deprecated and will be removed in a future release of torchao, see #2752 for more details
  warnings.warn(
```

After:
```
import torchao
\# No warnings
```

**Test Plan:** Manual testing.
andrewor14 added a commit that referenced this pull request Mar 24, 2026
**Summary:** #4074 and #4100 deprecated a few classes, but this
triggered the following warnings when the user imports torchao
from the top-level. This commit suppresses these warnings
in this case.

Before:
```
import torchao
/data/users/andrewor/ao/torchao/dtypes/utils.py:89: UserWarning: Deprecation: PlainLayout is deprecated and will be removed in a future release of torchao, see #2752 for more details
  warnings.warn(
/data/users/andrewor/ao/torchao/quantization/quant_primitives.py:95: UserWarning: Deprecation: TorchAODType is deprecated, please use the torch.intN dtype instead (e.g. TorchAODType.INT4 -> torch.int4)
  warnings.warn(
/data/users/andrewor/ao/torchao/dtypes/utils.py:89: UserWarning: Deprecation: PlainLayout is deprecated and will be removed in a future release of torchao, see #2752 for more details
  warnings.warn(
```

After:
```
import torchao
\# No warnings
```

**Test Plan:** Manual testing.
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.

3 participants