Skip to content

[quant] conv_transpose graph patterns#43199

Merged
z-a-f merged 15 commits intogh/z-a-f/52/basefrom
gh/z-a-f/52/head
Sep 16, 2020
Merged

[quant] conv_transpose graph patterns#43199
z-a-f merged 15 commits intogh/z-a-f/52/basefrom
gh/z-a-f/52/head

Conversation

@z-a-f
Copy link
Copy Markdown

@z-a-f z-a-f commented Aug 18, 2020

Stack from ghstack:

Differential Revision: D23228954

@dr-ci
Copy link
Copy Markdown

dr-ci Bot commented Aug 18, 2020

💊 CI failures summary and remediations

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


  • 2/2 failures possibly* introduced in this PR
    • 2/2 non-CircleCI failure(s)

Extra GitHub checks: 1 failed


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 86 times.

@z-a-f z-a-f requested a review from jerryzh168 August 18, 2020 18:28
Copy link
Copy Markdown
Contributor

@jerryzh168 jerryzh168 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add a test for this as well

@z-a-f z-a-f requested a review from jerryzh168 August 25, 2020 01:43
z-a-f pushed a commit that referenced this pull request Aug 25, 2020
ghstack-source-id: d2cb7af
Pull Request resolved: #43199
Comment thread test/quantization/test_quantize_jit.py Outdated
Comment on lines +3056 to +3058
rtol=1e-2,
atol=1e-2)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jerryzh168 For some reason there is no exact match -- 1e-2 works though :/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you show is it the traced model or scripted model that is failing?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's failing for both trace model and the script model

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I think the graph is not even replaced with the quantized versions -- I might have missed something

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, please print the graphs

Copy link
Copy Markdown
Author

@z-a-f z-a-f Aug 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, please print the graphs

Eager model AnnotatedConvModel(
  (conv): QuantizedConvTranpose2d(3, 5, kernel_size=(3, 3), stride=(1, 1), scale=0.004468684550374746, zero_point=151)
  (quant): Quantize(scale=tensor([0.0039]), zero_point=tensor([0]), dtype=torch.quint8)
  (dequant): DeQuantize()
)

MuT graph graph(%self : __torch__.torch.testing._internal.common_quantization.___torch_mangle_3.ConvModel,
      %x.1 : Tensor):
  %4 : None = prim::Constant()
  %2 : __torch__.torch.nn.modules.conv.___torch_mangle_2.ConvTranspose2d = prim::GetAttr[name="conv"](%self)
  %x.3 : Tensor = prim::CallMethod[name="forward"](%2, %x.1, %4) # /home/zafar/Git/pytorch-dev/pytorch-convtranspose-new/torch/testing/_internal/common_quantization.py:594:12
  return (%x.3)

quantized MuT graph graph(%self : __torch__.torch.testing._internal.common_quantization.___torch_mangle_18.ConvModel,
      %x.1 : Tensor):
  %5 : int = prim::Constant[value=1]() # /home/zafar/Git/pytorch-dev/pytorch-convtranspose-new/torch/nn/modules/conv.py:909:66
  %4 : int[] = prim::Constant[value=[0, 0]]()
  %3 : int[] = prim::Constant[value=[1, 1]]()
  %self.conv.bias : None = prim::Constant()
  %self.conv.weight : Float(3:45, 5:9, 3:3, 3:1, requires_grad=0, device=cpu) = prim::Constant[value=<Tensor>]()
  %x.3 : Tensor = aten::conv_transpose2d(%x.1, %self.conv.weight, %self.conv.bias, %3, %4, %4, %5, %3) # /home/zafar/Git/pytorch-dev/pytorch-convtranspose-new/torch/nn/modules/conv.py:911:15
  return (%x.3)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#resolved Thanks Jerry!

z-a-f pushed a commit that referenced this pull request Aug 25, 2020
ghstack-source-id: d83c751
Pull Request resolved: #43199
Copy link
Copy Markdown
Contributor

@jerryzh168 jerryzh168 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

z-a-f pushed a commit that referenced this pull request Sep 3, 2020
ghstack-source-id: 36cc106
Pull Request resolved: #43199
@vkuzo
Copy link
Copy Markdown
Contributor

vkuzo commented Sep 3, 2020

would be great to include some context and a test plan in the PR summary

z-a-f pushed a commit that referenced this pull request Sep 10, 2020
ghstack-source-id: 8de3f80
Pull Request resolved: #43199
z-a-f pushed a commit that referenced this pull request Sep 11, 2020
ghstack-source-id: ccbe8e4
Pull Request resolved: #43199
z-a-f pushed a commit that referenced this pull request Sep 11, 2020
ghstack-source-id: 866f3c1
Pull Request resolved: #43199
z-a-f pushed a commit that referenced this pull request Sep 13, 2020
ghstack-source-id: 1555ae1
Pull Request resolved: #43199
@z-a-f z-a-f merged commit 1a0f566 into gh/z-a-f/52/base Sep 16, 2020
z-a-f pushed a commit that referenced this pull request Sep 16, 2020
ghstack-source-id: d949aa1
Pull Request resolved: #43199
z-a-f pushed a commit that referenced this pull request Sep 21, 2020
ghstack-source-id: ea4793c
Pull Request resolved: #43199
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants