Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[res] Add mx type BatchMatMul recipes #14309

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"