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][graphmode][fx] Merge all quantization mode #45292
Conversation
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 13d0aa89c93df0ba0707deeedecc5350e146dc62 Pull Request resolved: #45292
💊 CI failures summary and remediationsAs of commit 1d191e0 (more details on the Dr. CI page): Commit 1d191e0 was recently pushed. Waiting for builds... This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group. This comment has been revised 109 times. |
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23913105](https://our.internmc.facebook.com/intern/diff/D23913105) [ghstack-poisoned]
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23913105](https://our.internmc.facebook.com/intern/diff/D23913105) [ghstack-poisoned]
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23913105](https://our.internmc.facebook.com/intern/diff/D23913105) [ghstack-poisoned]
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.
looks awesome, the new names are much easier to read!
torch/quantization/fx/utils.py
Outdated
@@ -138,3 +138,38 @@ def get_next_qparams_idx(module, qparams): | |||
qparam_full_path = key + str(idx) | |||
inputs.append(graph.create_node('get_attr', qparam_full_path)) | |||
return graph.create_node('call_function', quantize_op, tuple(inputs), {}) | |||
|
|||
def activation_is_dynamically_quantized(qconfig): |
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.
looks super clean, thanks!
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23913105](https://our.internmc.facebook.com/intern/diff/D23913105) [ghstack-poisoned]
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 264ca59e1e9255e9e5ca08194101e6f2ccc10af6 Pull Request resolved: #45292
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23913105](https://our.internmc.facebook.com/intern/diff/D23913105) [ghstack-poisoned]
if self.is_dynamic_quant: | ||
# don't need to insert observer for output if activation does not | ||
# need to be statically quantized | ||
if not activation_is_statically_quantized(qconfig): |
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.
Can we use activation_is_dynamically_quantized
instead here for better readability?
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.
I'm planning to remove that check since it checks for both dynamic and weight only dtypes.
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.
Not sure I follow. What is the check we will use for dynamic quant in that case?
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.
activation_is_dynamically_quantized checks for float32 dtype which can be both dynamic or weight only quantization.
Will we also be updating the top level APIs to remove the |
yes will do that, I'm waiting for previous PRs to be landed to avoid conflicts. |
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23913105](https://our.internmc.facebook.com/intern/diff/D23913105) [ghstack-poisoned]
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23913105](https://our.internmc.facebook.com/intern/diff/D23913105) [ghstack-poisoned]
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23913105](https://our.internmc.facebook.com/intern/diff/D23913105) [ghstack-poisoned]
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 184888bba530fefefcf0fac48ead6b87c095c6a2 Pull Request resolved: #45292
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23913105](https://our.internmc.facebook.com/intern/diff/D23913105) [ghstack-poisoned]
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23913105](https://our.internmc.facebook.com/intern/diff/D23913105) [ghstack-poisoned]
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 329ee8318e83e200afac2b77b855ee0627f2be20 Pull Request resolved: #45292
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23913105](https://our.internmc.facebook.com/intern/diff/D23913105) [ghstack-poisoned]
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23913105](https://our.internmc.facebook.com/intern/diff/D23913105) [ghstack-poisoned]
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23913105](https://our.internmc.facebook.com/intern/diff/D23913105) [ghstack-poisoned]
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23913105](https://our.internmc.facebook.com/intern/diff/D23913105) [ghstack-poisoned]
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23913105](https://our.internmc.facebook.com/intern/diff/D23913105) [ghstack-poisoned]
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23913105](https://our.internmc.facebook.com/intern/diff/D23913105) [ghstack-poisoned]
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23913105](https://our.internmc.facebook.com/intern/diff/D23913105) [ghstack-poisoned]
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23913105](https://our.internmc.facebook.com/intern/diff/D23913105) [ghstack-poisoned]
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D23913105](https://our.internmc.facebook.com/intern/diff/D23913105) [ghstack-poisoned]
This pull request has been merged in ffcb098. |
This seems to break the CI on ROCm with an error that looks like it is this patch:
Also appreas to break pytorch_linux_xenial_cuda9_2_cudnn7_py3_gcc7_test with the same thing. |
Unlanding. @t-vi nailed it. |
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Imported from OSS Reviewed By: vkuzo [ghstack-poisoned]
…#45292)" Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Imported from OSS Reviewed By: vkuzo Differential Revision: [D24053439](https://our.internmc.facebook.com/intern/diff/D24053439) [ghstack-poisoned]
Summary: This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Imported from OSS Reviewed By: vkuzo ghstack-source-id: 5208f72f119cea51fe4cf3fbf5358783415076d5 Pull Request resolved: #45672
…45672) Summary: Pull Request resolved: #45672 This PR merges all quantization mode and will only expose the following top level functions: ``` prepare_fx prepare_qat_fx convert_fx ``` Test Plan: Imported from OSS Imported from OSS Reviewed By: z-a-f Differential Revision: D24053439 fbshipit-source-id: 03d545e26a36bc22a73349061b751eeb35171e64
Stack from ghstack:
Summary:
This PR merges all quantization mode and will only expose the following top level functions:
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags:
Differential Revision: D23913105