Skip to content

Only support int8 and quant dtypes for quant operators #11685

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 19, 2025

Conversation

aaron-ang
Copy link
Contributor

@aaron-ang aaron-ang commented Jun 14, 2025

Summary

Fixes #11581. Check that node is a quant op before including int8 and other quant dtypes in valid_dtypes.

Test plan

Still working on creating tests.

Copy link

pytorch-bot bot commented Jun 14, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/11685

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

❌ 1 New Failure, 3 Unrelated Failures

As of commit b0d9e08 with merge base ec67249 (image):

NEW FAILURE - The following job has failed:

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.

@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 Jun 14, 2025
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@aaron-ang aaron-ang marked this pull request as ready for review June 21, 2025 06:28
@aaron-ang
Copy link
Contributor Author

@mcr229 @digantdesai I'm running into some issues creating tests. Could you please provide some guidance on some reference files, etc.?

@@ -220,9 +225,12 @@ def _check_node_has_valid_dtype(self, node):
valid_dtypes = {
torch.float32,
torch.float16,
torch.int8,
torch.qint8,
Copy link
Contributor

Choose a reason for hiding this comment

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

what about this guy here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense, I've moved it into the conditional check and added other quant dtypes.

@aaron-ang aaron-ang changed the title Only support int8 dtype for quant operators Only support int8 and quant dtypes for quant operators Jul 11, 2025
@mcr229
Copy link
Contributor

mcr229 commented Jul 11, 2025

@GregoryComer can you point how to run the int8 tests that were failing in the new backend tester? Aside from that as long as existing tests are passing this change should be fine.

@aaron-ang
Copy link
Contributor Author

rebased and fixed lint

@GregoryComer
Copy link
Member

@mcr229 Here's one concrete repro from the tester: #10961. I'll have an easier general repro soon for running the test suite.

@digantdesai
Copy link
Contributor

@GregoryComer does this fix your test?

@aaron-ang
Copy link
Contributor Author

@digantdesai @mcr229 is there anything needed on my end to support this?

@facebook-github-bot
Copy link
Contributor

@digantdesai has imported this pull request. If you are a Meta employee, you can view this in D79721107.

@facebook-github-bot
Copy link
Contributor

@digantdesai has imported this pull request. If you are a Meta employee, you can view this in D79721107.

@digantdesai digantdesai merged commit 2eb7a5f into pytorch:main Aug 19, 2025
100 of 106 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Partitioner Dtype Logic
5 participants