-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[AO][bugfix] Fixing FX QAT but for untraceable modules #74277
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
Summary: see issue: #74240 this fixes that issue by setting qconfig=None for children of untraceable modules. New functionality was needed in QuantizationTracer to distinguish these modules from custom and standalone modules which do not need such treatment. Test Plan:python test/test_quantization.py python test/test_quantization.py TestQuantizeFx.test_qat_skip_untraced Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
CI Flow Status⚛️ CI FlowRuleset - Version:
|
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit c1c6d59 (more details on the Dr. CI page):
🕵️ 1 new failure recognized by patternsThe following CI failures do not appear to be due to upstream breakages:
|
Summary: see issue: #74240 this fixes that issue by setting qconfig=None for children of untraceable modules. New functionality was needed in QuantizationTracer to distinguish these modules from custom and standalone modules which do not need such treatment. Test Plan:python test/test_quantization.py python test/test_quantization.py TestQuantizeFx.test_qat_skip_untraced Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: see issue: #74240 this fixes that issue by setting qconfig=None for children of untraceable modules. New functionality was needed in QuantizationTracer to distinguish these modules from custom and standalone modules which do not need such treatment. Test Plan:python test/test_quantization.py python test/test_quantization.py TestQuantizeFx.test_qat_skip_untraced Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: c5b17c6 Pull Request resolved: #74277
|
@HDCharles has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
torch/ao/quantization/quantize_fx.py
Outdated
| ): | ||
| for name, child in m.named_children(): | ||
| if not hasattr(child, "qconfig"): | ||
| child.qconfig = None # type: ignore[assignment] |
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 feel ideally we should set qconfig in one place, to keep code easier to maintain and reason about, can we do this in prepare?
Summary: see issue: #74240 this fixes that issue by setting qconfig=None for children of untraceable modules. New functionality was needed in QuantizationTracer to distinguish these modules from custom and standalone modules which do not need such treatment. Test Plan:python test/test_quantization.py python test/test_quantization.py TestQuantizeFx.test_qat_skip_untraced Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D34916074](https://our.internmc.facebook.com/intern/diff/D34916074) [ghstack-poisoned]
|
@HDCharles has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: see issue: #74240 this fixes that issue by skipping the children of untraceable modules during propagate_qconfig. This required extending said function to take the prepare_custom_config_dict as an optional argument. Test Plan:python test/test_quantization.py python test/test_quantization.py TestQuantizeFx.test_qat_skip_untraced Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D34916074](https://our.internmc.facebook.com/intern/diff/D34916074) [ghstack-poisoned]
Summary: see issue: #74240 this fixes that issue by skipping the children of untraceable modules during propagate_qconfig. This required extending said function to take the prepare_custom_config_dict as an optional argument. Test Plan:python test/test_quantization.py python test/test_quantization.py TestQuantizeFx.test_qat_skip_untraced Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 3bdfc8f Pull Request resolved: #74277
|
@HDCharles has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
| ) | ||
|
|
||
| def propagate_qconfig_(module, qconfig_dict=None): | ||
| def propagate_qconfig_(module, qconfig_dict=None, prepare_custom_config_dict=None): |
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.
could we add the arg to the docstring too?
vkuzo
left a comment
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 great!
|
looks great, do we want to add support for custom module as well in a followup PR? |
Summary: see issue: #74240 this fixes that issue by skipping the children of untraceable modules during propagate_qconfig. This required extending said function to take the prepare_custom_config_dict as an optional argument. Test Plan:python test/test_quantization.py python test/test_quantization.py TestQuantizeFx.test_qat_skip_untraced Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D34916074](https://our.internmc.facebook.com/intern/diff/D34916074) [ghstack-poisoned]
Summary: see issue: #74240 this fixes that issue by skipping the children of untraceable modules during propagate_qconfig. This required extending said function to take the prepare_custom_config_dict as an optional argument. Test Plan:python test/test_quantization.py python test/test_quantization.py TestQuantizeFx.test_qat_skip_untraced Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 2c04383 Pull Request resolved: #74277
|
@HDCharles has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: see issue: #74240 this fixes that issue by skipping the children of untraceable modules during propagate_qconfig. This required extending said function to take the prepare_custom_config_dict as an optional argument. Test Plan:python test/test_quantization.py python test/test_quantization.py TestQuantizeFx.test_qat_skip_untraced Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D34916074](https://our.internmc.facebook.com/intern/diff/D34916074) [ghstack-poisoned]
Summary: see issue: #74240 this fixes that issue by skipping the children of untraceable modules during propagate_qconfig. This required extending said function to take the prepare_custom_config_dict as an optional argument. Test Plan:python test/test_quantization.py python test/test_quantization.py TestQuantizeFx.test_qat_skip_untraced Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: a908c34 Pull Request resolved: #74277
|
@HDCharles has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: see issue: #74240 this fixes that issue by skipping the children of untraceable modules during propagate_qconfig. This required extending said function to take the prepare_custom_config_dict as an optional argument. Test Plan:python test/test_quantization.py python test/test_quantization.py TestQuantizeFx.test_qat_skip_untraced Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D34916074](https://our.internmc.facebook.com/intern/diff/D34916074) [ghstack-poisoned]
Summary: see issue: #74240 this fixes that issue by skipping the children of untraceable modules during propagate_qconfig. This required extending said function to take the prepare_custom_config_dict as an optional argument. Test Plan:python test/test_quantization.py python test/test_quantization.py TestQuantizeFx.test_qat_skip_untraced Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: baa5c02 Pull Request resolved: #74277
|
@HDCharles has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: Pull Request resolved: #74277 see issue: #74240 this fixes that issue by skipping the children of untraceable modules during propagate_qconfig. This required extending said function to take the prepare_custom_config_dict as an optional argument. Test Plan: python test/test_quantization.py python test/test_quantization.py TestQuantizeFx.test_qat_skip_untraced Imported from OSS Reviewed By: vkuzo Differential Revision: D34916074 fbshipit-source-id: 11caba2cbf78566fb51adf698b01bbba0275de28
|
Hey @HDCharles. |
Stack from ghstack (oldest at bottom):
Summary: see issue: #74240
this fixes that issue by skipping the children of untraceable modules during
propagate_qconfig. This required extending said function to take the
prepare_custom_config_dict as an optional argument.
Test Plan:python test/test_quantization.py
python test/test_quantization.py TestQuantizeFx.test_qat_skip_untraced
Reviewers:
Subscribers:
Tasks:
Tags:
Differential Revision: D34916074