Commit graph

10 commits

Author SHA1 Message Date
Vincent Wang
03beed0ceb
Remove Cast before and after Gelu (#11885)
* fuse cast gelu

* use PropagateCastOps

* fix ut
2022-06-22 09:07:48 +08:00
Scott McKay
ef64b2ee52
Fix clash between QDQ propagation and TransposeOptimizer (#11636)
* Initial changes with comments on potential unit test changes.

* Update tests to disable TransposeOptimizer as that's simpler.
Add some extra comments.
Cleanup.

* Update comments in TransformGraph

* Add regression test.
Add limitation that transpose optimizer will ignore assigned nodes that do not match the context EP if that is set.

* Fix test. I removed a trailing Transpose after initial validation to simplify but that changed things so that the transpose optimizer didn't kick in, and the DQ -> Transpose -> Q was actually converted to a single Transpose by the CPU EP QDQ handling. Same end result in most builds so the subtle difference wasn't noticed, but in a build without contrib ops the CPU EP QDQ handling is disabled so the end result was different.

Update the test to re-instate the trailing Transpose so transpose optimizer alters the graph as desired.

* Don't run level 1 optimizers after partitioning as they don't guarantee to handle EP assignment for new nodes they create.
2022-06-03 16:16:35 -07:00
Edward Chen
180b3f7cc2
Update QDQFinalCleanup transformer to also handle removing DQ/Q node pairs. (#11219)
` -> DQ -> Q -> ` where DQ and Q have the same scale and zero point is not necessary.
2022-04-20 09:03:12 -07:00
Scott McKay
1f6d8248da
Add optional optimizer to remove leftover Q->DQ pairs after all other QDQ processing has completed (#10659)
Add an optimizer that can remove leftover Q->DQ pairs. Depending on the model this may help with performance and/or improve accuracy. Optional as it could make things worse so user needs to be aware of this and test what works best for their scenario. Enable with SessionOptions config param `session.enable_quant_qdq_cleanup`
2022-03-01 08:05:02 +10:00
Edward Chen
3199074ac7
Update QDQ propagation transformer to insert QDQ nodes (#10487)
Update QDQ propagation transformer to insert new QDQ nodes instead of moving the existing one. This creates a more consistent `DQ -> op -> Q` pattern for other components to recognize.
Upgrade this transformer to a basic level optimization as it yields a valid ONNX graph.
2022-02-14 14:20:03 -08:00
Yufeng Li
0e48187b4e
Add type checks for QDQ transformer (#7715) 2021-05-17 10:48:20 -07:00
Yufeng Li
ad15811ade
Add QDQ support for MatMulIntegerToFloat, Gather and Transpose (#7500)
* add QDQ support for MatMulIntegerToFloat, Gather and Transpose
2021-05-03 15:51:25 -07:00
Yufeng Li
e7912736b9
Add qdq propagation support (#7404)
* Add qdq propagation support

* add more unit tests
2021-04-23 11:17:44 -07:00
Yufeng Li
790fc11e60
QDQ: type conversion and more ops support (#7243)
* QDQ: add int8_t to uint8_t conversion and Relu/AveragePool support
2021-04-06 15:30:31 -07:00
Yufeng Li
8e54b76e2d
QDQ implementation (#7033)
* Add QDQ basic implementation
2021-03-25 09:17:23 -07:00