onnxruntime/include/onnxruntime/core/graph
Dmitri Smirnov f19c673595
If Branch Constant Folding (#18105)
### Description

When and if `If` condition proves to be a constant value, inline the
corresponding subgraph yielding to more constant folding and
optimization.

### Motivation and Context
Newly converted models feature lots of nested `If` nodes that can be
inlined and collapsed.

In particular, for the sample models we are gaining on TorchScript
exported models.
For `HF Mobile Bert Dynamo` runtime went down from 0.069 -> 0.046. In
total, AOT inlining + `If` constant folding
yields improvement of about 50% 0.102 -> 0.046. Brining us very close to
TorchScript exported models.

`HF Bart Dynamo` further improves 0.668 -> 0.45. AOT + `If` constant
folding improves 0.98 -> 0.45

Earlier the size of 
HF Mobile Bert **161Mb+**, now **98Mb**
HF Bart Dynamo pre-optimized model was about **1.2Gb**. It is now
**710MB**


![image](https://github.com/microsoft/onnxruntime/assets/11303988/1491a247-d371-4e66-85a3-2aeb702e8ca0)
2023-11-13 17:33:30 -08:00
..
basic_types.h
constants.h Support WebNN EP (#15698) 2023-05-08 21:25:10 -07:00
function.h Run clang-format in CI (#15524) 2023-04-18 09:26:58 -07:00
graph.h If Branch Constant Folding (#18105) 2023-11-13 17:33:30 -08:00
graph_nodes.h Graph transformer to ensure unique DQ nodes for QDQ node units (#15145) 2023-03-31 08:39:43 +10:00
graph_viewer.h
indexed_sub_graph.h [wasm] upgrade emsdk to 3.1.44 (#17069) 2023-08-10 16:08:36 -07:00
node_arg.h
schema_registry.h [wasm] upgrade emsdk to 3.1.44 (#17069) 2023-08-10 16:08:36 -07:00