Skip to content
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

How to specify fusion rules with quantization? #21251

Open
f2013519 opened this issue Jul 4, 2024 · 2 comments
Open

How to specify fusion rules with quantization? #21251

f2013519 opened this issue Jul 4, 2024 · 2 comments
Labels
quantization issues related to quantization

Comments

@f2013519
Copy link

f2013519 commented Jul 4, 2024

How do we specify fused operator patterns like (conv+relu) in the quantization config? I see such options are available in pytorch but not in onnx static_quantize.

Right now I see different scales at output of conv and relu which is not suitable for us as it will require additional requantize step.

Thanks!

@github-actions github-actions bot added the quantization issues related to quantization label Jul 4, 2024
@xadupre
Copy link
Member

xadupre commented Jul 5, 2024

If you need to fuse operator in a custom way, you can use this tool: https://onnxscript.ai/tutorial/rewriter/rewrite_patterns.html (you should install the development version).

@f2013519
Copy link
Author

i do not necessarily need a custom op, rather a way to specify convolution and relu should not have different scales as this can introduce noise.

although it would be good to have a standard fused op like conv-relu. any reason this is not supported yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
quantization issues related to quantization
2 participants