Skip to content

Suppress deprecation warnings from #4074 and #4100#4155

Merged
andrewor14 merged 1 commit into
mainfrom
suppress-warnings
Mar 24, 2026
Merged

Suppress deprecation warnings from #4074 and #4100#4155
andrewor14 merged 1 commit into
mainfrom
suppress-warnings

Conversation

@andrewor14

Copy link
Copy Markdown
Contributor

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 https://github.com/pytorch/ao/issues/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 https://github.com/pytorch/ao/issues/2752 for more details
  warnings.warn(

After:

import torchao
\# No warnings

Test Plan: Manual testing.

@pytorch-bot

pytorch-bot Bot commented Mar 23, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit cbd1f83 with merge base aa9be68 (image):

BROKEN TRUNK - The following job 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 23, 2026

@jerryzh168 jerryzh168 left a comment

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.

please fix ruff

**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 andrewor14 added module: infra module: core changes affecting multiple modules, e.g. base config/tensor, observers, quant ops and removed module: infra labels Mar 23, 2026
@andrewor14 andrewor14 merged commit d76624e into main Mar 24, 2026
24 of 26 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: core changes affecting multiple modules, e.g. base config/tensor, observers, quant ops

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants