Skip to content
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

[quant][pt2e] Add transform_for_annotation method in Quantizer #113115

Closed
wants to merge 4 commits into from

Conversation

jerryzh168
Copy link
Contributor

@jerryzh168 jerryzh168 commented Nov 7, 2023

Stack from ghstack (oldest at bottom):

Summary:
Adding the method so that people can do some transformations before annotation to make the graph easier to annotate

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_transform_for_annotation

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: D51141080

Summary:
Adding the method so that people can do some transformations before annotation to make the graph easier to annotate

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_transform_for_annotation

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Nov 7, 2023

🔗 Helpful Links

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

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

✅ No Failures

As of commit 9d1b047 with merge base 84d64d7 (image):
💚 Looks good so far! There are no failures yet. 💚

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

jerryzh168 added a commit that referenced this pull request Nov 7, 2023
Summary:
Adding the method so that people can do some transformations before annotation to make the graph easier to annotate

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_transform_for_annotation

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 8aca038c93f54a8b359d5e6640e6169ddb11b197
Pull Request resolved: #113115
Copy link
Contributor

@kimishpatel kimishpatel left a comment

Choose a reason for hiding this comment

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

Left a comment for adding test to xnnpack quantizer but feel free to defer it. and left a update to the comment about transform_for_annotation

torch/ao/quantization/quantizer/quantizer.py Outdated Show resolved Hide resolved
torch/ao/quantization/quantizer/xnnpack_quantizer.py Outdated Show resolved Hide resolved
…izer"

Summary:
Adding the method so that people can do some transformations before annotation to make the graph easier to annotate

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_transform_for_annotation

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
jerryzh168 added a commit that referenced this pull request Nov 7, 2023
Summary:
Adding the method so that people can do some transformations before annotation to make the graph easier to annotate

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_transform_for_annotation

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 602e42cc7ae6487554a4867c2dff60554eaae1d0
Pull Request resolved: #113115
# For example quantizer can
# a) decompose a compound operator like scaled dot product attention,
# into bmm and softmax if quantizer knows how to quantize bmm/softmax but not sdpa
# or b) transform scalars to tensor to allow quantizing scalares.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# or b) transform scalars to tensor to allow quantizing scalares.
# or b) transform scalars to tensor to allow quantizing scalars.

torch/ao/quantization/quantizer/quantizer.py Show resolved Hide resolved
…izer"

Summary:
Adding the method so that people can do some transformations before annotation to make the graph easier to annotate

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_transform_for_annotation

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
jerryzh168 added a commit that referenced this pull request Nov 9, 2023
Summary:
Adding the method so that people can do some transformations before annotation to make the graph easier to annotate

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_transform_for_annotation

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 2f5868400eea2c7a3db8c1eea3274855c8f49ab4
Pull Request resolved: #113115
@albanD albanD removed their request for review November 9, 2023 01:12
@jerryzh168
Copy link
Contributor Author

@jerryzh168 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

…izer"

Summary:
Adding the method so that people can do some transformations before annotation to make the graph easier to annotate

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_transform_for_annotation

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D51141080](https://our.internmc.facebook.com/intern/diff/D51141080)

[ghstack-poisoned]
jerryzh168 added a commit that referenced this pull request Nov 9, 2023
Summary:
Adding the method so that people can do some transformations before annotation to make the graph easier to annotate

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_transform_for_annotation

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 5a7995d072f2557d1ab18408f1f157605e4a129f
Pull Request resolved: #113115
@jerryzh168
Copy link
Contributor Author

@jerryzh168 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

jerryzh168 added a commit to jerryzh168/executorch-1 that referenced this pull request Nov 9, 2023
Summary:
X-link: pytorch/pytorch#113115



Adding the method so that people can do some transformations before annotation to make the graph easier to annotate

Differential Revision: D51141080
@jerryzh168
Copy link
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Nov 9, 2023
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@PaliC
Copy link
Contributor

PaliC commented Nov 10, 2023

@pytorchbot revert -m "breaking executorch tests" -c ghfirst

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a revert job. Check the current status here.
Questions? Feedback? Please reach out to the PyTorch DevX Team

@pytorchmergebot
Copy link
Collaborator

Can't revert PR that was landed via phabricator as D51141080. Please revert by going to the internal diff and clicking Unland.

@facebook-github-bot facebook-github-bot deleted the gh/jerryzh168/930/head branch November 13, 2023 15:25
Skylion007 pushed a commit to Skylion007/pytorch that referenced this pull request Nov 14, 2023
…ch#113115)

Summary:
Adding the method so that people can do some transformations before annotation to make the graph easier to annotate

Test Plan:
python test/test_quantization.py TestQuantizePT2E.test_transform_for_annotation

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D51141080](https://our.internmc.facebook.com/intern/diff/D51141080)
Pull Request resolved: pytorch#113115
Approved by: https://github.com/kimishpatel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request Merged release notes: quantization release notes category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants