-
Notifications
You must be signed in to change notification settings - Fork 23.1k
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][graphmode] Integration tests for initial quantization graph mode #24428
Conversation
Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags:
Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags: ghstack-source-id: 033c0b469342e4a617b1644b9c112e0b337da744 Pull Request resolved: #24428
…ion graph mode" Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags:
Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags: ghstack-source-id: 7e1980c6e5e02b740db50299fc8be69a1cde35e1 Pull Request resolved: #24428
…ion graph mode" Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags:
Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags: ghstack-source-id: f5ef924bfed2b850a3567dcd5b2d49f3ed5d52f6 Pull Request resolved: #24428
…ion graph mode" Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags:
Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags: ghstack-source-id: 0edb1aac7bb62fddaad500f6510f6fcbcfdcb7e3 Pull Request resolved: #24428
…ion graph mode" Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags:
…ion graph mode" Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags:
…ion graph mode" Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags:
Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags: ghstack-source-id: 67e190bdf8c15904cf2ce9d839277fe7cb585ccd Pull Request resolved: #24428
…ion graph mode" Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags:
…ion graph mode" Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags:
Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags: ghstack-source-id: 276d5220cd867fed19ec90e1427274ff14c3eb0d Pull Request resolved: #24428
…ion graph mode" Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags:
…ion graph mode" Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags:
…ion graph mode" Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags:
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.
We have the end-to-end flow working, sweet!
test/test_quantizer.py
Outdated
script_module = TestScriptM() | ||
script_module.conv.weight = torch.nn.Parameter(eager_module.conv.weight.detach()) | ||
quantized_eager_module = quantize(eager_module, default_eval_fn, data) | ||
torch._C._jit_set_inline_everything_mode(False) |
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.
It's better to use the corresponding decorator on a function to make sure we don't affect other tests.
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.
we actually need to inline for now and don't inline will be supported later, this line has no effect right now since it is after creation of ScriptModule
@@ -222,3 +225,110 @@ def forward(self, x): | |||
self.assertTrue('z' in eagerDict and 'z.1' in activationDict) | |||
self.assertAlmostEqual(eagerDict["z"][0], activationDict["z.1"][0], places=15) | |||
self.assertAlmostEqual(eagerDict["z"][1], activationDict["z.1"][1], places=15) | |||
|
|||
def test_compare_qparam_eager_script_default(self): |
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.
Nit: what do 'qparam' and 'default' words mean in the name of this test?
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.
I plan to rename this to test_default in later PR..
default just means simple/naive situation, maybe I can rename that to test_simple
…ion graph mode" Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags:
…ion graph mode" Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags:
…ion graph mode" Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags:
…ion graph mode" Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags:
…ion graph mode" Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags:
…ion graph mode" Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags:
…ion graph mode" Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags:
…ion graph mode" Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags: Differential Revision: [D17001136](https://our.internmc.facebook.com/intern/diff/D17001136)
…ion graph mode" Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags: Differential Revision: [D17001136](https://our.internmc.facebook.com/intern/diff/D17001136)
…ion graph mode" Summary: att Test Plan: python test/test_quantizer.py Reviewers: pt1quant Subscribers: Tasks: Tags: Differential Revision: [D17001136](https://our.internmc.facebook.com/intern/diff/D17001136)
This pull request has been merged in a1bf4d7. |
Stack from ghstack:
Summary:
att
Test Plan:
python test/test_quantizer.py
Reviewers:
pt1quant
Subscribers:
Tasks:
Tags:
Differential Revision: D17001136