[Mlir-commits] [mlir] [mlir][tosa] Add MXFP TRANSPOSE validation data (PR #218711)

Sayan Saha llvmlistbot at llvm.org
Wed Aug 26 05:29:42 PDT 2026


================
@@ -2393,3 +2393,11 @@ func.func @test_block_scaled_const_cast_scale_values_propagate() -> tensor<2x32x
   %0 = "tosa.const"() <{values = dense<tensor<2x32x!tosa.block_scaled<BLOCK_SHAPE_32:f8E8M0FNU:f8E4M3FN, {2.0, 4.0}>> : 0.0 : f8E4M3FN>}> : () -> tensor<2x32x!tosa.block_scaled<BLOCK_SHAPE_32:f8E8M0FNU:f8E4M3FN, {2.0, 4.0}>>
   return %0 : tensor<2x32x!tosa.block_scaled<BLOCK_SHAPE_32:f8E8M0FNU:f8E4M3FN, {2.0, 4.0}>>
 }
+
+// -----
+
+func.func @test_transpose_block_scaled_illegal_perms(%input: tensor<29x12x13x96x!tosa.block_scaled<BLOCK_SHAPE_32:f8E8M0FNU:f6E3M2FN>>) -> tensor<13x29x12x96x!tosa.block_scaled<BLOCK_SHAPE_32:f8E8M0FNU:f6E3M2FN>> {
+  // expected-error at +1 {{expected no-op permutation on innermost dimension for block scaled input}}
+  %transpose = tosa.transpose %input  { perms = array<i32: 3, 0, 1, 2> } : (tensor<29x12x13x96x!tosa.block_scaled<BLOCK_SHAPE_32:f8E8M0FNU:f6E3M2FN>>) -> tensor<13x29x12x96x!tosa.block_scaled<BLOCK_SHAPE_32:f8E8M0FNU:f6E3M2FN>>
+  return %transpose : tensor<13x29x12x96x!tosa.block_scaled<BLOCK_SHAPE_32:f8E8M0FNU:f6E3M2FN>>
----------------
sahas3 wrote:

The output shape should be `96x29x12x13` since the perms is `[3,0,1,2]`

https://github.com/llvm/llvm-project/pull/218711


More information about the Mlir-commits mailing list