@@ -8,7 +8,9 @@ func.func @matmul(%arg0: tensor<1x5x3xf32>, %arg1: tensor<1x3x6xf32>) -> (tensor
8
8
// CHECK: [[INIT:%.+]] = tensor.empty()
9
9
// CHECK: [[FILLED:%.+]] = linalg.fill ins([[C0]] : f32) outs([[INIT]] : tensor<1x5x6xf32>) -> tensor<1x5x6xf32>
10
10
// CHECK: linalg.batch_matmul ins(%arg0, %arg1 : tensor<1x5x3xf32>, tensor<1x3x6xf32>) outs([[FILLED]] : tensor<1x5x6xf32>) -> tensor<1x5x6xf32>
11
- %0 = tosa.matmul %arg0 , %arg1 : (tensor <1 x5 x3 xf32 >, tensor <1 x3 x6 xf32 >) -> tensor <1 x5 x6 xf32 >
11
+ %a_zp = " tosa.const" () <{values = dense <0.0 > : tensor <1 xf32 >}> : () -> tensor <1 xf32 >
12
+ %b_zp = " tosa.const" () <{values = dense <0.0 > : tensor <1 xf32 >}> : () -> tensor <1 xf32 >
13
+ %0 = tosa.matmul %arg0 , %arg1 , %a_zp , %b_zp : (tensor <1 x5 x3 xf32 >, tensor <1 x3 x6 xf32 >, tensor <1 xf32 >, tensor <1 xf32 >) -> tensor <1 x5 x6 xf32 >
12
14
return %0 : tensor <1 x5 x6 xf32 >
13
15
}
14
16
@@ -23,7 +25,9 @@ func.func @matmul_quantized(%arg0: tensor<1x5x3xi8>, %arg1: tensor<1x3x6xi8>) ->
23
25
// CHECK: [[ONE:%.+]] = arith.constant 1
24
26
// CHECK: [[TWO:%.+]] = arith.constant 2
25
27
// CHECK: linalg.quantized_batch_matmul ins(%arg0, %arg1, [[ONE]], [[TWO]] : tensor<1x5x3xi8>, tensor<1x3x6xi8>, i32, i32) outs([[FILLED]] : tensor<1x5x6xi32>) -> tensor<1x5x6xi32>
26
- %0 = tosa.matmul %arg0 , %arg1 {a_zp = 1 : i32 , b_zp = 2 : i32 } : (tensor <1 x5 x3 xi8 >, tensor <1 x3 x6 xi8 >) -> tensor <1 x5 x6 xi32 >
28
+ %a_zp = " tosa.const" () <{values = dense <1 > : tensor <1 xi8 >}> : () -> tensor <1 xi8 >
29
+ %b_zp = " tosa.const" () <{values = dense <2 > : tensor <1 xi8 >}> : () -> tensor <1 xi8 >
30
+ %0 = tosa.matmul %arg0 , %arg1 , %a_zp , %b_zp : (tensor <1 x5 x3 xi8 >, tensor <1 x3 x6 xi8 >, tensor <1 xi8 >, tensor <1 xi8 >) -> tensor <1 x5 x6 xi32 >
27
31
return %0 : tensor <1 x5 x6 xi32 >
28
32
}
29
33
@@ -37,7 +41,9 @@ func.func @matmul_dyn_batch(%arg0: tensor<?x5x3xf32>, %arg1: tensor<?x3x6xf32>)
37
41
// CHECK: %[[INIT:.+]] = tensor.empty(%[[DIM]])
38
42
// CHECK: %[[FILLED:.+]] = linalg.fill ins(%[[C0_0]] : f32) outs(%[[INIT]] : tensor<?x5x6xf32>) -> tensor<?x5x6xf32>
39
43
// CHECK: linalg.batch_matmul ins(%arg0, %arg1 : tensor<?x5x3xf32>, tensor<?x3x6xf32>) outs(%[[FILLED]] : tensor<?x5x6xf32>) -> tensor<?x5x6xf32>
40
- %0 = tosa.matmul %arg0 , %arg1 : (tensor <?x5 x3 xf32 >, tensor <?x3 x6 xf32 >) -> tensor <?x5 x6 xf32 >
44
+ %a_zp = " tosa.const" () <{values = dense <0.0 > : tensor <1 xf32 >}> : () -> tensor <1 xf32 >
45
+ %b_zp = " tosa.const" () <{values = dense <0.0 > : tensor <1 xf32 >}> : () -> tensor <1 xf32 >
46
+ %0 = tosa.matmul %arg0 , %arg1 , %a_zp , %b_zp : (tensor <?x5 x3 xf32 >, tensor <?x3 x6 xf32 >, tensor <1 xf32 >, tensor <1 xf32 >) -> tensor <?x5 x6 xf32 >
41
47
return %0 : tensor <?x5 x6 xf32 >
42
48
}
43
49
@@ -51,7 +57,9 @@ func.func @matmul_dyn_independent_dim(%arg0: tensor<1x5x3xf32>, %arg1: tensor<1x
51
57
// CHECK: %[[INIT:.+]] = tensor.empty(%[[DIM]])
52
58
// CHECK: %[[FILLED:.+]] = linalg.fill ins(%[[C0]] : f32) outs(%[[INIT]] : tensor<1x5x?xf32>) -> tensor<1x5x?xf32>
53
59
// CHECK: linalg.batch_matmul ins(%arg0, %arg1 : tensor<1x5x3xf32>, tensor<1x3x?xf32>) outs(%[[FILLED]] : tensor<1x5x?xf32>) -> tensor<1x5x?xf32>
54
- %0 = tosa.matmul %arg0 , %arg1 : (tensor <1 x5 x3 xf32 >, tensor <1 x3 x?xf32 >) -> tensor <1 x5 x?xf32 >
60
+ %a_zp = " tosa.const" () <{values = dense <0.0 > : tensor <1 xf32 >}> : () -> tensor <1 xf32 >
61
+ %b_zp = " tosa.const" () <{values = dense <0.0 > : tensor <1 xf32 >}> : () -> tensor <1 xf32 >
62
+ %0 = tosa.matmul %arg0 , %arg1 , %a_zp , %b_zp : (tensor <1 x5 x3 xf32 >, tensor <1 x3 x?xf32 >, tensor <1 xf32 >, tensor <1 xf32 >) -> tensor <1 x5 x?xf32 >
55
63
return %0 : tensor <1 x5 x?xf32 >
56
64
}
57
65
@@ -63,7 +71,9 @@ func.func @matmul_dyn_independent_dim(%arg0: tensor<1x5x?xf32>, %arg1: tensor<1x
63
71
// CHECK: %[[INIT:.+]] = tensor.empty()
64
72
// CHECK: %[[FILLED:.+]] = linalg.fill ins(%[[C0]] : f32) outs(%[[INIT]] : tensor<1x5x6xf32>) -> tensor<1x5x6xf32>
65
73
// CHECK: linalg.batch_matmul ins(%arg0, %arg1 : tensor<1x5x?xf32>, tensor<1x?x6xf32>) outs(%[[FILLED]] : tensor<1x5x6xf32>) -> tensor<1x5x6xf32>
66
- %0 = tosa.matmul %arg0 , %arg1 : (tensor <1 x5 x?xf32 >, tensor <1 x?x6 xf32 >) -> tensor <1 x5 x6 xf32 >
74
+ %a_zp = " tosa.const" () <{values = dense <0.0 > : tensor <1 xf32 >}> : () -> tensor <1 xf32 >
75
+ %b_zp = " tosa.const" () <{values = dense <0.0 > : tensor <1 xf32 >}> : () -> tensor <1 xf32 >
76
+ %0 = tosa.matmul %arg0 , %arg1 , %a_zp , %b_zp : (tensor <1 x5 x?xf32 >, tensor <1 x?x6 xf32 >, tensor <1 xf32 >, tensor <1 xf32 >) -> tensor <1 x5 x6 xf32 >
67
77
return %0 : tensor <1 x5 x6 xf32 >
68
78
}
69
79
@@ -77,7 +87,9 @@ func.func @matmul_dyn_output(%arg0: tensor<1x1x8xf32>, %arg1: tensor<1x8x1xf32>)
77
87
// CHECK: %[[INIT:.+]] = tensor.empty(%[[DIM0]]) : tensor<?x1x1xf32>
78
88
// CHECK: %[[FILLED:.+]] = linalg.fill ins(%[[CST]] : f32) outs(%[[INIT]] : tensor<?x1x1xf32>) -> tensor<?x1x1xf32>
79
89
// CHECK: linalg.batch_matmul ins(%arg0, %arg1 : tensor<1x1x8xf32>, tensor<1x8x1xf32>) outs(%[[FILLED]] : tensor<?x1x1xf32>) -> tensor<?x1x1xf32>
80
- %0 = tosa.matmul %arg0 , %arg1 : (tensor <1 x1 x8 xf32 >, tensor <1 x8 x1 xf32 >) -> tensor <?x1 x1 xf32 >
90
+ %a_zp = " tosa.const" () <{values = dense <0.0 > : tensor <1 xf32 >}> : () -> tensor <1 xf32 >
91
+ %b_zp = " tosa.const" () <{values = dense <0.0 > : tensor <1 xf32 >}> : () -> tensor <1 xf32 >
92
+ %0 = tosa.matmul %arg0 , %arg1 , %a_zp , %b_zp : (tensor <1 x1 x8 xf32 >, tensor <1 x8 x1 xf32 >, tensor <1 xf32 >, tensor <1 xf32 >) -> tensor <?x1 x1 xf32 >
81
93
return %0 : tensor <?x1 x1 xf32 >
82
94
}
83
95
0 commit comments