onnxruntime/include/onnxruntime/core
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
..
common remove gsl to make status.h independent from gsl (#17402) 2023-09-13 21:47:43 -07:00
eager Run clang-format in CI (#15524) 2023-04-18 09:26:58 -07:00
framework implement isinf20 and isnan20 (#17874) 2023-10-24 10:58:54 -07:00
graph If Branch Constant Folding (#18105) 2023-11-13 17:33:30 -08:00
optimizer fix compilation error in no absl build (#15769) 2023-05-02 08:20:49 -07:00
platform Bump linter versions (#18341) 2023-11-08 13:04:40 -08:00
providers Align context virtuals (#18396) 2023-11-11 12:41:37 +10:00
session [Migraphx EP] Static int8 QDQ support (#17931) 2023-11-09 17:46:49 +08:00