.xoptim.patterns_exp¶
modules
- experimental_experiment.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 experimental_experiment.xoptim.patterns_api import pattern_table_doc from experimental_experiment.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.
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.
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.
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.
7
ConstantOfShapeScatterNDPattern
ConstantOfShapeScatterND
1
Replaces ConstantOfShape + ScatterND with ScatterNDOfShape.
8
MaskedShapeScatterNDPattern
MaskedShapeScatterND
1
Replaces Equal, Where, ScatterNDOfShape by MaskedScatterNDOfShape.
9
MulSigmoidPattern
MulSigmoid
1
Replaces Mul + Sigmoid by MulSigmoid if they operate on the same input.
10
NegXplus1Pattern
NegXplus1
1
Replaces 1 - X by NegXplus1 if they operate on the same input.
11
ReplaceZeroPattern
ReplaceZero
1
Replaces Where(bool(X), value, X) into ReplaceZero(X, by=by).
12
SimpleRotaryPattern
SimpleRotary
1
Replaces ConstantOfShape + ScatterND with ScatterNDOfShape (com.domain).
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.
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.
16
TriMatrixPattern
TriMatrix
1
Replaces a sequence of nodes creating a triangular matrix with operator TriMatrix(…).