Skip to content

Commit

Permalink
Revert lit-tests for testing.
Browse files Browse the repository at this point in the history
Signed-off-by: Haruki Imai <imaihal@jp.ibm.com>
  • Loading branch information
imaihal committed Sep 12, 2024
1 parent ad06734 commit 5dcc2f7
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ module {
// CHECK-DAG: [[VAR_8_:%.+]] = "onnx.Transpose"([[VAR_2_]]) {perm = [2, 3, 1, 0]} : (tensor<8x1x5x5xf32>) -> tensor<5x5x1x8xf32>
// CHECK-NOT: separator of consecutive DAGs
// CHECK-DAG: [[VAR_9_:%.+]] = "zhigh.Stick"([[VAR_8_]]) {layout = "HWCK"} : (tensor<5x5x1x8xf32>) -> tensor<5x5x1x8xf16, #zhigh.layout<{dataLayout = "HWCK"}>>
// CHECK-DAG: [[VAR_10_:%.+]] = "zhigh.StickifiedConstant"() {alignment = 4096 : i64, stickified = false, value = dense<[-0.161539719, -0.433835655, 0.091641359, -0.0168522168, -0.0650264397, -0.131737873, 0.0204175506, -0.121110231]> : tensor<8xf32>} : () -> tensor<8xf16, #zhigh.layout<{dataLayout = "1D"}>>
// CHECK-DAG: [[VAR_10_:%.+]] = "zhigh.StickifiedConstant"() {alignment = 4096 : i64, stickified = true, value = dense_resource<zhigh_1> : tensor<4096xi8>} : () -> tensor<8xf16, #zhigh.layout<{dataLayout = "1D"}>>
// CHECK: [[VAR_11_:%.+]] = "zhigh.Conv2D"([[VAR_7_]], [[VAR_9_]], [[VAR_10_]]) {act_func = "ACT_RELU", kernel_shape = [5, 5], padding_type = "SAME_PADDING", strides = [1, 1]} : (tensor<1x28x28x1xf16, #zhigh.layout<{dataLayout = "NHWC"}>>, tensor<5x5x1x8xf16, #zhigh.layout<{dataLayout = "HWCK"}>>, tensor<8xf16, #zhigh.layout<{dataLayout = "1D"}>>) -> tensor<1x28x28x8xf16, #zhigh.layout<{dataLayout = "NHWC"}>>
// CHECK-DAG: [[VAR_12_:%.+]] = "zhigh.MaxPool2D"([[VAR_11_]]) {kernel_shape = [2, 2], padding_type = "VALID_PADDING", strides = [2, 2]} : (tensor<1x28x28x8xf16, #zhigh.layout<{dataLayout = "NHWC"}>>) -> tensor<1x14x14x8xf16, #zhigh.layout<{dataLayout = "NHWC"}>>
// CHECK-DAG: [[VAR_13_:%.+]] = "onnx.Transpose"([[VAR_1_]]) {perm = [2, 3, 1, 0]} : (tensor<16x8x5x5xf32>) -> tensor<5x5x8x16xf32>
// CHECK-NOT: separator of consecutive DAGs
// CHECK-DAG: [[VAR_14_:%.+]] = "zhigh.Stick"([[VAR_13_]]) {layout = "HWCK"} : (tensor<5x5x8x16xf32>) -> tensor<5x5x8x16xf16, #zhigh.layout<{dataLayout = "HWCK"}>>
// CHECK-DAG: [[VAR_15_:%.+]] = "zhigh.StickifiedConstant"() {alignment = 4096 : i64, stickified = false, value = dense<[-0.0822488219, -0.108868778, -0.141039595, -0.204869166, -0.17913565, -0.215438381, -0.133805066, -0.195724562, -0.268250644, -0.258212209, -0.0761560649, 0.0132841459, -0.00444464432, -0.414740831, -0.17879115, -0.0386558883]> : tensor<16xf32>} : () -> tensor<16xf16, #zhigh.layout<{dataLayout = "1D"}>>
// CHECK-DAG: [[VAR_15_:%.+]] = "zhigh.StickifiedConstant"() {alignment = 4096 : i64, stickified = true, value = dense_resource<zhigh> : tensor<4096xi8>} : () -> tensor<16xf16, #zhigh.layout<{dataLayout = "1D"}>>
// CHECK: [[VAR_16_:%.+]] = "zhigh.Conv2D"([[VAR_12_]], [[VAR_14_]], [[VAR_15_]]) {act_func = "ACT_RELU", kernel_shape = [5, 5], padding_type = "SAME_PADDING", strides = [1, 1]} : (tensor<1x14x14x8xf16, #zhigh.layout<{dataLayout = "NHWC"}>>, tensor<5x5x8x16xf16, #zhigh.layout<{dataLayout = "HWCK"}>>, tensor<16xf16, #zhigh.layout<{dataLayout = "1D"}>>) -> tensor<1x14x14x16xf16, #zhigh.layout<{dataLayout = "NHWC"}>>
// CHECK: [[VAR_17_:%.+]] = "zhigh.MaxPool2D"([[VAR_16_]]) {kernel_shape = [3, 3], padding_type = "VALID_PADDING", strides = [3, 3]} : (tensor<1x14x14x16xf16, #zhigh.layout<{dataLayout = "NHWC"}>>) -> tensor<1x4x4x16xf16, #zhigh.layout<{dataLayout = "NHWC"}>>
// CHECK: [[VAR_18_:%.+]] = "zhigh.Unstick"([[VAR_17_]]) : (tensor<1x4x4x16xf16, #zhigh.layout<{dataLayout = "NHWC"}>>) -> tensor<1x16x4x4xf32>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func.func @conv_same_padding_no_bias_unknown_dims(%arg0: tensor<1x32x32x3xf16, #
// CHECK: krnl.store [[VAR_c1_i64_]], [[RES_1_]]{{.}}[[VAR_c4_]]{{.}} : memref<7xi64>
// CHECK: krnl.store [[VAR_c32_i64_]], [[RES_1_]]{{.}}[[VAR_c5_]]{{.}} : memref<7xi64>
// CHECK: krnl.store [[VAR_c32_i64_]], [[RES_1_]]{{.}}[[VAR_c6_]]{{.}} : memref<7xi64>
// CHECK: [[VAR_2_:%.+]] = "zlow.stickifiedConstant"() {alignment = 4096 : i64, allzero = true, name = "constant_stickify_0", offset = 0 : i64, shape = [1, 1, 1, 1, 32, 64]} : () -> memref<1x1x1x1x32x64xf16>
// CHECK: [[VAR_2_:%.+]] = "krnl.global"() {alignment = 4096 : i64, name = "constant_stickify_0", shape = [1, 1, 1, 1, 32, 64], value = dense_resource<zhigh> : tensor<4096xi8>} : () -> memref<1x1x1x1x32x64xf16>
// CHECK: "zlow.conv2d"([[PARAM_0_]], [[PARAM_1_]], [[VAR_2_]], [[RES_1_]], [[RES_]]) {act_func = "ACT_NONE", kernel_shape = [2, 2], padding_type = "SAME_PADDING", strides = [1, 1]} : (memref<1x32x32x3xf16, #map>, memref<2x2x3x1xf16, #map1>, memref<1x1x1x1x32x64xf16>, memref<7xi64>, memref<1x32x32x1xf16, #map>) -> ()
// CHECK: return [[RES_]] : memref<1x32x32x1xf16, #map>
// CHECK: }
Expand Down
4 changes: 2 additions & 2 deletions test/mlir/accelerators/nnpa/conversion/zhigh-to-zlow/gru.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ func.func @gru_no_input_and_hidden_biases(%input : tensor<?x?x7xf16, #zhigh.layo
// CHECK: krnl.store [[VAR_1_]], [[RES_1_]]{{.}}[[VAR_c2_]]{{.}} : memref<5xi64>
// CHECK: krnl.store [[VAR_c7_i64_]], [[RES_1_]]{{.}}[[VAR_c3_]]{{.}} : memref<5xi64>
// CHECK: krnl.store [[VAR_c9_i64_]], [[RES_1_]]{{.}}[[VAR_c4_]]{{.}} : memref<5xi64>
// CHECK-DAG: [[VAR_2_:%.+]] = "zlow.stickifiedConstant"() {alignment = 4096 : i64, allzero = true, name = "constant_stickify_0", offset = 0 : i64, shape = [1, 3, 1, 1, 32, 64]} : () -> memref<1x3x1x1x32x64xf16>
// CHECK-DAG: [[VAR_3_:%.+]] = "zlow.stickifiedConstant"() {alignment = 4096 : i64, allzero = true, name = "constant_stickify_1", offset = 0 : i64, shape = [1, 3, 1, 1, 32, 64]} : () -> memref<1x3x1x1x32x64xf16>
// CHECK-DAG: [[VAR_2_:%.+]] = "krnl.global"() {alignment = 4096 : i64, name = "constant_stickify_0", shape = [1, 3, 1, 1, 32, 64], value = dense_resource<zhigh> : tensor<12288xi8>} : () -> memref<1x3x1x1x32x64xf16>
// CHECK-DAG: [[VAR_3_:%.+]] = "krnl.global"() {alignment = 4096 : i64, name = "constant_stickify_1", shape = [1, 3, 1, 1, 32, 64], value = dense_resource<zhigh_1> : tensor<12288xi8>} : () -> memref<1x3x1x1x32x64xf16>
// CHECK-DAG: [[VAR_dim_2_:%.+]] = memref.dim [[PARAM_0_]], [[VAR_c0_]] : memref<?x?x7xf16, [[MAP_0_]]>
// CHECK-DAG: [[VAR_dim_3_:%.+]] = memref.dim [[PARAM_0_]], [[VAR_c1_]] : memref<?x?x7xf16, [[MAP_0_]]>
// CHECK-NOT: separator of consecutive DAGs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ func.func @lstm_no_input_and_hidden_biases(%input : tensor<?x?x7xf16, #zhigh.lay
// CHECK: krnl.store [[VAR_1_]], [[RES_2_]]{{.}}[[VAR_c2_]]{{.}} : memref<5xi64>
// CHECK: krnl.store [[VAR_c7_i64_]], [[RES_2_]]{{.}}[[VAR_c3_]]{{.}} : memref<5xi64>
// CHECK: krnl.store [[VAR_c9_i64_]], [[RES_2_]]{{.}}[[VAR_c4_]]{{.}} : memref<5xi64>
// CHECK-DAG: [[VAR_2_:%.+]] = "zlow.stickifiedConstant"() {alignment = 4096 : i64, allzero = true, name = "constant_stickify_0", offset = 0 : i64, shape = [1, 4, 1, 1, 32, 64]} : () -> memref<1x4x1x1x32x64xf16>
// CHECK-DAG: [[VAR_3_:%.+]] = "zlow.stickifiedConstant"() {alignment = 4096 : i64, allzero = true, name = "constant_stickify_1", offset = 0 : i64, shape = [1, 4, 1, 1, 32, 64]} : () -> memref<1x4x1x1x32x64xf16>
// CHECK-DAG: [[VAR_2_:%.+]] = "krnl.global"() {alignment = 4096 : i64, name = "constant_stickify_0", shape = [1, 4, 1, 1, 32, 64], value = dense_resource<zhigh> : tensor<16384xi8>} : () -> memref<1x4x1x1x32x64xf16>
// CHECK-DAG: [[VAR_3_:%.+]] = "krnl.global"() {alignment = 4096 : i64, name = "constant_stickify_1", shape = [1, 4, 1, 1, 32, 64], value = dense_resource<zhigh_1> : tensor<16384xi8>} : () -> memref<1x4x1x1x32x64xf16>
// CHECK-DAG: [[VAR_dim_3_:%.+]] = memref.dim [[PARAM_0_]], [[VAR_c0_]] : memref<?x?x7xf16, [[MAP_0_]]>
// CHECK-DAG: [[VAR_dim_4_:%.+]] = memref.dim [[PARAM_0_]], [[VAR_c1_]] : memref<?x?x7xf16, [[MAP_0_]]>
// CHECK-NOT: separator of consecutive DAGs
Expand Down

Large diffs are not rendered by default.

28 changes: 16 additions & 12 deletions test/mlir/accelerators/nnpa/driver/ccfd.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
// COM: It is the necessary condition to get the best performance.

CHECK-LABEL: func.func @main_graph
CHECK-DAG: zlow.stickifiedConstant
CHECK-DAG: zlow.stickifiedConstant
CHECK-DAG: krnl.global
CHECK-DAG: krnl.global
CHECK-DAG: memref.alloc
CHECK-DAG: zlow.stickifiedConstant
CHECK-NEXT: zlow.stick

CHECK-DAG: zlow.stickifiedConstant
CHECK-DAG: zlow.stickifiedConstant
CHECK-DAG: krnl.global
CHECK-DAG: krnl.global
CHECK-DAG: krnl.global
CHECK-DAG: krnl.global
CHECK-DAG: memref.alloc
CHECK-DAG: memref.alloc
CHECK-DAG: krnl.global
Expand All @@ -22,10 +24,12 @@ CHECK-NEXT: zlow.lstm
CHECK-NOT: zlow.stick
CHECK-NOT: zlow.unstick

CHECK-DAG: zlow.stickifiedConstant
CHECK-DAG: zlow.stickifiedConstant
CHECK-DAG: zlow.stickifiedConstant
CHECK-DAG: zlow.stickifiedConstant
CHECK-DAG: krnl.global
CHECK-DAG: krnl.global
CHECK-DAG: krnl.global
CHECK-DAG: krnl.global
CHECK-DAG: krnl.global
CHECK-DAG: krnl.global
CHECK-DAG: memref.alloc
CHECK-DAG: memref.alloc
CHECK-DAG: krnl.global
Expand All @@ -36,17 +40,17 @@ CHECK-NEXT: zlow.lstm
CHECK-NOT: zlow.stick
CHECK-NOT: zlow.unstick

CHECK-DAG: zlow.stickifiedConstant
CHECK-DAG: krnl.global
CHECK-DAG: memref.alloc
CHECK-DAG: krnl.global
CHECK-DAG: zlow.stickifiedConstant
CHECK-DAG: krnl.global
CHECK-NEXT: zlow.matmul

// No stick and unstick in between.
CHECK-NOT: zlow.stick
CHECK-NOT: zlow.unstick

CHECK-DAG: zlow.stickifiedConstant
CHECK-DAG: krnl.global
CHECK-DAG: memref.alloc
CHECK-DAG: krnl.global
CHECK-NEXT: zlow.add
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ func.func @test_matmul_add_add(%arg0: tensor<?x?x768xf32>, %arg1: tensor<768x768
// CHECK-SAME: ([[PARAM_0_:%.+]]: tensor<?x?x768xf32>, [[PARAM_1_:%.+]]: tensor<768x768xf32>) -> tensor<?x?x768xf32> {
// CHECK-DAG: [[VAR_0_:%.+]] = "zhigh.Stick"([[PARAM_0_]]) {layout = "3DS"} : (tensor<?x?x768xf32>) -> tensor<?x?x768xf16, #zhigh.layout<{dataLayout = "3DS"}>>
// CHECK-DAG: [[VAR_1_:%.+]] = "zhigh.Stick"([[PARAM_1_]]) {layout = "2D"} : (tensor<768x768xf32>) -> tensor<768x768xf16, #zhigh.layout<{dataLayout = "2D"}>>
// CHECK-DAG: [[VAR_2_:%.+]] = "zhigh.StickifiedConstant"() {alignment = 4096 : i64, stickified = false, value = dense<5.000000e+00> : tensor<768xf32>} : () -> tensor<768xf16, #zhigh.layout<{dataLayout = "1D"}>>
// CHECK-DAG: [[VAR_2_:%.+]] = "zhigh.StickifiedConstant"() {alignment = 4096 : i64, stickified = true, value = dense_resource<zhigh> : tensor<49152xi8>} : () -> tensor<768xf16, #zhigh.layout<{dataLayout = "1D"}>>
// CHECK: [[VAR_3_:%.+]] = "zhigh.MatMul"([[VAR_0_]], [[VAR_1_]], [[VAR_2_]]) : (tensor<?x?x768xf16, #zhigh.layout<{dataLayout = "3DS"}>>, tensor<768x768xf16, #zhigh.layout<{dataLayout = "2D"}>>, tensor<768xf16, #zhigh.layout<{dataLayout = "1D"}>>) -> tensor<?x?x768xf16, #zhigh.layout<{dataLayout = "3DS"}>>
}
Loading

0 comments on commit 5dcc2f7

Please sign in to comment.