Skip to content

Conversation

@jerryzh168
Copy link
Contributor

@jerryzh168 jerryzh168 commented Jun 18, 2019

Stack:
    :white_circle:  #21930 nn.quantized.Relu and nn.quantize.Quantize/DeQuantize modules  💛
    :white_circle:  #21925 [quant] Add serialization for nn.quantized.Linear module  💛
    :black_circle:  #21921 Implementation of nn.quantized.linear module  💚

Call FBGEMM kernels to implement quantized linear operator. This operator is used only for inference.

Differential Revision: D15375695

Differential Revision: D15375695
Differential Version: 85144759
@pytorchbot pytorchbot added module: nn Related to torch.nn module: tests Issues related to tests (not the torch.testing module) labels Jun 18, 2019
Differential Revision: D15375695
Differential Version: 85155178
Differential Revision: D15375695
Differential Version: 85219380
Differential Revision: D15375695
Differential Version: 85439410
Differential Revision: D15375695
Differential Version: 85477647
Differential Revision: D15375695
Differential Version: 85509305
Differential Revision: D15375695
Differential Version: 85588772
Differential Revision: D15375695
Differential Version: 85589881
Copy link
Collaborator

@dzhulgakov dzhulgakov left a comment

Choose a reason for hiding this comment

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

Please address comments before landing

Differential Revision: D15375695
Differential Version: 85634127
Copy link
Contributor

@raghuramank100 raghuramank100 left a comment

Choose a reason for hiding this comment

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

Can we handle bias=False also?

__constants__ = ['bias', 'in_features', 'out_features']

def __init__(self, in_features, out_features, bias=True):
assert bias, 'nobias is not supported Quantized Linear module yet'
Copy link
Contributor

Choose a reason for hiding this comment

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

We should handle case with bias=False. In this case, there will be no self.bias to delete. We would still create qbias and set it to all zeros.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you mean just accept the argument and keep the behavior the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if we use this hack then quantized module will always have bias after deserialization even when user specify bias=False.

I think we can only support it if fbgemm has nobias implementation

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed.

Differential Revision: D15375695
Differential Version: 85655452
Differential Revision: D15375695
Differential Version: 85656064
Differential Revision: D15375695
Differential Version: 85723371
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 5c46e70.

xzhu1900 pushed a commit to xzhu1900/pytorch that referenced this pull request Jul 5, 2019
Summary:
Pull Request resolved: pytorch#21921

Call FBGEMM kernels to implement quantized linear operator. This operator is used only for inference.

Differential Revision: D15375695

fbshipit-source-id: b9ca6c156fd60481fea83e55603b2897f7bfc3eb
@ezyang ezyang deleted the export-D15375695 branch July 19, 2019 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: nn Related to torch.nn module: tests Issues related to tests (not the torch.testing module)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants