Add support for QLinearConv
The goal of this issue is to add support for QLinearConv Operator https://github.com/onnx/onnx/blob/main/docs/Operators.md#QLinearConv
To do so, I propose to add a function to fuse all Conv + Scaling operator into a MetaOperator QLinearConv. This function will be left to the user to call depending on how he wants to export his quantized network. (Exporting each operator idependantly or using QOp from ONNX)
Then we will need to add the support for the export of this new MetaOperator.
TODO:
import
- Add support in import node for MetaOperators QLinearConv, QuantizeLinear and DequantizeLinear
- Perform inferences in the exported model and onnx model and verify results (testing with multiple ORT Session options may be needed)
export
- Add/fuse QuantizeLinear - Add DequantizeLinear Meraoperators
- Fuse into QLinearConv Metaoperator
- Modify graph into ONNX's quantized format
- Add support in export node for a MetaOperators QLinearConv, QuantizeLinear and DequantizeLinear
- Perform inferences in the exported model and aidge model and verify results (testing with multiple ORT Session options may be needed)
- Method to freeze weights and biases to be able to fold into quantized producers
- Method for the removal of quantize and dequantize operators (they will cancel each other out)
verifications
- compare imported metaoperators and exported metaoperators (after recipe)
- correct export of imported quantized ONNX model
Note: Due to future removal of Scaling node the regex to use in
aidge_core.fuse_to_metaops()
may change but this is a minor change