-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[quantization] Store bias in PackedLinearWeight struct in fbgemm #25428
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
Conversation
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/)
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/)
This comment has been minimized.
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/)
jamesr66a
left a comment
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.
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/)
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/)
|
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, |
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.
How does this work when bias is None?
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 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
left a comment
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.
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/)
|
Removed self.bias from the modules. Added |
…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/)
The updated API for |
|
This pull request has been merged in 9d2d31e. |
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
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