Skip to content
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

[quant][fix] Add bias once in conv_fused #48593

Closed
wants to merge 6 commits into from

Conversation

jerryzh168
Copy link
Contributor

@jerryzh168 jerryzh168 commented Nov 30, 2020

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:

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: D25222215

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

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
@dr-ci
Copy link

dr-ci bot commented Nov 30, 2020

💊 CI failures summary and remediations

As of commit 17e2dbb (more details on the Dr. CI page):



🕵️ 1 new failure recognized by patterns

The following CI failures do not appear to be due to upstream breakages:

See CircleCI build pytorch_linux_xenial_cuda10_2_cudnn7_py3_gcc7_test2 (1/1)

Step: "Run tests" (full log | diagnosis details | 🔁 rerun)

Dec 01 00:16:36 ERROR [0.020s]: test_qat_prepare_device_affinity (quantization.test_quantize_fx.TestQuantizeFx)
Dec 01 00:16:36   File "/opt/conda/lib/python3.6/site-packages/torch/nn/intrinsic/qat/modules/conv_fused.py", line 372, in forward 
Dec 01 00:16:36     return F.relu(ConvBn2d._forward(self, input)) 
Dec 01 00:16:36   File "/opt/conda/lib/python3.6/site-packages/torch/nn/intrinsic/qat/modules/conv_fused.py", line 98, in _forward 
Dec 01 00:16:36     conv = self._conv_forward(input, scaled_weight, self.zero_bias) 
Dec 01 00:16:36   File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 390, in _conv_forward 
Dec 01 00:16:36     self.padding, self.dilation, self.groups) 
Dec 01 00:16:36 RuntimeError: Input type (torch.cuda.FloatTensor) and bias type (torch.FloatTensor) should be the same 
Dec 01 00:16:36  
Dec 01 00:16:36  
Dec 01 00:16:36 ====================================================================== 
Dec 01 00:16:36 ERROR [0.020s]: test_qat_prepare_device_affinity (quantization.test_quantize_fx.TestQuantizeFx) 
Dec 01 00:16:36 ---------------------------------------------------------------------- 
Dec 01 00:16:36 Traceback (most recent call last): 
Dec 01 00:16:36   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_quantized.py", line 122, in test_fn 
Dec 01 00:16:36     qfunction(*args, **kwargs) 
Dec 01 00:16:36   File "/var/lib/jenkins/workspace/test/quantization/test_quantize_fx.py", line 467, in test_qat_prepare_device_affinity 
Dec 01 00:16:36     model(input) 
Dec 01 00:16:36   File "/opt/conda/lib/python3.6/site-packages/torch/fx/graph_module.py", line 216, in wrapped_call 
Dec 01 00:16:36     return cls_call(self, *args, **kwargs) 
Dec 01 00:16:36   File "/opt/conda/lib/python3.6/site-packages/torch/nn/modules/module.py", line 744, in _call_impl 
Dec 01 00:16:36     result = self.forward(*input, **kwargs) 

🚧 1 fixed upstream failure:

These were probably caused by upstream breakages that were already fixed.

Please rebase on the viable/strict branch (expand for instructions)

If your commit is newer than viable/strict, you can try basing on an older, stable commit:

git fetch https://github.com/pytorch/pytorch viable/strict
git rebase --onto FETCH_HEAD $(git merge-base origin/master HEAD)

If your commit is older than viable/strict:

git fetch https://github.com/pytorch/pytorch viable/strict
git rebase FETCH_HEAD

Check out the recency history of this "viable master" tracking branch.


ci.pytorch.org: 1 failed


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.

See how this bot performed.

This comment has been revised 24 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:

Reviewers:

Subscribers:

Tasks:

Tags:

[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:

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D25222215](https://our.internmc.facebook.com/intern/diff/D25222215)

[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:

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D25222215](https://our.internmc.facebook.com/intern/diff/D25222215)

[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:

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D25222215](https://our.internmc.facebook.com/intern/diff/D25222215)

[ghstack-poisoned]
jerryzh168 added a commit that referenced this pull request Nov 30, 2020
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

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 5fe05c6ca7c7235e9ae3610fc53b79d1ffd614ec
Pull Request resolved: #48593
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:

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D25222215](https://our.internmc.facebook.com/intern/diff/D25222215)

[ghstack-poisoned]
jerryzh168 added a commit that referenced this pull request Nov 30, 2020
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

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: fe3a88745fac53665f2c3c45be78052399106644
Pull Request resolved: #48593
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in d2e4298.

@facebook-github-bot
Copy link
Contributor

This pull request has been reverted by c81f2d9.

jerryzh168 added a commit that referenced this pull request Dec 1, 2020
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]
jerryzh168 added a commit that referenced this pull request Dec 1, 2020
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
jerryzh168 added a commit that referenced this pull request Dec 1, 2020
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]
jerryzh168 added a commit that referenced this pull request Dec 2, 2020
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]
jerryzh168 added a commit that referenced this pull request Dec 2, 2020
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]
jerryzh168 added a commit that referenced this pull request Dec 2, 2020
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]
jerryzh168 added a commit that referenced this pull request Dec 2, 2020
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
facebook-github-bot pushed a commit that referenced this pull request Dec 2, 2020
Summary:
Pull Request resolved: #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: #48514

Test Plan:
Imported from OSS

Imported from OSS

Reviewed By: vkuzo

Differential Revision: D25249175

fbshipit-source-id: 4536c7545d3dcd7e8ea254368ffb7cf15118d78c
shaibagon pushed a commit to shaibagon/pytorch that referenced this pull request Dec 3, 2020
…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
@facebook-github-bot facebook-github-bot deleted the gh/jerryzh168/512/head branch December 4, 2020 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants