Skip to content

Commit

Permalink
[res] Add mx type BatchMatMul recipes (Samsung#14309)
Browse files Browse the repository at this point in the history
This adds mx type BMM recipes.

ONE-DCO-1.0-Signed-off-by: Hyukjin Jeong <[email protected]>
  • Loading branch information
jinevening authored and BLee-bot committed Nov 6, 2024
1 parent cff337a commit 4c27b54
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 0 deletions.
59 changes: 59 additions & 0 deletions res/CircleRecipes/CircleBatchMatMul_MXFP4_000/test.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
operand {
name: "ifm1"
type: FLOAT32
shape { dim: 1 dim: 1 dim: 32 dim: 32 }
}
operand {
name: "ifm2"
type: FLOAT32
shape { dim: 1 dim: 1 dim: 32 dim: 32 }
}
operand {
name: "ifm1_mxfp4"
type: MXFP4
shape { dim: 1 dim: 1 dim: 32 dim: 32 }
}
operand {
name: "ifm2_mxfp4"
type: MXFP4
shape { dim: 1 dim: 1 dim: 32 dim: 32 }
}
operand {
name: "ofm_mxfp4"
type: MXFP4
shape { dim: 1 dim: 1 dim: 32 dim: 32 }
}
operand {
name: "ofm"
type: FLOAT32
shape { dim: 1 dim: 1 dim: 32 dim: 32 }
}
operation {
type: "Quantize"
input: "ifm1"
output: "ifm1_mxfp4"
}
operation {
type: "Quantize"
input: "ifm2"
output: "ifm2_mxfp4"
}
operation {
type: "BatchMatMul"
input: "ifm1_mxfp4"
input: "ifm2_mxfp4"
output: "ofm_mxfp4"
batch_matmul_options {
adjoint_lhs: false
adjoint_rhs: false
}
}
operation {
type: "Dequantize"
input: "ofm_mxfp4"
output: "ofm"
}
input: "ifm1"
input: "ifm2"
output: "ofm"

59 changes: 59 additions & 0 deletions res/CircleRecipes/CircleBatchMatMul_MXINT8_000/test.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
operand {
name: "ifm1"
type: FLOAT32
shape { dim: 1 dim: 1 dim: 32 dim: 32 }
}
operand {
name: "ifm2"
type: FLOAT32
shape { dim: 1 dim: 1 dim: 32 dim: 32 }
}
operand {
name: "ifm1_mxint8"
type: MXINT8
shape { dim: 1 dim: 1 dim: 32 dim: 32 }
}
operand {
name: "ifm2_mxint8"
type: MXINT8
shape { dim: 1 dim: 1 dim: 32 dim: 32 }
}
operand {
name: "ofm_mxint8"
type: MXINT8
shape { dim: 1 dim: 1 dim: 32 dim: 32 }
}
operand {
name: "ofm"
type: FLOAT32
shape { dim: 1 dim: 1 dim: 32 dim: 32 }
}
operation {
type: "Quantize"
input: "ifm1"
output: "ifm1_mxint8"
}
operation {
type: "Quantize"
input: "ifm2"
output: "ifm2_mxint8"
}
operation {
type: "BatchMatMul"
input: "ifm1_mxint8"
input: "ifm2_mxint8"
output: "ofm_mxint8"
batch_matmul_options {
adjoint_lhs: false
adjoint_rhs: false
}
}
operation {
type: "Dequantize"
input: "ofm_mxint8"
output: "ofm"
}
input: "ifm1"
input: "ifm2"
output: "ofm"

0 comments on commit 4c27b54

Please sign in to comment.