From 01d01eac8c250ac59f160af0458fb92dceb7ba24 Mon Sep 17 00:00:00 2001 From: Hyukjin Jeong Date: Wed, 6 Nov 2024 13:14:37 +0900 Subject: [PATCH] [res] Add mx type BatchMatMul recipes This adds mx type BMM recipes. ONE-DCO-1.0-Signed-off-by: Hyukjin Jeong --- .../CircleBatchMatMul_MXFP4_000/test.recipe | 59 +++++++++++++++++++ .../CircleBatchMatMul_MXINT8_000/test.recipe | 59 +++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 res/CircleRecipes/CircleBatchMatMul_MXFP4_000/test.recipe create mode 100644 res/CircleRecipes/CircleBatchMatMul_MXINT8_000/test.recipe diff --git a/res/CircleRecipes/CircleBatchMatMul_MXFP4_000/test.recipe b/res/CircleRecipes/CircleBatchMatMul_MXFP4_000/test.recipe new file mode 100644 index 00000000000..8f291cbad62 --- /dev/null +++ b/res/CircleRecipes/CircleBatchMatMul_MXFP4_000/test.recipe @@ -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" + diff --git a/res/CircleRecipes/CircleBatchMatMul_MXINT8_000/test.recipe b/res/CircleRecipes/CircleBatchMatMul_MXINT8_000/test.recipe new file mode 100644 index 00000000000..4d5350c0305 --- /dev/null +++ b/res/CircleRecipes/CircleBatchMatMul_MXINT8_000/test.recipe @@ -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" +