-
Notifications
You must be signed in to change notification settings - Fork 25k
[quant][graphmode][fx] Skip observering boolean Tensors #57375
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: Skip observing the input for masked_fill. Currently we don't have a way to query the type of Proxy in GraphModule, hopefully we should have the functionality to annotate the type, we'll need to annotate a Proxy to be a boolean Tensor to remove this hack. Test Plan: python test/test_quantization.py TestQuantizeFxOps.test_boolean_tensor Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit 13c4695 (more details on the Dr. CI page):
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 to the (internal) Dr. CI Users group. |
Summary: Skip observing the input for masked_fill. Currently we don't have a way to query the type of Proxy in GraphModule, hopefully we should have the functionality to annotate the type, we'll need to annotate a Proxy to be a boolean Tensor to remove this hack. Test Plan: python test/test_quantization.py TestQuantizeFxOps.test_boolean_tensor Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: fa69fca Pull Request resolved: #57375
Summary: Skip observing the input for masked_fill. Currently we don't have a way to query the type of Proxy in GraphModule, hopefully we should have the functionality to annotate the type, we'll need to annotate a Proxy to be a boolean Tensor to remove this hack. Test Plan: python test/test_quantization.py TestQuantizeFxOps.test_boolean_tensor Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D28126003](https://our.internmc.facebook.com/intern/diff/D28126003) [ghstack-poisoned]
Summary: Skip observing the input for masked_fill. Currently we don't have a way to query the type of Proxy in GraphModule, hopefully we should have the functionality to annotate the type, we'll need to annotate a Proxy to be a boolean Tensor to remove this hack. Test Plan: python test/test_quantization.py TestQuantizeFxOps.test_boolean_tensor Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D28126003](https://our.internmc.facebook.com/intern/diff/D28126003) [ghstack-poisoned]
torch/quantization/fx/quantize.py
Outdated
# it is boolean Tensor | ||
# TODO: we need type info from proxy, what type of Tensor this is | ||
# similar to TorchScript | ||
if (node.op, node.target) == ("call_method", "masked_fill"): |
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 instead structure this as something like https://github.com/pytorch/pytorch/blob/master/torch/quantization/fx/utils.py#L406,
if second_input_arg_is_boolean_tensor(node):
...
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.
sure
Summary: Skip observing the input for masked_fill. Currently we don't have a way to query the type of Proxy in GraphModule, hopefully we should have the functionality to annotate the type, we'll need to annotate a Proxy to be a boolean Tensor to remove this hack. Test Plan: python test/test_quantization.py TestQuantizeFxOps.test_boolean_tensor Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D28126003](https://our.internmc.facebook.com/intern/diff/D28126003) [ghstack-poisoned]
Summary: Skip observing the input for masked_fill. Currently we don't have a way to query the type of Proxy in GraphModule, hopefully we should have the functionality to annotate the type, we'll need to annotate a Proxy to be a boolean Tensor to remove this hack. Test Plan: python test/test_quantization.py TestQuantizeFxOps.test_boolean_tensor Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: dbe46f6 Pull Request resolved: #57375
Codecov Report
@@ Coverage Diff @@
## gh/jerryzh168/590/base #57375 +/- ##
==========================================================
- Coverage 77.63% 77.27% -0.36%
==========================================================
Files 1956 1956
Lines 194841 194853 +12
==========================================================
- Hits 151260 150581 -679
- Misses 43581 44272 +691 |
This pull request has been merged in 945c93b. |
Summary: Pull Request resolved: pytorch#57375 Skip observing the input for masked_fill. Currently we don't have a way to query the type of Proxy in GraphModule, hopefully we should have the functionality to annotate the type, we'll need to annotate a Proxy to be a boolean Tensor to remove this hack. Test Plan: python test/test_quantization.py TestQuantizeFxOps.test_boolean_tensor Imported from OSS Reviewed By: vkuzo Differential Revision: D28126003 fbshipit-source-id: 2989766370a607579b3ea07ca36cdc2ce35893cc
Stack from ghstack:
Summary:
Skip observing the input for masked_fill. Currently we don't have a way to
query the type of Proxy in GraphModule, hopefully we should have the functionality to annotate the type,
we'll need to annotate a Proxy to be a boolean Tensor to remove this hack.
Test Plan:
python test/test_quantization.py TestQuantizeFxOps.test_boolean_tensor
Reviewers:
Subscribers:
Tasks:
Tags:
Differential Revision: D28126003