Skip to content

Commit d917e4e

Browse files
committed
Add DebugPrint, LayerNormalization, iLayerNorm
1 parent 6472cf3 commit d917e4e

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

Deeploy/OperatorDescriptor.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,29 +410,50 @@ def canonicalize(self, node: gs.Node, opset: int) -> bool:
410410
AttrDesc("div", IntUnpack),
411411
])
412412

413+
debugPrintDesc = OperatorDescriptor(
414+
inputDescriptor = IoDesc("data_in"),
415+
outputDescriptor = IoDesc("data_out"),
416+
attrDescriptors = [],
417+
)
418+
419+
layerNormalizationDesc = OperatorDescriptor(
420+
inputDescriptor = IoDesc(["data_in", "weight", "bias"]),
421+
outputDescriptor = IoDesc("data_out"),
422+
attrDescriptors = [AttrDesc("epsilon", FloatUnpack)],
423+
)
424+
425+
iLayerNormDesc = OperatorDescriptor(
426+
inputDescriptor = IoDesc(["data_in", "weight", "bias"]),
427+
outputDescriptor = IoDesc("data_out"),
428+
attrDescriptors = [AttrDesc("D", IntUnpack), AttrDesc("n_levels", IntUnpack)],
429+
)
430+
413431
defaultOperatorDescriptors: Dict[str, OperatorDescriptor] = {
414432
"Add": addDesc,
415433
"Concat": concatDesc,
416434
"Conv": convDesc,
435+
"DebugPrint": debugPrintDesc,
417436
"Dequant": dequantDesc,
418437
"Div": divDesc,
419438
"Gelu": geluDesc,
420-
"IntegerDiv": integerDivDescriptor,
421439
"ITAMax": itaMaxDesc,
422440
"ITAPartialMax": itaPartialMaxDesc,
441+
"IntegerDiv": integerDivDescriptor,
442+
"LayerNormalization": layerNormalizationDesc,
423443
"MaxPool": maxPoolDesc,
424444
"Pad": padDescOld,
425445
"Quant": quantDesc,
446+
"RQIntegerDiv": requantizedIntegerDivDescriptor,
426447
"ReduceMean": reduceMeanDesc,
427448
"ReduceSum": reduceSumDesc,
428449
"RequantizedConv": requantizedConvDesc,
429450
"RequantizediGELU": rqsIGeluDesc,
430-
"RQIntegerDiv": requantizedIntegerDivDescriptor,
431451
"Slice": sliceDesc,
432452
"Softmax": softmaxDesc,
433453
"SoftmaxGrad": softmaxGradDesc,
434454
"Transpose": transposeDesc,
435455
"iHardswish": iHardswishDesc,
456+
"iLayerNorm": iLayerNormDesc,
436457
"iNoNorm": iNoNormDesc,
437458
"iRMSNorm": iRMSNormDesc,
438459
"iSoftmax": iSoftmaxDesc,

0 commit comments

Comments
 (0)