Skip to content

Conversation

@supriyar
Copy link
Contributor

@supriyar supriyar commented Aug 29, 2019

Stack from ghstack:

Added bias as an optional param to the quantized_linear_prepack function.
Bias is quantized during runtime using input scale and weight scale.

Differential Revision: D17121304

Added bias as an optional param to the quantized_linear_prepack function.
Bias is quantized during runtime using input scale and weight scale.

Differential Revision: [D17121304](https://our.internmc.facebook.com/intern/diff/D17121304/)
@supriyar supriyar requested a review from apaszke as a code owner August 29, 2019 21:29
@pytorchbot pytorchbot added oncall: jit Add this issue/PR to JIT oncall triage queue module: nn Related to torch.nn module: operators oncall: quantization Quantization support in PyTorch labels Aug 29, 2019
…fbgemm"

Added bias as an optional param to the quantized_linear_prepack function.
Bias is quantized during runtime using input scale and weight scale.

Differential Revision: [D17121304](https://our.internmc.facebook.com/intern/diff/D17121304/)
…fbgemm"

Added bias as an optional param to the quantized_linear_prepack function.
Bias is quantized during runtime using input scale and weight scale.

Differential Revision: [D17121304](https://our.internmc.facebook.com/intern/diff/D17121304/)
supriyar added a commit that referenced this pull request Aug 30, 2019
Pull Request resolved: #25428

Added bias as an optional param to the quantized_linear_prepack function.
Bias is quantized during runtime using input scale and weight scale.
ghstack-source-id: 89269220

Differential Revision: [D17121304](https://our.internmc.facebook.com/intern/diff/D17121304/)
@supriyar

This comment has been minimized.

…fbgemm"

Added bias as an optional param to the quantized_linear_prepack function.
Bias is quantized during runtime using input scale and weight scale.

Differential Revision: [D17121304](https://our.internmc.facebook.com/intern/diff/D17121304/)
…fbgemm"

Added bias as an optional param to the quantized_linear_prepack function.
Bias is quantized during runtime using input scale and weight scale.

Differential Revision: [D17121304](https://our.internmc.facebook.com/intern/diff/D17121304/)
Copy link
Collaborator

@jamesr66a jamesr66a left a comment

Choose a reason for hiding this comment

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

ROCM failure is true-positive. The function signature at qlinear.cpp:218 needs to be updated

…fbgemm"

Added bias as an optional param to the quantized_linear_prepack function.
Bias is quantized during runtime using input scale and weight scale.

Differential Revision: [D17121304](https://our.internmc.facebook.com/intern/diff/D17121304/)
supriyar added a commit that referenced this pull request Aug 30, 2019
Pull Request resolved: #25428

Added bias as an optional param to the quantized_linear_prepack function.
Bias is quantized during runtime using input scale and weight scale.
ghstack-source-id: 89329368

Differential Revision: [D17121304](https://our.internmc.facebook.com/intern/diff/D17121304/)
@dskhudia
Copy link
Contributor

dskhudia commented Sep 4, 2019

I have approved it. Please take care of the tests.

…fbgemm"

Added bias as an optional param to the quantized_linear_prepack function.
Bias is quantized during runtime using input scale and weight scale.

Differential Revision: [D17121304](https://our.internmc.facebook.com/intern/diff/D17121304/)
/*ld=*/K,
/*pmat=*/nullptr, // PackBMatrix manages ownership of pmat
/*groups=*/1),
bias_contig,
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this work when bias is None?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is stored as an optional tensor - similar to the current linear op that has bias as an input argument. So if it is none then that gets taken care of.

@raghuramank100
Copy link
Contributor

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.

Looks great, a few suggested changes.

…fbgemm"

Added bias as an optional param to the quantized_linear_prepack function.
Bias is quantized during runtime using input scale and weight scale.

Differential Revision: [D17121304](https://our.internmc.facebook.com/intern/diff/D17121304/)
…fbgemm"

Added bias as an optional param to the quantized_linear_prepack function.
Bias is quantized during runtime using input scale and weight scale.

Differential Revision: [D17121304](https://our.internmc.facebook.com/intern/diff/D17121304/)
…fbgemm"

Added bias as an optional param to the quantized_linear_prepack function.
Bias is quantized during runtime using input scale and weight scale.

Differential Revision: [D17121304](https://our.internmc.facebook.com/intern/diff/D17121304/)
…fbgemm"

Added bias as an optional param to the quantized_linear_prepack function.
Bias is quantized during runtime using input scale and weight scale.

Differential Revision: [D17121304](https://our.internmc.facebook.com/intern/diff/D17121304/)
@supriyar supriyar requested a review from jianyuh September 6, 2019 00:36
@supriyar
Copy link
Contributor Author

supriyar commented Sep 6, 2019

Removed self.bias from the modules. Added bias() and weight() functions. Also renamed and updated the API for fbgemm_linear_dynamic
cc @jianyuh @raghuramank100

…fbgemm"

Added bias as an optional param to the quantized_linear_prepack function.
Bias is quantized during runtime using input scale and weight scale.

Differential Revision: [D17121304](https://our.internmc.facebook.com/intern/diff/D17121304/)
@jianyuh
Copy link
Member

jianyuh commented Sep 6, 2019

Removed self.bias from the modules. Added bias() and weight() functions. Also renamed and updated the API for fbgemm_linear_dynamic
cc @jianyuh @raghuramank100

The updated API for fbgemm_linear_dynamic looks good to me!

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 9d2d31e.

zdevito pushed a commit to zdevito/ATen that referenced this pull request Sep 6, 2019
Summary:
Pull Request resolved: pytorch/pytorch#25428

Added bias as an optional param to the quantized_linear_prepack function.
Bias is quantized during runtime using input scale and weight scale.
ghstack-source-id: 89601399

Test Plan: python test/run_test.py --exclude nn --verbose --bring-to-front quantization quantized quantized_tensor quantized_nn_mods quantizer

Differential Revision: D17121304

fbshipit-source-id: 8adb0e55e4aed0a5430aaa2c8639c8ad1639c85a
@facebook-github-bot facebook-github-bot deleted the gh/supriyar/7/head branch October 28, 2019 22:21
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 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.