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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
FX graph mode quantization does not support F.linear and F.conv{n}d with kwargs only #87686
Comments
This sounds like a bug in FX graph mode quantization. Can you provide a reproducible example to help us look into it? |
I upload my code on github.The link is |
thank you! I narrowed it down to a small reproducible example:
This fails because the lowering code is assuming that ops such as |
@jerryzh168 , @andrewor14 , what's the latest on arg/kwarg normalization? I remember we talked about running this in the very beginning after capturing the FX graph, but not sure if it was rolled out. |
no plans to do it in the IR using torch ops, since current normalization (https://github.com/pytorch/pytorch/blob/master/torch/fx/experimental/normalize.py) have some corner cases like override and no one is working on that. We'll get normalization automatically in the new PT2 Export stack. Maybe we can just support normalization for a few selected ops like F.linear F.conv2d for now to unblock? |
Hi @wong00 , I created a manual normalization pass you could try on your model: https://gist.github.com/vkuzo/21c1ae37a262696faa5914843187426a . Could you see if it fixes your use case? We aren't sure if we will be able to check this into PyTorch in the near future because we are working on a new program capture frontend which should resolve these issues in a cleaner way. |
Thanks for your solution, I tried the normalize_conv_linear method, and meet this error:
|
this won't be fixed since we are moving to the new pytorch 2.0 export quantization flow and this should be supported in the new flow |
馃悰 Describe the bug
I used the from quantize_fx module to quantify my own model, the code is:
_the GeneratorFullModel is consist of two separate models, and the error is: _
Versions
pytorch==1.12.1
cc @jerryzh168 @jianyuh @raghuramank100 @jamesr66a @vkuzo
The text was updated successfully, but these errors were encountered: