@@ -363,13 +363,11 @@ func.func @avg_pool_dyn(%arg0: tensor<?x6x34x62xf32>) -> (tensor<?x5x33x62xf32>)
363
363
364
364
// CHECK-LABEL: @conv2d_i8
365
365
func.func @conv2d_i8 (%input: tensor <1 x49 x42 x27 xi8 >, %weights: tensor <28 x1 x1 x27 xi8 >, %bias: tensor <28 xi8 >) -> () {
366
- // CHECK: %[[PERM:.+]] = arith.constant dense<[1, 2, 3, 0]>
367
- // CHECK: %[[W:.+]] = tosa.transpose %arg1, %[[PERM]]
368
366
// CHECK: %[[M_IN:.+]] = tensor.empty()
369
367
// CHECK: %[[CST:.+]] = arith.constant 0
370
368
// CHECK: %[[FILL:.+]] = linalg.fill
371
369
// CHECK: %[[B_IN:.+]] = tensor.empty()
372
- // CHECK: %[[CONV:.+]] = linalg.conv_2d_nhwc_hwcf_q {dilations = dense<[2, 1]> : tensor<2xi64>, strides = dense<1> : tensor<2xi64>} ins(%arg0, %[[W]] , %c0_i32_0, %c0_i32_1 : tensor<1x49x42x27xi8>, tensor<1x1x27x28xi8 >, i32, i32) outs(%[[FILL]] : tensor<1x45x40x28xi32>) -> tensor<1x45x40x28xi32>
370
+ // CHECK: %[[CONV:.+]] = linalg.conv_2d_nhwc_fhwc_q {dilations = dense<[2, 1]> : tensor<2xi64>, strides = dense<1> : tensor<2xi64>} ins(%arg0, %arg1 , %c0_i32_0, %c0_i32_1 : tensor<1x49x42x27xi8>, tensor<28x1x1x27xi8 >, i32, i32) outs(%[[FILL]] : tensor<1x45x40x28xi32>) -> tensor<1x45x40x28xi32>
373
371
// CHECK: %[[B:.+]] = linalg.generic {indexing_maps = [#[[$MAP1]], #[[$MAP2]], #[[$MAP2]]], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%arg2, %[[CONV]] : tensor<28xi8>, tensor<1x45x40x28xi32>) outs(%[[B_IN]] : tensor<1x45x40x28xi32>)
374
372
// CHECK: arith.extsi
375
373
// CHECK: arith.addi
@@ -385,13 +383,11 @@ func.func @conv2d_i8(%input: tensor<1x49x42x27xi8>, %weights: tensor<28x1x1x27xi
385
383
386
384
// CHECK-LABEL: @conv2d_f32
387
385
func.func @conv2d_f32 (%input: tensor <1 x49 x42 x27 xf32 >, %weights: tensor <28 x3 x3 x27 xf32 >, %bias: tensor <28 xf32 >) -> () {
388
- // CHECK: %[[PERM:.+]] = arith.constant dense<[1, 2, 3, 0]>
389
- // CHECK: %[[W:.+]] = tosa.transpose %arg1, %[[PERM]]
390
386
// CHECK: %[[M_IN:.+]] = tensor.empty()
391
387
// CHECK: %[[CST:.+]] = arith.constant 0
392
388
// CHECK: %[[FILL:.+]] = linalg.fill
393
389
// CHECK: %[[B_IN:.+]] = tensor.empty()
394
- // CHECK: %[[CONV:.+]] = linalg.conv_2d_nhwc_hwcf {dilations = dense<[2, 1]> : tensor<2xi64>, strides = dense<1> : tensor<2xi64>} ins(%arg0, %[[W]] : tensor<1x49x42x27xf32>, tensor<3x3x27x28xf32 >) outs(%[[FILL]] : tensor<1x45x40x28xf32>)
390
+ // CHECK: %[[CONV:.+]] = linalg.conv_2d_nhwc_fhwc {dilations = dense<[2, 1]> : tensor<2xi64>, strides = dense<1> : tensor<2xi64>} ins(%arg0, %arg1 : tensor<1x49x42x27xf32>, tensor<28x3x3x27xf32 >) outs(%[[FILL]] : tensor<1x45x40x28xf32>)
395
391
// CHECK: %[[B:.+]] = linalg.generic {indexing_maps = [#[[$MAP1]], #[[$MAP2]], #[[$MAP2]]], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%arg2, %[[CONV]] : tensor<28xf32>, tensor<1x45x40x28xf32>) outs(%[[B_IN]] : tensor<1x45x40x28xf32>)
396
392
// CHECK: arith.addf
397
393
// CHECK: linalg.yield
@@ -408,13 +404,11 @@ func.func @conv2d_f32(%input: tensor<1x49x42x27xf32>, %weights: tensor<28x3x3x27
408
404
func.func @conv2d_dyn (%input: tensor <?x49 x42 x27 xf32 >, %weights: tensor <28 x3 x3 x27 xf32 >, %bias: tensor <28 xf32 >) -> () {
409
405
// CHECK: %[[C0:.+]] = arith.constant 0
410
406
// CHECK: %[[BATCH:.+]] = tensor.dim %arg0, %[[C0]]
411
- // CHECK: %[[PERM:.+]] = arith.constant dense<[1, 2, 3, 0]>
412
- // CHECK: %[[W:.+]] = tosa.transpose %arg1, %[[PERM]]
413
407
// CHECK: %[[M_IN:.+]] = tensor.empty(%[[BATCH]])
414
408
// CHECK: %[[CST:.+]] = arith.constant 0
415
409
// CHECK: %[[FILL:.+]] = linalg.fill
416
410
// CHECK: %[[B_IN:.+]] = tensor.empty(%[[BATCH]])
417
- // CHECK: %[[CONV:.+]] = linalg.conv_2d_nhwc_hwcf {dilations = dense<[2, 1]> : tensor<2xi64>, strides = dense<1> : tensor<2xi64>} ins(%arg0, %[[W]] : tensor<?x49x42x27xf32>, tensor<3x3x27x28xf32 >) outs(%[[FILL]] : tensor<?x45x40x28xf32>)
411
+ // CHECK: %[[CONV:.+]] = linalg.conv_2d_nhwc_fhwc {dilations = dense<[2, 1]> : tensor<2xi64>, strides = dense<1> : tensor<2xi64>} ins(%arg0, %arg1 : tensor<?x49x42x27xf32>, tensor<28x3x3x27xf32 >) outs(%[[FILL]] : tensor<?x45x40x28xf32>)
418
412
// CHECK: %[[B:.+]] = linalg.generic {indexing_maps = [#[[$MAP1]], #[[$MAP2]], #[[$MAP2]]], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%arg2, %[[CONV]] : tensor<28xf32>, tensor<?x45x40x28xf32>) outs(%[[B_IN]] : tensor<?x45x40x28xf32>)
419
413
// CHECK: %[[ADD:.+]] = arith.addf
420
414
// CHECK: linalg.yield %[[ADD]] : f32
@@ -468,13 +462,11 @@ func.func @conv2d_dyn_w_h(%input: tensor<1x?x?x27xf32>, %weights: tensor<28x3x3x
468
462
// CHECK: %[[W_OUT:.+]] = arith.addi %[[DIVIDED_0]], %[[ONE_0]] : index
469
463
470
464
// Running convolution
471
- // CHECK: %[[PERM:.+]] = arith.constant dense<[1, 2, 3, 0]>
472
- // CHECK: %[[WEIGHT:.+]] = tosa.transpose %arg1, %[[PERM]]
473
465
// CHECK: %[[M_IN:.+]] = tensor.empty(%[[H_OUT]], %[[W_OUT]])
474
466
// CHECK: %[[CST:.+]] = arith.constant 0
475
467
// CHECK: %[[FILL:.+]] = linalg.fill
476
468
// CHECK: %[[B_IN:.+]] = tensor.empty(%[[H_OUT]], %[[W_OUT]])
477
- // CHECK: %[[CONV:.+]] = linalg.conv_2d_nhwc_hwcf {dilations = dense<[2, 1]> : tensor<2xi64>, strides = dense<1> : tensor<2xi64>} ins(%arg0, %[[WEIGHT]] : tensor<1x?x?x27xf32>, tensor<3x3x27x28xf32 >) outs(%[[FILL]] : tensor<1x?x?x28xf32>)
469
+ // CHECK: %[[CONV:.+]] = linalg.conv_2d_nhwc_fhwc {dilations = dense<[2, 1]> : tensor<2xi64>, strides = dense<1> : tensor<2xi64>} ins(%arg0, %arg1 : tensor<1x?x?x27xf32>, tensor<28x3x3x27xf32 >) outs(%[[FILL]] : tensor<1x?x?x28xf32>)
478
470
// CHECK: %[[B:.+]] = linalg.generic {indexing_maps = [#[[$MAP1]], #[[$MAP2]], #[[$MAP2]]], iterator_types = ["parallel", "parallel", "parallel", "parallel"]} ins(%arg2, %[[CONV]] : tensor<28xf32>, tensor<1x?x?x28xf32>) outs(%[[B_IN]] : tensor<1x?x?x28xf32>)
479
471
// CHECK: %[[ADD:.+]] = arith.addf
480
472
// CHECK: linalg.yield %[[ADD]] : f32
@@ -489,7 +481,7 @@ func.func @conv2d_padded_f32(%input: tensor<1x47x40x28xf32>, %weights: tensor<28
489
481
// CHECK: %[[C0:.+]] = arith.constant 0
490
482
// CHECK: tensor.pad %arg0 low[0, 1, 1, 0] high[0, 1, 1, 0]
491
483
// CHECK: tensor.yield %[[C0]]
492
- // CHECK: linalg.conv_2d_nhwc_hwcf
484
+ // CHECK: linalg.conv_2d_nhwc_fhwc
493
485
%0 = tosa.conv2d %input , %weights , %bias {pad = array<i64 : 1 , 1 , 1 , 1 >, stride = array<i64 : 1 , 1 >, dilation = array<i64 : 2 , 1 >} : (tensor <1 x47 x40 x28 xf32 >, tensor <28 x3 x3 x28 xf32 >, tensor <28 xf32 >) -> tensor <1 x45 x40 x28 xf32 >
494
486
return
495
487
}
@@ -501,7 +493,7 @@ func.func @conv2d_quant(%arg0 : tensor<1x12x12x1xi8>, %arg1 : tensor<1024x3x3x1x
501
493
// CHECK: %[[C22:.+]] = arith.constant -22
502
494
// CHECK: tensor.pad %arg0 low[0, 1, 1, 0] high[0, 1, 1, 0]
503
495
// CHECK: tensor.yield %[[C22]]
504
- // CHECK: linalg.conv_2d_nhwc_hwcf_q
496
+ // CHECK: linalg.conv_2d_nhwc_fhwc_q
505
497
%0 = tosa.conv2d %arg0 , %arg1 , %arg2 {dilation = array<i64 : 1 , 1 >, pad = array<i64 : 1 , 1 , 1 , 1 >, quantization_info = #tosa.conv_quant <input_zp = -22 , weight_zp = 42 >, stride = array<i64 : 1 , 1 >} : (tensor <1 x12 x12 x1 xi8 >, tensor <1024 x3 x3 x1 xi8 >, tensor <1024 xi32 >) -> tensor <1 x12 x12 x1024 xi32 >
506
498
return
507
499
}
0 commit comments