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][api] Add assert for backend in get_default_qconfig related apis #86259

Closed
wants to merge 10 commits into from

Conversation

jerryzh168
Copy link
Contributor

@jerryzh168 jerryzh168 commented Oct 5, 2022

Stack from ghstack (oldest at bottom):

Summary:
Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: D40236474

Summary:
Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
@jerryzh168 jerryzh168 requested a review from z-a-f as a code owner October 5, 2022 04:46
@pytorch-bot
Copy link

pytorch-bot bot commented Oct 5, 2022

🔗 Helpful Links

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

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

❗ 2 Active SEVs

There are 2 currently active SEVs. If your PR is affected, please view them below:

✅ No Failures, 1 Pending

As of commit e14efa9:
💚 Looks good so far! There are no failures yet. 💚

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

@pytorch-bot pytorch-bot bot added the release notes: quantization release notes category label Oct 5, 2022
jerryzh168 added a commit that referenced this pull request Oct 5, 2022
Summary:
Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: c435a3feab363a1d165a2dada6610dcd8acf9a81
Pull Request resolved: #86259
@jerryzh168 jerryzh168 added the topic: improvements topic category label Oct 5, 2022
`x86` (default), `fbgemm`, `qnnpack` and `onednn`.

Return:
qconfig
"""
supported_backends = ["fbgemm", "x86", "qnnpack", "onednn"]
if backend not in supported_backends:
raise AssertionError(
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be ValueError instead?

Copy link
Contributor Author

@jerryzh168 jerryzh168 Oct 5, 2022

Choose a reason for hiding this comment

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

I actually checked this yesterday, ValueError means the type is correct and value is not correct, but in this case the type may not be correct either so I guess AssertionError is OK. we are also using AssertionError for the version number as well

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 5, 2022
@jerryzh168
Copy link
Contributor Author

@pytorchbot merge -g

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a merge job. Check the current status here.
The merge job was triggered with the green (-g) flag. This means that your change will be merged once all checks on your PR have passed (ETA: 0-4 Hours). If this is not the intended behavior, feel free to use some of the other merge options in the wiki.
Please reach out to the PyTorch DevX Team with feedback or questions!

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 2 additional jobs have failed, first few of them are: trunk ,trunk / macos-12-py3-arm64 / test (default, 2, 2, macos-m1-12)

Details for Dev Infra team Raised by workflow job

@jerryzh168
Copy link
Contributor Author

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a rebase job. Check the current status here

… related apis"

Summary:
Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
@pytorchmergebot
Copy link
Collaborator

Successfully rebased gh/jerryzh168/795/orig onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via ghstack checkout https://github.com/pytorch/pytorch/pull/86259)

pytorchmergebot pushed a commit that referenced this pull request Oct 10, 2022
Summary:
Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 8900ae42bb8702b6d2ffce34e8e347008ab34ac7
Pull Request resolved: #86259
@jerryzh168
Copy link
Contributor Author

@pytorchbot merge

@jerryzh168
Copy link
Contributor Author

@pytorchbot merge -g

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks on your PR pass since you used the green (-g) flag (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

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 2 additional jobs have failed, first few of them are: trunk ,trunk / macos-12-py3-arm64 / test (default, 2, 2, macos-m1-12)

Details for Dev Infra team Raised by workflow job

… related apis"

Summary:
Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
jerryzh168 added a commit that referenced this pull request Oct 10, 2022
Summary:
Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 30d265c0cca3452dab4aa7161fc22a8599d6a8f3
Pull Request resolved: #86259
@jerryzh168
Copy link
Contributor Author

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

… related apis"

Summary:
Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
jerryzh168 added a commit that referenced this pull request Oct 10, 2022
Summary:
Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 15a2cf357646566b54ebafae86938a682ddc0062
Pull Request resolved: #86259
@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: Command git -C /home/runner/work/pytorch/pytorch cherry-pick -x 4dfbb671288de151524363890f192161f3a66263 returned non-zero exit code 1

Auto-merging test/quantization/fx/test_quantize_fx.py
CONFLICT (content): Merge conflict in test/quantization/fx/test_quantize_fx.py
error: could not apply 4dfbb67128... [quant][api] Add assert for backend in get_default_qconfig related apis
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
Details for Dev Infra team Raised by workflow job

… related apis"

Summary:
Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
jerryzh168 added a commit that referenced this pull request Oct 14, 2022
Summary:
Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Reviewers:

Subscribers:

Tasks:

Tags:

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

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

… related apis"

Summary:
Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
jerryzh168 added a commit that referenced this pull request Oct 14, 2022
Summary:
Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 2b2a5e6fb81f3ec295394a89edda1c2911fcd165
Pull Request resolved: #86259
@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
Copy link
Contributor Author

@pytorchbot merge -g

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: This PR has internal changes and must be landed via Phabricator

Details for Dev Infra team Raised by workflow job

@jerryzh168
Copy link
Contributor Author

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a rebase job. Check the current status here

… related apis"

Summary:
Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
@pytorchmergebot
Copy link
Collaborator

Successfully rebased gh/jerryzh168/795/orig onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via ghstack checkout https://github.com/pytorch/pytorch/pull/86259)

pytorchmergebot pushed a commit that referenced this pull request Oct 17, 2022
Summary:
Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 9fca040069021a7e776696520c944850f43ff851
Pull Request resolved: #86259
@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
Copy link
Contributor Author

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a rebase job. Check the current status here

… related apis"

Summary:
Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
@pytorchmergebot
Copy link
Collaborator

Successfully rebased gh/jerryzh168/795/orig onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via ghstack checkout https://github.com/pytorch/pytorch/pull/86259)

pytorchmergebot pushed a commit that referenced this pull request Oct 18, 2022
Summary:
Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 055a429ec0e86fdfd209a11f050484dcba8ba207
Pull Request resolved: #86259
@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/pytorch that referenced this pull request Oct 19, 2022
…is (pytorch#86259)

Summary:
Pull Request resolved: pytorch#86259

Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Imported from OSS

Reviewed By: jcaip

Differential Revision: D40236474

fbshipit-source-id: 833355257fcc708ebe28842ffe1c370142688ffc
@jerryzh168
Copy link
Contributor Author

closed in favor of #87331

@jerryzh168 jerryzh168 closed this Oct 19, 2022
pytorchmergebot pushed a commit that referenced this pull request Oct 21, 2022
…is (#86259) (#87331)

Summary:
Pull Request resolved: #86259

Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Imported from OSS

Reviewed By: jcaip

Differential Revision: D40236474

Pull Request resolved: #87331
Approved by: https://github.com/andrewor14
sgrigory pushed a commit to sgrigory/pytorch that referenced this pull request Oct 28, 2022
…is (pytorch#86259) (pytorch#87331)

Summary:
Pull Request resolved: pytorch#86259

Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Imported from OSS

Reviewed By: jcaip

Differential Revision: D40236474

Pull Request resolved: pytorch#87331
Approved by: https://github.com/andrewor14
kulinseth pushed a commit to kulinseth/pytorch that referenced this pull request Nov 5, 2022
…is (pytorch#86259) (pytorch#87331)

Summary:
Pull Request resolved: pytorch#86259

Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Imported from OSS

Reviewed By: jcaip

Differential Revision: D40236474

Pull Request resolved: pytorch#87331
Approved by: https://github.com/andrewor14
kulinseth pushed a commit to kulinseth/pytorch that referenced this pull request Dec 10, 2022
…is (pytorch#86259) (pytorch#87331)

Summary:
Pull Request resolved: pytorch#86259

Add assertion to make sure backend is one of "fbgemm", "x86", "qnnpack" and "onednn"
for get_default_qconfig, get_default_qat_qconfig, get_default_qconfig_mapping and get_default_qat_qconfig_mapping

Test Plan:
python test/test_quantization.py -k test_get_default_qconfig_mapping

Imported from OSS

Reviewed By: jcaip

Differential Revision: D40236474

Pull Request resolved: pytorch#87331
Approved by: https://github.com/andrewor14
@facebook-github-bot facebook-github-bot deleted the gh/jerryzh168/795/head branch June 8, 2023 17:35
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 cla signed fx release notes: quantization release notes category topic: improvements topic category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants