Skip to content

Conversation

@andrewor14
Copy link
Contributor

Summary: Fixes the following error when passing torch.intx to FakeQuantizeConfig. These dtypes were introduced in PyTorch 2.6+:

ValueError: Unsupported dtype 'torch.int4', choose from [torch.int8, torch.uint8, <TorchAODType.INT1: 1>, <TorchAODType.INT2: 2>, <TorchAODType.INT3: 3>, <TorchAODType.INT4: 4>, <TorchAODType.INT5: 5>, <TorchAODType.INT6: 6>, <TorchAODType.INT7: 7>, torch.uint1, torch.uint2, torch.uint3, torch.uint4, torch.uint5, torch.uint6, torch.uint7]

Test Plan:
python test/quantization/test_qat.py -k test_fake_quantize_config_torch_intx

@pytorch-bot
Copy link

pytorch-bot bot commented Jan 10, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 0a953da with merge base d57704c (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@andrewor14 andrewor14 requested a review from jerryzh168 January 10, 2025 21:40
@facebook-github-bot facebook-github-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 Jan 10, 2025
@jerryzh168 jerryzh168 added topic: improvement Use this tag if this PR is an improvement (doesn't fit into any of the other categories) topic: bug fix Use this tag for PRs that fix bugs and removed topic: improvement Use this tag if this PR is an improvement (doesn't fit into any of the other categories) labels Jan 10, 2025
**Summary:** Fixes the following error when passing `torch.intx` to
`FakeQuantizeConfig`. These dtypes were introduced in PyTorch 2.6+:

```
ValueError: Unsupported dtype 'torch.int4', choose from [torch.int8, torch.uint8, <TorchAODType.INT1: 1>, <TorchAODType.INT2: 2>, <TorchAODType.INT3: 3>, <TorchAODType.INT4: 4>, <TorchAODType.INT5: 5>, <TorchAODType.INT6: 6>, <TorchAODType.INT7: 7>, torch.uint1, torch.uint2, torch.uint3, torch.uint4, torch.uint5, torch.uint6, torch.uint7]
```

**Test Plan:**
python test/quantization/test_qat.py -k test_fake_quantize_config_torch_intx
@andrewor14 andrewor14 merged commit b3deb16 into main Jan 14, 2025
18 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. topic: bug fix Use this tag for PRs that fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants