Skip to content

Commit 719d079

Browse files
authored
[mlir][tosa] Remove EXT_MXFP support for cast (#167301)
This was removed in the specification by: arm/tosa-specification#11
1 parent 1cbed4f commit 719d079

File tree

5 files changed

+3
-34
lines changed

5 files changed

+3
-34
lines changed

mlir/include/mlir/Dialect/Tosa/IR/TosaComplianceData.h.inc

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -866,15 +866,7 @@ extensionComplianceMap = {
866866
{{{fp8e5m2T, fp16T}, SpecificationVersion::V_1_0},
867867
{{fp8e5m2T, fp32T}, SpecificationVersion::V_1_0},
868868
{{fp16T, fp8e5m2T}, SpecificationVersion::V_1_0},
869-
{{fp32T, fp8e5m2T}, SpecificationVersion::V_1_0}}},
870-
{{Extension::bf16, Extension::mxfp},
871-
{{{fp4e2m1T, bf16T}, SpecificationVersion::V_1_1_DRAFT},
872-
{{fp6e3m2T, bf16T}, SpecificationVersion::V_1_1_DRAFT},
873-
{{fp6e2m3T, bf16T}, SpecificationVersion::V_1_1_DRAFT},
874-
{{bf16T, fp4e2m1T}, SpecificationVersion::V_1_1_DRAFT},
875-
{{bf16T, fp6e3m2T}, SpecificationVersion::V_1_1_DRAFT},
876-
{{bf16T, fp6e2m3T}, SpecificationVersion::V_1_1_DRAFT}},
877-
allOf}}},
869+
{{fp32T, fp8e5m2T}, SpecificationVersion::V_1_0}}}}},
878870
{"tosa.cast_from_block_scaled",
879871
{{{Extension::bf16, Extension::mxfp},
880872
{{{fp4e2m1T, fp8ue8m0T, bf16T}, SpecificationVersion::V_1_1_DRAFT},

mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2464,7 +2464,7 @@ def Tosa_CastOp: Tosa_Op<"cast", [Pure, SameOperandsAndResultShape,
24642464

24652465
list<Availability> availability = [
24662466
Profile<[Tosa_PRO_INT, Tosa_PRO_FP]>,
2467-
Extension<[Tosa_EXT_FP8E4M3, Tosa_EXT_FP8E5M2, Tosa_EXT_BF16, Tosa_EXT_MXFP, Tosa_EXT_INT64]>,
2467+
Extension<[Tosa_EXT_FP8E4M3, Tosa_EXT_FP8E5M2, Tosa_EXT_BF16, Tosa_EXT_INT64]>,
24682468
];
24692469

24702470
let assemblyFormat = "operands attr-dict `:` functional-type(operands, results)";

mlir/test/Dialect/Tosa/availability.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ func.func @test_resize(%arg0: tensor<1x32x32x8xf32>) -> tensor<1x64x64x8xf32> {
606606
// CHECK-LABEL: cast
607607
func.func @test_cast1(%arg0: tensor<13x21x3xi32>) -> tensor<13x21x3xf32> {
608608
// CHECK: profiles: [ [pro_int, pro_fp] ]
609-
// CHECK: extensions: [ [fp8e4m3, fp8e5m2, bf16, mxfp, int64] ]
609+
// CHECK: extensions: [ [fp8e4m3, fp8e5m2, bf16, int64] ]
610610
%0 = tosa.cast %arg0 : (tensor<13x21x3xi32>) -> tensor<13x21x3xf32>
611611
return %0 : tensor<13x21x3xf32>
612612
}

mlir/test/Dialect/Tosa/invalid_extension.mlir

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -562,13 +562,6 @@ func.func @test_const_fp6e3m2(%arg0 : index) -> tensor<4xf6E3M2FN> {
562562
return %0 : tensor<4xf6E3M2FN>
563563
}
564564

565-
// -----
566-
func.func @test_cast_f4e2m1(%arg0: tensor<13x21x3xf4E2M1FN>) -> tensor<13x21x3xbf16> {
567-
// expected-error@+1 {{'tosa.cast' op illegal: requires all of [bf16, mxfp] but not enabled in target}}
568-
%0 = tosa.cast %arg0 : (tensor<13x21x3xf4E2M1FN>) -> tensor<13x21x3xbf16>
569-
return %0 : tensor<13x21x3xbf16>
570-
}
571-
572565
// -----
573566

574567
func.func @test_cast_from_block_scaled_static(%arg0: tensor<4x32xf8E5M2>, %arg1: tensor<4x1xf8E8M0FNU>) -> tensor<4x32xf32> {

mlir/test/Dialect/Tosa/tosa-validation-version-1p1-valid.mlir

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,6 @@ func.func @test_const_fp6e3m2() -> tensor<4xf6E3M2FN> {
5454

5555
// -----
5656

57-
// CHECK-LABEL: test_cast_f4e2m1
58-
func.func @test_cast_f4e2m1(%arg0: tensor<13x21x3xf4E2M1FN>) -> tensor<13x21x3xbf16> {
59-
%0 = tosa.cast %arg0 : (tensor<13x21x3xf4E2M1FN>) -> tensor<13x21x3xbf16>
60-
return %0 : tensor<13x21x3xbf16>
61-
}
62-
63-
// -----
64-
6557
// CHECK-LABEL: test_cast_from_block_scaled_fp8e5m2_fp32
6658
func.func @test_cast_from_block_scaled_fp8e5m2_fp32(%arg0: tensor<4x32xf8E5M2>, %arg1: tensor<4x1xf8E8M0FNU>) -> tensor<4x32xf32> {
6759
%0 = tosa.cast_from_block_scaled %arg0, %arg1 {block_size = #tosa.block_size<BLOCK_SIZE_32> : i32} : (tensor<4x32xf8E5M2>, tensor<4x1xf8E8M0FNU>) -> tensor<4x32xf32>
@@ -110,14 +102,6 @@ func.func @test_const_mxint8() -> tensor<2x!tosa.mxint8> {
110102

111103
// -----
112104

113-
// CHECK-LABEL: test_cast_f4e2m1
114-
func.func @test_cast_f4e2m1(%arg0: tensor<13x21x3xf4E2M1FN>) -> tensor<13x21x3xbf16> {
115-
%0 = tosa.cast %arg0 : (tensor<13x21x3xf4E2M1FN>) -> tensor<13x21x3xbf16>
116-
return %0 : tensor<13x21x3xbf16>
117-
}
118-
119-
// -----
120-
121105
// CHECK-LABEL: test_matmul_t_block_scaled_mxint8
122106
func.func @test_matmul_t_block_scaled_mxint8(%arg0: tensor<4x8x32x!tosa.mxint8>, %arg1: tensor<4x8x1xf8E8M0FNU>, %arg2: tensor<4x16x32x!tosa.mxint8>, %arg3: tensor<4x16x1xf8E8M0FNU>) -> tensor<4x8x16xf32> {
123107
%0 = tosa.matmul_t_block_scaled %arg0, %arg1, %arg2, %arg3 {block_size = #tosa.block_size<BLOCK_SIZE_32>} : (tensor<4x8x32x!tosa.mxint8>, tensor<4x8x1xf8E8M0FNU>, tensor<4x16x32x!tosa.mxint8>, tensor<4x16x1xf8E8M0FNU>) -> tensor<4x8x16xf32>

0 commit comments

Comments
 (0)