[quant][graphmode][fix] Handle the case when observed node has no users#53210
[quant][graphmode][fix] Handle the case when observed node has no users#53210jerryzh168 wants to merge 3 commits intogh/jerryzh168/567/basefrom
Conversation
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: [ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit 43aa42b (more details on the Dr. CI page):
🕵️ 10 new failures recognized by patternsThe following CI failures do not appear to be due to upstream breakages:
|
| if first_use: | ||
| module_path, _ = quantizer.node_name_to_scope[first_use.name] | ||
| else: | ||
| # TODO: it's not used, so actually we can skip quantization |
There was a problem hiding this comment.
Does this mean that the observer has no user? In that case why do we insert observer?
There was a problem hiding this comment.
hmm, here it's because x.sigmiod_ is inplace operation, and it's included in the quantization patterns (maybe we should remove it), I also see this happen in pyper models, I'm not sure why that happens in pyper model.
… has no users" Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D26791724](https://our.internmc.facebook.com/intern/diff/D26791724) [ghstack-poisoned]
| def __init__(self): | ||
| super().__init__() | ||
|
|
||
| def forward(self, x): |
There was a problem hiding this comment.
sorry, I might be missing something, which value is not used and quantized?
| def forward(self, x): | ||
| x = x + x | ||
| x.sigmoid_() | ||
| return x |
There was a problem hiding this comment.
is the returned value different from
x1 = x + x
x2 = torch.sigmoid(x1)
return x2
?
There was a problem hiding this comment.
yes, the first x1 is returned with current implementation
There was a problem hiding this comment.
btw, the example is not important here, it's for reproducing the case when observer has 0 uses. (which appears in pyper and I'm not sure why yet)
… has no users" Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D26791724](https://our.internmc.facebook.com/intern/diff/D26791724) [ghstack-poisoned]
|
This pull request has been merged in d9fa957. |
…rs (pytorch#53210) Summary: Pull Request resolved: pytorch#53210 Test Plan: Imported from OSS Reviewed By: vkuzo Differential Revision: D26791724 fbshipit-source-id: b2a226a22d6aba86dd01cacbb56577048a289b3e
…rs (pytorch#53210) Summary: Pull Request resolved: pytorch#53210 Test Plan: Imported from OSS Reviewed By: vkuzo Differential Revision: D26791724 fbshipit-source-id: b2a226a22d6aba86dd01cacbb56577048a289b3e
Stack from ghstack:
Summary:
Test Plan:
Reviewers:
Subscribers:
Tasks:
Tags:
Differential Revision: D26791724