-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[quant] Fix the quant_min/quant_max override in FakeQuantize #74581
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
Conversation
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit f19105e (more details on the Dr. CI page): Commit f19105e was recently pushed. Waiting for builds... This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
|
This pull request was exported from Phabricator. Differential Revision: D34971236 |
1 similar comment
|
This pull request was exported from Phabricator. Differential Revision: D34971236 |
7bd7ef3 to
2a04ff0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the override numbers does not match?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a TODO for us to fix it, user should be able to override the values..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we move these things after the initialization of activation_post_process and assign self.quant_min = self.activation_post_process.quant_min etc.?
|
This pull request was exported from Phabricator. Differential Revision: D34971236 |
2a04ff0 to
ab7d760
Compare
…h#74581) Summary: Pull Request resolved: pytorch#74581 As title, currently the quant_min/quant_max of the FakeQuantize are not populated to the observer. We plan to populate when they are both not None. To do this we need to do 1. Remove the current default quant_min/quant_max value (0/255) as it's not universal for various dtype. 2. Move the upper bound/lower bound check before creating the observer. Test Plan: ``` [jiaxuzhu@devvm3400.frc0 /data/users/jiaxuzhu/fbsource/fbcode] buck test mode/dev //caffe2/test:quantization -- --exact 'caffe2/test:quantization - test_quant_min_max_override (quantization.core.test_workflow_module.TestFakeQuantize)' Parsing buck files: finished in 0.8 sec Downloaded 0/2 artifacts, 0.00 bytes, 100.0% cache miss (for updated rules) Building: finished in 9.5 sec (100%) 18535/84579 jobs, 2/84579 updated Total time: 10.3 sec More details at https://www.internalfb.com/intern/buck/build/1cab97ef-0788-4d06-92ed-a828995e3bde BUILD SUCCEEDED Tpx test run coordinator for Facebook. See https://fburl.com/tpx for details. Running with tpx session id: 24be645e-eebc-45d6-8111-052ef1225fa0 Trace available for this run at /tmp/tpx-20220323-094106.724238-24be645e-eebc-45d6-8111-052ef1225fa0/trace.log RemoteExecution session id: reSessionID-24be645e-eebc-45d6-8111-052ef1225fa0-tpx Started reporting to test run: https://www.internalfb.com/intern/testinfra/testrun/5066549674998735 ✓ ListingSuccess: caffe2/test:quantization : 483 tests discovered (20.179) ✓ Pass: caffe2/test:quantization - test_quant_min_max_override (quantization.core.test_workflow_module.TestFakeQuantize) (18.896) Summary Pass: 1 ListingSuccess: 1 If you need help understanding your runs, please follow the wiki: https://fburl.com/posting_in_tpx_users Finished test run: https://www.internalfb.com/intern/testinfra/testrun/5066549674998735 ``` Reviewed By: jerryzh168 Differential Revision: D34971236 fbshipit-source-id: f7f0b252e3174ae91c85709b7ce07528eb7ff571
|
This pull request was exported from Phabricator. Differential Revision: D34971236 |
ab7d760 to
f19105e
Compare
Summary: Pull Request resolved: #74581 As title, currently the quant_min/quant_max of the FakeQuantize are not populated to the observer. We plan to populate when they are both not None. To do this we need to do 1. Remove the current default quant_min/quant_max value (0/255) as it's not universal for various dtype. 2. Move the upper bound/lower bound check before creating the observer. Test Plan: ``` [jiaxuzhu@devvm3400.frc0 /data/users/jiaxuzhu/fbsource/fbcode] buck test mode/dev //caffe2/test:quantization -- --exact 'caffe2/test:quantization - test_quant_min_max_override (quantization.core.test_workflow_module.TestFakeQuantize)' Parsing buck files: finished in 0.8 sec Downloaded 0/2 artifacts, 0.00 bytes, 100.0% cache miss (for updated rules) Building: finished in 9.5 sec (100%) 18535/84579 jobs, 2/84579 updated Total time: 10.3 sec More details at https://www.internalfb.com/intern/buck/build/1cab97ef-0788-4d06-92ed-a828995e3bde BUILD SUCCEEDED Tpx test run coordinator for Facebook. See https://fburl.com/tpx for details. Running with tpx session id: 24be645e-eebc-45d6-8111-052ef1225fa0 Trace available for this run at /tmp/tpx-20220323-094106.724238-24be645e-eebc-45d6-8111-052ef1225fa0/trace.log RemoteExecution session id: reSessionID-24be645e-eebc-45d6-8111-052ef1225fa0-tpx Started reporting to test run: https://www.internalfb.com/intern/testinfra/testrun/5066549674998735 ✓ ListingSuccess: caffe2/test:quantization : 483 tests discovered (20.179) ✓ Pass: caffe2/test:quantization - test_quant_min_max_override (quantization.core.test_workflow_module.TestFakeQuantize) (18.896) Summary Pass: 1 ListingSuccess: 1 If you need help understanding your runs, please follow the wiki: https://fburl.com/posting_in_tpx_users Finished test run: https://www.internalfb.com/intern/testinfra/testrun/5066549674998735 ``` Reviewed By: jerryzh168 Differential Revision: D34971236 fbshipit-source-id: 4407fd03116a296053256b333f7ce6d28dcc9c42
|
Hey @LiamZhuuu. |
Summary: Pull Request resolved: #74581 As title, currently the quant_min/quant_max of the FakeQuantize are not populated to the observer. We plan to populate when they are both not None. To do this we need to do 1. Remove the current default quant_min/quant_max value (0/255) as it's not universal for various dtype. 2. Move the upper bound/lower bound check before creating the observer. Test Plan: ``` [jiaxuzhu@devvm3400.frc0 /data/users/jiaxuzhu/fbsource/fbcode] buck test mode/dev //caffe2/test:quantization -- --exact 'caffe2/test:quantization - test_quant_min_max_override (quantization.core.test_workflow_module.TestFakeQuantize)' Parsing buck files: finished in 0.8 sec Downloaded 0/2 artifacts, 0.00 bytes, 100.0% cache miss (for updated rules) Building: finished in 9.5 sec (100%) 18535/84579 jobs, 2/84579 updated Total time: 10.3 sec More details at https://www.internalfb.com/intern/buck/build/1cab97ef-0788-4d06-92ed-a828995e3bde BUILD SUCCEEDED Tpx test run coordinator for Facebook. See https://fburl.com/tpx for details. Running with tpx session id: 24be645e-eebc-45d6-8111-052ef1225fa0 Trace available for this run at /tmp/tpx-20220323-094106.724238-24be645e-eebc-45d6-8111-052ef1225fa0/trace.log RemoteExecution session id: reSessionID-24be645e-eebc-45d6-8111-052ef1225fa0-tpx Started reporting to test run: https://www.internalfb.com/intern/testinfra/testrun/5066549674998735 ✓ ListingSuccess: caffe2/test:quantization : 483 tests discovered (20.179) ✓ Pass: caffe2/test:quantization - test_quant_min_max_override (quantization.core.test_workflow_module.TestFakeQuantize) (18.896) Summary Pass: 1 ListingSuccess: 1 If you need help understanding your runs, please follow the wiki: https://fburl.com/posting_in_tpx_users Finished test run: https://www.internalfb.com/intern/testinfra/testrun/5066549674998735 ``` Reviewed By: jerryzh168 Differential Revision: D34971236 fbshipit-source-id: 4407fd03116a296053256b333f7ce6d28dcc9c42 (cherry picked from commit f6980bc)
Summary: As title, currently the quant_min/quant_max of the FakeQuantize are not passed to the observer.
Test Plan:
Differential Revision: D34971236