Open xczhai opened 8 months ago
Hey @xczhai may I work on this...
Hey @xczhai may I work on this...
@siddhant-0707 Sure, you can take it. Thanks!
Hey @xczhai may I work on this...
@siddhant-0707 Yes. If you have any questions, please reach me. Thanks.
Hi @siddhant-0707, are you still working on this issue or can I return it to be picked up by other contributors?
Thank you for looking into this issue! Please let us know if you have any questions or require any help.
hello @p-wysocki , I would like to have a look at it, and work over is , may I ?
if so , can I be assigned it @xczhai
@p-wysocki , @mlukasze @xczhai or someone , can you please explain what exactly has to be done in this , I mean based on my understanding of the context given. The PaddlePaddle operator was implemented both in paddle frontend and ONNX frontend.
But there happens to be a little difference in the way how it is implemented , as
PaddlePaddle fuses the
quantize_linear
anddequantize_linear
intoFakeQuantize
using a custom pass( https://github.com/openvinotoolkit/openvino/blob/master/src/frontends/paddle/src/internal/pass/transform_fakequantize.cpp) but ONNX FE just doesn't.
So , PaddlePaddle has to be implemented in ONNX format? is that all or did I miss something , please add
@gaganchapa Yes, you are right. I prepared a graph for you. Maybe it can help you understand it.
@xczhai @p-wysocki please correct me , if I go wrong :
Is that all or , am I missing something ?I'm always open to suggestions in any form to enhance this. Your insights and ideas are highly valued! Please feel free to share your thoughts on how we can make this even better. Your input is greatly appreciated! :rocket:
@SANTHOSH-MAMIDISETTI 1 is right. And 2&3 are wrong. ONNX implementation can be considered as gold or reference. Just need to modify the PDPD files as I described way1 or way2 in above picture comments.
@SANTHOSH-MAMIDISETTI 1 is right. And 2&3 are wrong. ONNX implementation can be considered as gold or reference. Just need to modify the PDPD files as I described way1 or way2 in above picture comments.
Ooh!, Thanks a lot for the clarification !! ,
Hello @SANTHOSH-MAMIDISETTI, are you still working on this issue?
hi @p-wysocki sir , right now my end semester exams are going on , they will continue till feb 11th , so I am unable to focus fully on this issue. but after Feb 11th i'll be able to concentrate fully over it.
Hello @p-wysocki and @xczhai ,
If possible, could you please provide a step-by-step list of the tasks required for refactoring the PaddlePaddle quantization implementation to align with ONNX? Specifically, I'd like to know:
A clear list of these tasks would greatly help in understanding the scope of the work involved. Thank you!
@gaganchapa
.take
Thank you for looking into this issue! Please let us know if you have any questions or require any help.
Hi @xczhai I have a couple of questions regarding this task. Where can I find onnx quantized model
and PDPD quantized model
? Should they refer to the same model?
Also, once I converted them into openvino IR, is there any tool for visualizing and comparing them?
@DaniAffCH Hi,
onnx quantized model
: https://github.com/onnx/models/tree/main/validated/vision/classification/resnetPDPD quantized model
: https://github.com/PaddlePaddle/FastDeploy/blob/develop/docs/en/quantize.md#paddleclasseriesHi @xczhai just to understand the task better. What are the differences I should notice? On the right side the converted ONNX and in the left the converted PDPD
@DaniAffCH It is unclear to check the whole graph. Could you help share both files with me?
Gentle request for a followup :)
sorry for reply late.
quantize_linear
& dequantize_linear
op are translated in PDPD frontend and ONNX frontend in different way. dequantize_linear
mapped into OpenVINO FakeQuantize IR.dequantize_linear
mapped into serveral OpenVINO IRs without FakeQuantize.Hello @DaniAffCH, are you still working on that task?
Hi @p-wysocki, no I'm no longer working on this because I'm currently focussing on the NNCF repo. I'll self-unassign me
Thanks for info @DaniAffCH and good luck with NNCF :)
Thank you for looking into this issue! Please let us know if you have any questions or require any help.
Hello @liutianguo, are you still working on that issue? Do you need any help?
Context
The current PaddlePaddle quantization implementation is different from ONNX,.
Same
PaddlePaddle translates
quantize_linear
anddequantize_linear
in the paddle frontend.ONNX just translates
quantize_linear
anddequantize_linear
without any transformation in the onnx frontend.Difference
PaddlePaddle fuses the
quantize_linear
anddequantize_linear
intoFakeQuantize
using a custom pass( https://github.com/openvinotoolkit/openvino/blob/master/src/frontends/paddle/src/internal/pass/transform_fakequantize.cpp) but ONNX FE just doesn't.It is hard to maintain the almost same logic. So need to refactor PaddlePaddle quantization like ONNX. Also, more patterns in the model will affect transformation performance.
What needs to be done?
Example Pull Requests
Please refer to https://github.com/openvinotoolkit/openvino/pull/14834/ for more comments and background. test case: https://github.com/openvinotoolkit/openvino/pull/20689
Resources
Contact points
@xczhai
Ticket
104434