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
fx quant: fix types on _find_quants #49616
Conversation
Summary: Add types to `_find_quants` I/O and fix resulting errors, needed for an upcoming bug fix. Test Plan: ``` mypy torch/quantization python test/test_quantization.py TestQuantizeFx ``` Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit 7b80f03 (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: pytorch_linux_bionic_py3_8_gcc9_coverage_test1 (1/1)Step: "Run tests" (full log | diagnosis details | 🔁 rerun)
|
torch/quantization/fx/quantize.py
Outdated
@@ -981,7 +985,7 @@ def visit_arg(arg): | |||
# overwrite previous activation post process constructor if | |||
# necessary | |||
quants[arg.name] = ( | |||
DefaultQuantizeHandler(self, arg), act_post_process_ctr) | |||
DefaultQuantizeHandler(self, arg), act_post_process_ctr, is_weight) |
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 think we don't need is_weight
, this info is used to decide act_post_process_ctr already in L976
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.
also we can remove L978-979 I think
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.
as discussed in chat, we can remove DefaultQuantizeHandler
, thanks!
Summary: Add types to `_find_quants` I/O and fix resulting errors, needed for an upcoming bug fix. Test Plan: ``` mypy torch/quantization python test/test_quantization.py TestQuantizeFx ``` Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D25645719](https://our.internmc.facebook.com/intern/diff/D25645719) [ghstack-poisoned]
@@ -571,14 +574,9 @@ def load_non_quantized(n): | |||
return env[n.name] | |||
|
|||
def load_quantized(n): | |||
if n.name not in quant_env: |
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.
this code was flagged unreachable, deleting
Summary: Add types to `_find_quants` I/O and fix resulting errors, needed for an upcoming bug fix. Test Plan: ``` mypy torch/quantization python test/test_quantization.py TestQuantizeFx ``` Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D25645719](https://our.internmc.facebook.com/intern/diff/D25645719) [ghstack-poisoned]
separate PR, to keep things small? since this is really just annotating types and fixing bugs uncovered by that |
Summary: Add types to `_find_quants` I/O and fix resulting errors, needed for an upcoming bug fix. Test Plan: ``` mypy torch/quantization python test/test_quantization.py TestQuantizeFx ``` Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D25645719](https://our.internmc.facebook.com/intern/diff/D25645719) [ghstack-poisoned]
Summary: Add types to `_find_quants` I/O and fix resulting errors, needed for an upcoming bug fix. Test Plan: ``` mypy torch/quantization python test/test_quantization.py TestQuantizeFx ``` Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D25645719](https://our.internmc.facebook.com/intern/diff/D25645719) [ghstack-poisoned]
This pull request has been merged in edce6b1. |
Summary: Pull Request resolved: pytorch#49616 Add types to `_find_quants` I/O and fix resulting errors, needed for an upcoming bug fix. Test Plan: ``` mypy torch/quantization python test/test_quantization.py TestQuantizeFx ``` Imported from OSS Reviewed By: jerryzh168 Differential Revision: D25645719 fbshipit-source-id: 4bf788b55fd4fd086c83a4438b9c2df22b9cff49
Stack from ghstack:
Summary:
Add types to
_find_quants
I/O and fix resulting errors,needed for an upcoming bug fix.
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags:
Differential Revision: D25645719