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
[reland][quant][fix] Add bias once in conv_fused (#48593) #48661
Conversation
Summary: Previously _conv_forward will add self.bias to the result, so bias is added twice in qat ConvBn module this PR added a bias argument to _conv_forward and _conv_forward is called with zero bias in ConvBn module fixes: #48514 Test Plan: Imported from OSS Reviewed By: raghuramank100 [ghstack-poisoned]
Summary: Previously _conv_forward will add self.bias to the result, so bias is added twice in qat ConvBn module this PR added a bias argument to _conv_forward and _conv_forward is called with zero bias in ConvBn module fixes: #48514 Test Plan: Imported from OSS Reviewed By: raghuramank100 ghstack-source-id: 9650155f9df06d0bbf44888ebc637eb998af4e8a Pull Request resolved: #48661
💊 CI failures summary and remediationsAs of commit c7b7a84 (more details on the Dr. CI page):
XLA failureJob pytorch_xla_linux_bionic_py3_6_clang9_test is failing. Please create an issue with title prefixed by 🚧 1 ongoing upstream failure:These were probably caused by upstream breakages that are not fixed 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 20 times. |
Summary: Previously _conv_forward will add self.bias to the result, so bias is added twice in qat ConvBn module this PR added a bias argument to _conv_forward and _conv_forward is called with zero bias in ConvBn module fixes: #48514 Test Plan: Imported from OSS Reviewed By: raghuramank100 Differential Revision: [D25249175](https://our.internmc.facebook.com/intern/diff/D25249175) [ghstack-poisoned]
if self.bias: | ||
zero_bias = torch.zeros_like(self.bias) | ||
else: | ||
zero_bias = torch.zeros(self.out_channels, device=scaled_weight.device()) |
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.
nice catch. Can we add a comment here with the motivation, similar to this PR summary?
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: Previously _conv_forward will add self.bias to the result, so bias is added twice in qat ConvBn module this PR added a bias argument to _conv_forward and _conv_forward is called with zero bias in ConvBn module fixes: #48514 Test Plan: Imported from OSS Reviewed By: raghuramank100 Differential Revision: [D25249175](https://our.internmc.facebook.com/intern/diff/D25249175) [ghstack-poisoned]
Summary: Previously _conv_forward will add self.bias to the result, so bias is added twice in qat ConvBn module this PR added a bias argument to _conv_forward and _conv_forward is called with zero bias in ConvBn module fixes: #48514 Test Plan: Imported from OSS Reviewed By: raghuramank100 Differential Revision: [D25249175](https://our.internmc.facebook.com/intern/diff/D25249175) [ghstack-poisoned]
Summary: Previously _conv_forward will add self.bias to the result, so bias is added twice in qat ConvBn module this PR added a bias argument to _conv_forward and _conv_forward is called with zero bias in ConvBn module fixes: #48514 Test Plan: Imported from OSS Reviewed By: raghuramank100 Differential Revision: [D25249175](https://our.internmc.facebook.com/intern/diff/D25249175) [ghstack-poisoned]
Summary: Previously _conv_forward will add self.bias to the result, so bias is added twice in qat ConvBn module this PR added a bias argument to _conv_forward and _conv_forward is called with zero bias in ConvBn module fixes: #48514 Test Plan: Imported from OSS Reviewed By: raghuramank100 ghstack-source-id: bd0dce0962b57e78a4cac405658f644da384a25f Pull Request resolved: #48661
This pull request has been merged in 52f0af0. |
…orch#48661) Summary: Pull Request resolved: pytorch#48661 Previously _conv_forward will add self.bias to the result, so bias is added twice in qat ConvBn module this PR added a bias argument to _conv_forward and _conv_forward is called with zero bias in ConvBn module fixes: pytorch#48514 Test Plan: Imported from OSS Imported from OSS Reviewed By: vkuzo Differential Revision: D25249175 fbshipit-source-id: 4536c7545d3dcd7e8ea254368ffb7cf15118d78c
Stack from ghstack:
Summary:
Previously _conv_forward will add self.bias to the result, so bias is added twice in qat ConvBn module
this PR added a bias argument to _conv_forward and _conv_forward is called with zero bias
in ConvBn module
fixes: #48514
Test Plan: Imported from OSS
Reviewed By: raghuramank100
Differential Revision: D25249175