Skip to content

Commit 54e5b57

Browse files
committed
Add MatMul, RQMatMul, MatMulInteger
1 parent 7638c35 commit 54e5b57

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Deeploy/OperatorDescriptor.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,23 @@ def canonicalize(self, node: gs.Node, opset: int) -> bool:
466466
attrDescriptors = [],
467467
)
468468

469+
matMulDesc = OperatorDescriptor(
470+
inputDescriptor = IoDesc(["A", "B"]),
471+
outputDescriptor = IoDesc("data_out"),
472+
attrDescriptors = [],
473+
)
474+
475+
rqMatMulDesc = RequantizedOperatorDescriptor(
476+
inputDescriptor = IoDesc(["A", "B", "add", "mul"]),
477+
outputDescriptor = IoDesc("data_out"),
478+
attrDescriptors = [
479+
# RequantizedShift attrs
480+
AttrDesc("n_levels", IntUnpack),
481+
AttrDesc("signed", BoolUnpack),
482+
AttrDesc("div", IntUnpack),
483+
],
484+
)
485+
469486
defaultOperatorDescriptors: Dict[str, OperatorDescriptor] = {
470487
"Add": addDesc,
471488
"Concat": concatDesc,
@@ -480,11 +497,14 @@ def canonicalize(self, node: gs.Node, opset: int) -> bool:
480497
"ITAPartialMax": itaPartialMaxDesc,
481498
"IntegerDiv": integerDivDescriptor,
482499
"LayerNormalization": layerNormalizationDesc,
500+
"MatMul": matMulDesc,
501+
"MatMulInteger": matMulDesc,
483502
"MaxPool": maxPoolDesc,
484503
"Mul": mulDesc,
485504
"Pad": padDescOld,
486505
"Quant": quantDesc,
487506
"RQIntegerDiv": requantizedIntegerDivDescriptor,
507+
"RQMatMul": rqMatMulDesc,
488508
"ReduceMean": reduceMeanDesc,
489509
"ReduceSum": reduceSumDesc,
490510
"RequantizedConv": requantizedConvDesc,

0 commit comments

Comments
 (0)