-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Quantization] Fix annotation for multiply op #4458
Conversation
@vinx13 I'm trying to get a simple quantization test case working. How can I get an int8 output from below? I'm getting FP32 result. UPDATE: I need to add skip_conv_layers=[] to qconfig to force quantization on the first conv layer. But then I get an error at MulRealize. Working on it.
|
dcbc552
to
c48f82b
Compare
} | ||
if (rhs->dtype != dtype) { | ||
rdata = Cast(rdata, dtype); | ||
} else { | ||
CHECK_EQ(rhs->dtype, dtype); | ||
} |
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.
Is there a deep reason for having this check?
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.
this check seems very trivial... @ZihengJiang ?
@vinx13 @ZihengJiang ready for review. |
ping @vinx13 @ZihengJiang can we merge this? |
* fix mul rewrite * register Realize Rewrite for global avg pool and add test * remove unnecessary check * improve the test case
* fix mul rewrite * register Realize Rewrite for global avg pool and add test * remove unnecessary check * improve the test case
When I tried to quantize a model with squeeze and excitation block, I hit the error at this line. The RHS of the multiply op should be checked for being constant, rather than hardcoded as weight.