-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[quant][graphmode] FP16 quant support - Operator Fusion #40710
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: Test Plan: python test/test_quantization.py Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
Summary: Test Plan: python test/test_quantization.py Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit a7ea6ba (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 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 8 times. |
|
|
||
| for model in [model_traced, model_script]: | ||
| model_quantized = quantize_dynamic_jit(model, qconfig_dict, debug=False) | ||
| # TODO check model with debug=True matches quantized model result |
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.
you can also check numerics with checkGraphModeOp
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.
Yeah, right now looks like debug option set to True isn't producing identical numerics. Once I fix/figure that out I'll use checkGraphModeOp
Summary: Test Plan: python test/test_quantization.py Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
| namespace torch { | ||
| namespace jit { | ||
|
|
||
| struct PatternReplaceInfo { |
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.
we have this in quantization_patterns.h
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.
might make sense to move the patterns there as well
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 can do this in a follow-up PR and move all patterns in this file there.
| {linear_with_quant, linear_with_quant_prepack}, | ||
| {linear_fp16_with_cast, | ||
| linear_fp16_with_prepack, | ||
| {is_fp16_fp32_cast_op}}}; |
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.
non_blocking is still not checked
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 that param doesn't have to be a specific value, so I omitted that check
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.
did we insert the non_blocking = true code? I think it is better to check this as well, I'm not sure how non_blocking = true can be simulated with the swapped pattern
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.
Actually non-blocking and copy are checked with the false check. The missing one is memory_format which should be None - I'll check for that.
Summary: Test Plan: python test/test_quantization.py Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
|
This pull request has been merged in 26543e6. |
Stack from ghstack:
Summary:
Test Plan:
python test/test_quantization.py
Reviewers:
Subscribers:
Tasks:
Tags:
Differential Revision: D22335975