TbeReduceElemwiseFusionPass

Description

Performs UB fusion on the following pattern subgraph in the static shape scenario.

Mode 1:

Mode 2:

Restrictions

  • When this fusion pattern is used for operators with a large number of compute instructions (such as cos and sin), the compilation time may be too long. In this case, you are advised to disable this fusion pattern.
  • The restrictions of mode 1 are as follows:
    • Only static scenarios are supported.
    • There must be only one Elemwise1.
    • There must be only one CommReduce.
    • The Elemwise2 and Elemwise3 operators are optional. Their counts may be zero, but if present, each type must not exceed five.
    • Elemwise2 and Elemwise3 cannot be multi-input nodes.
  • The restrictions of mode 2 are as follows:
    • Only static scenarios are supported.
    • There must be only one CommReduce.
    • The number of Elemwise4 ranges from 1 to 5.
    • Elemwise4 cannot be a multi-input node.