yobx.xoptim.patterns_exp#

get_experimental_patterns#

yobx.xoptim.patterns_exp.get_experimental_patterns(verbose: int = 0) List[PatternOptimization][source]#

Returns a default list of optimization patterns for experimentation. It is equal to the following list.

<<<

from yobx.xoptim.patterns_api import pattern_table_doc
from yobx.xoptim.patterns_exp import get_experimental_patterns

print(pattern_table_doc(get_experimental_patterns(), as_rst=True))

>>>

name

short_name

priority

doc

0

AddAddMulMulPattern

AddAddMulMul

3

Replaces Add + Add by AddAdd or Mul + Mul by MulMul if they operate on the same shape. :param broadcast: allow broadcast on the first dimensions. Model with nodes to be fused…

1

AddAddMulMulBroadcastPattern

AddAddMulMulBroadcast

4

Replaces Add + Add by AddAdd or Mul + Mul by MulMul if they operate on the same shape. :param broadcast: allow broadcast on the first dimensions.

2

AddMulPattern

AddMul

3

Replaces Add + Mul by AddMul or Mul + Add by MulAdd if they operate on the same shape. :param broadcast: allow broadcast on the first dimensions. Model with nodes to be fused…

3

AddMulBroadcastPattern

AddMulBroadcast

4

Replaces Add + Mul by AddMul or Mul + Add by MulAdd if they operate on the same shape. :param broadcast: allow broadcast on the first dimensions.

4

AddMulSharedInputPattern

AddMulSharedInput

3

Replaces Add(A, B) and Add(A, C) by AddSharedInput(A, B, C) if they operate on the same shape. Does the same for operator Mul. :param broadcast: allow broadcast on the first dimensions. Model with nodes to be fused…

5

AddMulSharedInputBroadcastPattern

AddMulSharedInputBroadcast

4

Replaces Add(A, B) and Add(A, C) by AddSharedInput(A, B, C) if they operate on the same shape. Does the same for operator Mul. :param broadcast: allow broadcast on the first dimensions.

6

AddMulTransposePattern

AddMulTranspose

1

Replaces (AddMul|MulAdd) + Transpose by (AddMul|MulAdd)(., transposeMiddle=1) if it is possible. Model with nodes to be fused…

7

ConstantOfShapeScatterNDPattern

ConstantOfShapeScatterND

1

Replaces ConstantOfShape + ScatterND with ScatterNDOfShape. Model with nodes to be fused…

8

MaskedShapeScatterNDPattern

MaskedShapeScatterND

1

Replaces Equal, Where, ScatterNDOfShape by MaskedScatterNDOfShape. Model with nodes to be fused…

9

MulSigmoidPattern

MulSigmoid

1

Replaces Mul + Sigmoid by MulSigmoid if they operate on the same input. Model with nodes to be fused…

10

NegXplus1Pattern

NegXplus1

1

Replaces 1 - X by NegXplus1 if they operate on the same input. Model with nodes to be fused…

11

ReplaceZeroPattern

ReplaceZero

1

Replaces Where(bool(X), value, X) into ReplaceZero(X, by=by). Model with nodes to be fused…

12

SimpleRotaryPattern

SimpleRotary

1

Replaces Split Neg Concat by SimpleRotary. Model with nodes to be fused…

13

SubMulPattern

SubMul

3

Replaces Sub + Mul by AddMul or Mul + Add by MulAdd if they operate on the same shape. :param broadcast: allow broadcast on the first dimensions. Model with nodes to be fused…

14

SubMulBroadcastPattern

SubMulBroadcast

4

Replaces Add + Mul by AddMul or Mul + Add by MulAdd if they operate on the same shape. :param broadcast: allow broadcast on the first dimensions.

15

TransposeCastPattern

TransposeCast

3

Replaces Cast + Transpose or Transpose + Cast into Transpose2DCast16 or Transpose2DCastFP32 depending on the output type. Model with nodes to be fused…

16

TriMatrixPattern

TriMatrix

1

Replaces a sequence of nodes creating a triangular matrix with operator TriMatrix(…). Model with nodes to be fused…