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][graphmode] Integration tests for initial quantization graph mode #24428

Closed
wants to merge 22 commits into from

Conversation

jerryzh168
Copy link
Contributor

@jerryzh168 jerryzh168 commented Aug 15, 2019

Stack from ghstack:

Summary:
att

Test Plan:
python test/test_quantizer.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

Differential Revision: D17001136

Summary:
att

Test Plan:
python test/test_quantizer.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:
@pytorchbot pytorchbot added the oncall: quantization Quantization support in PyTorch label Aug 15, 2019
jerryzh168 added a commit that referenced this pull request Aug 15, 2019
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:
jerryzh168 added a commit that referenced this pull request Aug 15, 2019
Summary:
att

Test Plan:
python test/test_quantizer.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:

ghstack-source-id: 7e1980c6e5e02b740db50299fc8be69a1cde35e1
Pull Request resolved: #24428
@ezyang ezyang added oncall: quantization Quantization support in PyTorch and removed oncall: quantization Quantization support in PyTorch labels Aug 16, 2019
…ion graph mode"

Summary:
att

Test Plan:
python test/test_quantizer.py

Reviewers:
pt1quant

Subscribers:

Tasks:

Tags:
jerryzh168 added a commit that referenced this pull request Aug 17, 2019
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:
jerryzh168 added a commit that referenced this pull request Aug 20, 2019
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:
jerryzh168 added a commit that referenced this pull request Aug 21, 2019
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:
jerryzh168 added a commit that referenced this pull request Aug 21, 2019
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:
Copy link

@ZolotukhinM ZolotukhinM left a 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 Show resolved Hide resolved
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)

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.

Copy link
Contributor Author

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

test/test_quantizer.py Outdated Show resolved Hide resolved
test/test_quantizer.py Show resolved Hide resolved
test/test_quantizer.py Outdated Show resolved Hide resolved
test/test_quantizer.py Outdated Show resolved Hide resolved
@@ -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):

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?

Copy link
Contributor Author

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:
@jerryzh168 jerryzh168 mentioned this pull request Aug 23, 2019
Closed
…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)
@pytorchbot pytorchbot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Aug 26, 2019
…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)
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in a1bf4d7.

@facebook-github-bot facebook-github-bot deleted the gh/jerryzh168/31/head branch October 28, 2019 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Merged oncall: jit Add this issue/PR to JIT oncall triage queue oncall: quantization Quantization support in PyTorch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants