-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[quant][fx] Fix lowering pass for cases when to is not called with positional args
#75146
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
…positional args Summary: Previously we assume `to` must be called with positioanl args, but this may not be the case, e.g. we can do `to(dtype=?)` or `to(memory_format=?)` Test Plan: python test/test_quantization.py TestQuantizeFx python test/test_quantization.py TestQuantizeFxOps Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit f626869 (more details on the Dr. CI page):
🕵️♀️ 1 failure not recognized by patterns:The following CI failures may be due to changes from the PR
This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
…alled with positional args" Summary: Previously we assume `to` must be called with positioanl args, but this may not be the case, e.g. we can do `to(dtype=?)` or `to(memory_format=?)` Test Plan: python test/test_quantization.py TestQuantizeFx python test/test_quantization.py TestQuantizeFxOps Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
…positional args Summary: Previously we assume `to` must be called with positioanl args, but this may not be the case, e.g. we can do `to(dtype=?)` or `to(memory_format=?)` Test Plan: python test/test_quantization.py TestQuantizeFx python test/test_quantization.py TestQuantizeFxOps Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: f6a4f90 Pull Request resolved: #75146
|
@jerryzh168 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
| is_quantize = q_node.target == torch.quantize_per_tensor | ||
| is_to_fp16 = q_node.op == "call_method" and q_node.target == "to" and q_node.args[1] == torch.float16 | ||
| is_to_fp16 = q_node.op == "call_method" and q_node.target == "to" and \ | ||
| len(q_node.args) == 2 and q_node.args[1] == torch.float16 |
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 this fail with array out of bounds exception before with keyword args?
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.
Yes
…positional args (#75146) Summary: Pull Request resolved: #75146 Previously we assume `to` must be called with positioanl args, but this may not be the case, e.g. we can do `to(dtype=?)` or `to(memory_format=?)` Test Plan: python test/test_quantization.py TestQuantizeFx python test/test_quantization.py TestQuantizeFxOps Imported from OSS Reviewed By: ejguan Differential Revision: D35342088 fbshipit-source-id: 22bfe78ae84e74141ae6560285c5c38bc068c999
|
Hey @jerryzh168. |
Stack from ghstack (oldest at bottom):
tois not called with positional args #75146Summary:
Previously we assume
tomust be called with positioanl args, but this may not be the case,e.g. we can do
to(dtype=?)orto(memory_format=?)Test Plan:
python test/test_quantization.py TestQuantizeFx
python test/test_quantization.py TestQuantizeFxOps
Reviewers:
Subscribers:
Tasks:
Tags:
Differential Revision: D35342088