Could we know detail about the applied optimization level?

To partially answer your first question, you can see some discussion of this in my thread here. This is not a complete set of passes, but a given pass is applied if opt_level >= [number].

OPT_PASS_LEVEL = {
    "SimplifyInference": 0,
    "OpFusion": 1,
    "FoldConstant": 2,
    "FoldScaleAxis": 3,
    "AlterOpLayout": 3,
    "CanonicalizeOps": 3,
    "CanonicalizeCast": 3,
    "EliminateCommonSubexpr": 3,
    "CombineParallelConv2D": 4,
    "CombineParallelDense": 4,
    "CombineParallelBatchMatmul": 4,
    "FastMath": 4
}

E.g., OpFusion is applied when opt_level >= 1.

2 Likes