Source code for experimental_experiment.xoptim.patterns_exp
fromtypingimportList
[docs]defget_experimental_patterns(verbose:int=0,)->List["PatternOptimization"]:# noqa: F821""" Returns a default list of optimization patterns for experimentation. It is equal to the following list. .. runpython:: :showcode: import pprint from experimental_experiment.xoptim.patterns_exp import ( get_experimental_patterns, ) pprint.pprint(get_experimental_patterns()) """from.binary_operatorsimport(AddAddMulMulPattern,AddAddMulMulBroadcastPattern,AddMulPattern,AddMulBroadcastPattern,AddMulSharedInputPattern,AddMulSharedInputBroadcastPattern,AddMulTransposePattern,MulSigmoidPattern,NegXplus1Pattern,SubMulPattern,SubMulBroadcastPattern,)from.constant_of_shape_scatter_ndimport(ConstantOfShapeScatterNDPattern,MaskedShapeScatterNDPattern,)from.constantsimportTriMatrixPatternfrom.simple_rotaryimportSimpleRotaryPatternfrom.unary_operatorsimportTransposeCastPatternfrom.where_replaceimportReplaceZeroPatternreturn[AddAddMulMulPattern(verbose=verbose),AddAddMulMulBroadcastPattern(verbose=verbose),AddMulPattern(verbose=verbose),AddMulBroadcastPattern(verbose=verbose),AddMulSharedInputPattern(verbose=verbose),AddMulSharedInputBroadcastPattern(verbose=verbose),AddMulTransposePattern(verbose=verbose),ConstantOfShapeScatterNDPattern(verbose=verbose),MaskedShapeScatterNDPattern(verbose=verbose),MulSigmoidPattern(verbose=verbose),NegXplus1Pattern(verbose=verbose),ReplaceZeroPattern(verbose=verbose),SimpleRotaryPattern(verbose=verbose),SubMulPattern(verbose=verbose),SubMulBroadcastPattern(verbose=verbose),TransposeCastPattern(verbose=verbose),TriMatrixPattern(verbose=verbose),]