WebNN: Detect and transform QDQ
This detects potential QDQ (Quantize-Dequantize) patterns in the graph
and transform it to suitable form for backend fusion.
For example, here is the original graph:
... ...
\ /
DQ(0) DQ(1)
\ /
transpose(0) transpose(1)
\ /
conv2d(center operator)
\
transpose(2)
\
Q
The TFlite(LiteRT) backend can fuse conv2d with DQ inputs and Q outputs,
so we should swap the position of DQ(Q) and transpose to make it
suitable for backend fusion. Like this:
... ...
\ /
transpose(0) transpose(1)
\ /
DQ(0) DQ(1)
\ /
conv2d(center operator)
\
Q
\
transpose(2)
Bug: 414330683
Change-Id: I09f94483e48b88a9d4ee487b9861dd877103ec02
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6634994
Reviewed-by: ningxin hu <ningxin.hu@intel.com>
Commit-Queue: Jianxiao Lu <jianxiao.lu@intel.com>
Reviewed-by: Phillis Tang <phillis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1484129}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.