From a00ebc36818ed0d7a4ec25a8d2af3b6886e291c2 Mon Sep 17 00:00:00 2001 From: James Newling Date: Mon, 20 May 2024 16:57:36 -0700 Subject: [PATCH 1/2] update --- .github/workflows/ci.yml | 2 +- sync_deps.py | 2 +- third_party/mlir-aie | 2 +- third_party/mlir-air | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a089b5e48..a01c47ab2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,7 +101,7 @@ jobs: run: | python3 -m venv .venv source .venv/bin/activate - pip install https://github.com/Xilinx/mlir-aie/releases/download/latest-wheels/mlir_aie-0.0.1.2024051421+b085480-py3-none-manylinux_2_35_x86_64.whl + pip install https://github.com/Xilinx/mlir-aie/releases/download/latest-wheels/mlir_aie-0.0.1.2024051921+7fb9fad-py3-none-manylinux_2_35_x86_64.whl pip install -r tests/matmul/requirements.txt - name: E2E correctness matmul test diff --git a/sync_deps.py b/sync_deps.py index ace4ec141..e3c19c580 100644 --- a/sync_deps.py +++ b/sync_deps.py @@ -7,7 +7,7 @@ ### Update with: shark-workspace pin PINNED_VERSIONS = { - "iree": "4c9cb3c336678fd8a6243da051dcf5ec617cc928", + "iree": "080b1fa520a73f835db37049a39a735d6b175b7b", } ORIGINS = { diff --git a/third_party/mlir-aie b/third_party/mlir-aie index 71c922964..c718198d8 160000 --- a/third_party/mlir-aie +++ b/third_party/mlir-aie @@ -1 +1 @@ -Subproject commit 71c92296473c97ae0ffac6708426fc8d1809d6af +Subproject commit c718198d8a726851e4edd289967b21bbc9354de6 diff --git a/third_party/mlir-air b/third_party/mlir-air index c69823a75..e844dc2aa 160000 --- a/third_party/mlir-air +++ b/third_party/mlir-air @@ -1 +1 @@ -Subproject commit c69823a759aee206239209319c0dde24c0ba89f3 +Subproject commit e844dc2aa3b02795a8b4f23503104bc9e16bec24 From 80dfd527422b6037f97b504ce7e6d700d860281f Mon Sep 17 00:00:00 2001 From: James Newling Date: Tue, 21 May 2024 07:19:39 -0700 Subject: [PATCH 2/2] fix lit tests --- .../AMD-AIE/iree-amd-aie/Transforms/test/pack_to_air.mlir | 6 +++--- tests/transform_dialect/conv_fill_spec_pad.mlir | 2 +- tests/transform_dialect/matmul_fill_spec_pack_funcIR.mlir | 2 +- tests/transform_dialect/matmul_fill_spec_pack_peel.mlir | 4 ++-- tests/transform_dialect/matmul_fill_spec_pad.mlir | 2 +- tests/transform_dialect/matmul_fill_spec_pad_pack.mlir | 6 +++--- tests/transform_dialect/matmul_fill_spec_pad_pack_peel.mlir | 4 ++-- tests/transform_dialect/matmul_fill_spec_simple_pack.mlir | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/test/pack_to_air.mlir b/compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/test/pack_to_air.mlir index f8508ec87..d01d68d95 100644 --- a/compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/test/pack_to_air.mlir +++ b/compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/test/pack_to_air.mlir @@ -16,7 +16,7 @@ func.func @func0() { // CHECK: %[[ALLOC0:.*]] = memref.alloc() : memref<1x1x8x16xi32, 1> // CHECK: %[[ALLOC1:.*]] = memref.alloc() : memref<1x1x2x2x4x8xi32, 2> // CHECK: %[[EXPANDSHAPE0:.*]] = memref.expand_shape %[[ALLOC0]] -// CHECK-SAME{LITERAL}: [[0], [1], [2, 3], [4, 5]] : memref<1x1x8x16xi32, 1> into memref<1x1x2x4x2x8xi32, 1> +// CHECK-SAME: output_shape [1, 1, 2, 4, 2, 8] : memref<1x1x8x16xi32, 1> into memref<1x1x2x4x2x8xi32, 1> // CHECK: %[[TRANSPOSE0:.*]] = memref.transpose %[[EXPANDSHAPE0]] (d0, d1, d2, d3, d4, d5) -> (d0, d1, d4, d2, d3, d5) : memref<1x1x2x4x2x8xi32, 1> to memref<1x1x2x2x4x8xi32, strided<[128, 128, 8, 64, 16, 1]>, 1> // CHECK: air.dma_memcpy_nd (%[[ALLOC1]][] [] [], %[[TRANSPOSE0]][] [] []) : (memref<1x1x2x2x4x8xi32, 2>, memref<1x1x2x2x4x8xi32, strided<[128, 128, 8, 64, 16, 1]>, 1>) func.func @func1() { @@ -138,13 +138,13 @@ func.func @func6() { // CHECK: %[[SUBVIEW6:.*]] = memref.subview %{{.*}}[0, %{{.*}}, 0, 0] [1, 1, 16, 16] [1, 1, 1, 1] : memref<1x1x16x16xi32, 1> to memref<1x1x16x16xi32, strided<[256, 256, 16, 1], offset: ?>, 1> // CHECK: %[[SUBVIEW7:.*]] = memref.subview %{{.*}}[%{{.*}}, %{{.*}}, 0, 0] [1, 1, 8, 16] [1, 1, 1, 1] : memref<1x1x8x16xi32, 1> to memref<1x1x8x16xi32, strided<[128, 128, 16, 1], offset: ?>, 1> // CHECK: %[[EXPANDSHAPE0:.*]] = memref.expand_shape %[[SUBVIEW5]] - // CHECK-SAME{LITERAL}: [[0], [1], [2, 3], [4, 5]] : memref<1x1x8x16xi32, strided<[128, 128, 16, 1], offset: ?>, 1> into memref<1x1x2x4x2x8xi32, strided<[128, 128, 64, 16, 8, 1], offset: ?>, 1> + // CHECK-SAME: output_shape [1, 1, 2, 4, 2, 8] : memref<1x1x8x16xi32, strided<[128, 128, 16, 1], offset: ?>, 1> into memref<1x1x2x4x2x8xi32, strided<[128, 128, 64, 16, 8, 1], offset: ?>, 1> // CHECK: %[[TRANSPOSE2:.*]] = memref.transpose %[[EXPANDSHAPE0]] (d0, d1, d2, d3, d4, d5) -> (d0, d1, d4, d2, d3, d5) : memref<1x1x2x4x2x8xi32, strided<[128, 128, 64, 16, 8, 1], offset: ?>, 1> to memref<1x1x2x2x4x8xi32, strided<[128, 128, 8, 64, 16, 1], offset: ?>, 1> // CHECK: air.dma_memcpy_nd (%{{.*}}[] [] [], %[[TRANSPOSE2]][] [] []) : (memref<1x1x2x2x4x8xi32, 2>, memref<1x1x2x2x4x8xi32, strided<[128, 128, 8, 64, 16, 1], offset: ?>, 1>) iree_linalg_ext.pack %subview_4 outer_dims_perm = [0, 1, 3, 2] inner_dims_pos = [2, 3] inner_tiles = [4, 8] into %alloc_7 : (memref<1x1x8x16xi32, strided<[128, 128, 16, 1], offset: ?>, 1> memref<1x1x2x2x4x8xi32, 2>) %alloc_8 = memref.alloc() : memref<1x1x2x2x8x8xi32, 2> // CHECK: %[[EXPANDSHAPE1:.*]] = memref.expand_shape %[[SUBVIEW6]] - // CHECK-SAME{LITERAL}: [[0], [1], [2, 3], [4, 5]] : memref<1x1x16x16xi32, strided<[256, 256, 16, 1], offset: ?>, 1> into memref<1x1x2x8x2x8xi32, strided<[256, 256, 128, 16, 8, 1], offset: ?>, 1> + // CHECK-SAME: output_shape [1, 1, 2, 8, 2, 8] : memref<1x1x16x16xi32, strided<[256, 256, 16, 1], offset: ?>, 1> into memref<1x1x2x8x2x8xi32, strided<[256, 256, 128, 16, 8, 1], offset: ?>, 1> // CHECK: %[[TRANSPOSE3:.*]] = memref.transpose %[[EXPANDSHAPE1]] (d0, d1, d2, d3, d4, d5) -> (d0, d1, d4, d2, d3, d5) : memref<1x1x2x8x2x8xi32, strided<[256, 256, 128, 16, 8, 1], offset: ?>, 1> to memref<1x1x2x2x8x8xi32, strided<[256, 256, 8, 128, 16, 1], offset: ?>, 1> // CHECK: air.dma_memcpy_nd (%{{.*}}[] [] [], %[[TRANSPOSE3]][] [] []) : (memref<1x1x2x2x8x8xi32, 2>, memref<1x1x2x2x8x8xi32, strided<[256, 256, 8, 128, 16, 1], offset: ?>, 1>) iree_linalg_ext.pack %subview_5 outer_dims_perm = [0, 1, 3, 2] inner_dims_pos = [2, 3] inner_tiles = [8, 8] into %alloc_8 : (memref<1x1x16x16xi32, strided<[256, 256, 16, 1], offset: ?>, 1> memref<1x1x2x2x8x8xi32, 2>) diff --git a/tests/transform_dialect/conv_fill_spec_pad.mlir b/tests/transform_dialect/conv_fill_spec_pad.mlir index f91f358dd..4d042a18a 100644 --- a/tests/transform_dialect/conv_fill_spec_pad.mlir +++ b/tests/transform_dialect/conv_fill_spec_pad.mlir @@ -141,7 +141,7 @@ module attributes { transform.with_named_sequence } { // N H W C K h w ===> 3 loops for K, h, w are inserted. %tiled_reduction, %loop0, %loop1, %loop2 = - transform.structured.tile_using_for %padded_1 [0,0,0,0,8,1,1] + transform.structured.tile_using_for %padded_1 tile_sizes [0,0,0,0,8,1,1] : (!any) -> (!any, !any, !any, !any) transform.include @replace_conv2d_with_conv1d failures(propagate) diff --git a/tests/transform_dialect/matmul_fill_spec_pack_funcIR.mlir b/tests/transform_dialect/matmul_fill_spec_pack_funcIR.mlir index 422c2da5f..9dd61ff0d 100644 --- a/tests/transform_dialect/matmul_fill_spec_pack_funcIR.mlir +++ b/tests/transform_dialect/matmul_fill_spec_pack_funcIR.mlir @@ -48,7 +48,7 @@ module attributes { transform.with_named_sequence } { // Tile reduction dimension. %tiled_reduction, %loop = - transform.structured.tile_using_for %tiled_matmul [0, 0, 64] + transform.structured.tile_using_for %tiled_matmul tile_sizes [0, 0, 64] : (!transform.any_op) -> (!transform.any_op, !transform.op<"scf.for">) // Pack by applying data tiling, and the linalg.matmul becomes linalg.generic. diff --git a/tests/transform_dialect/matmul_fill_spec_pack_peel.mlir b/tests/transform_dialect/matmul_fill_spec_pack_peel.mlir index 7f558c2c5..19ce633f6 100644 --- a/tests/transform_dialect/matmul_fill_spec_pack_peel.mlir +++ b/tests/transform_dialect/matmul_fill_spec_pack_peel.mlir @@ -100,7 +100,7 @@ module attributes { transform.with_named_sequence } { // First level for loop. %first_level_tiled_reduction_matmul, %outer_for_loop = - transform.structured.tile_using_for %l1_packed_matmul [0, 0, 1] + transform.structured.tile_using_for %l1_packed_matmul tile_sizes [0, 0, 1] : (!transform.any_op) -> (!transform.any_op, !transform.any_op) // Fuse the pack operations in the outer for loop. @@ -134,7 +134,7 @@ module attributes { transform.with_named_sequence } { // Second level for loop. %generic_op1 = transform.structured.match ops{["linalg.generic"]} in %variant_op : (!transform.any_op) -> !transform.any_op %second_level_tiled_reduction_matmul, %inner_for_loop = - transform.structured.tile_using_for %generic_op1 [0, 0, 0, 0, 0, 4] + transform.structured.tile_using_for %generic_op1 tile_sizes [0, 0, 0, 0, 0, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op) // Fuse the pack operations in inner for loop. diff --git a/tests/transform_dialect/matmul_fill_spec_pad.mlir b/tests/transform_dialect/matmul_fill_spec_pad.mlir index 125fba652..57a1a9fb6 100644 --- a/tests/transform_dialect/matmul_fill_spec_pad.mlir +++ b/tests/transform_dialect/matmul_fill_spec_pad.mlir @@ -99,7 +99,7 @@ module attributes { transform.with_named_sequence } { // Tile reduction dimension. %tiled_reduction, %loop = - transform.structured.tile_using_for %padded_1 [0, 0, 4] + transform.structured.tile_using_for %padded_1 tile_sizes [0, 0, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op) // Clean up. diff --git a/tests/transform_dialect/matmul_fill_spec_pad_pack.mlir b/tests/transform_dialect/matmul_fill_spec_pad_pack.mlir index 0db58544b..1f66d29e9 100644 --- a/tests/transform_dialect/matmul_fill_spec_pad_pack.mlir +++ b/tests/transform_dialect/matmul_fill_spec_pad_pack.mlir @@ -70,10 +70,10 @@ module attributes { transform.with_named_sequence } { %copy_1 = transform.get_producer_of_operand %padded[0] : (!transform.any_op) -> (!transform.any_op) %copy_2 = transform.get_producer_of_operand %padded[1] : (!transform.any_op) -> (!transform.any_op) %tiled_copy_1, %tiled_copy_for_loop_1 = - transform.structured.tile_using_for %copy_1 [0, 256] + transform.structured.tile_using_for %copy_1 tile_sizes [0, 256] : (!transform.any_op) -> (!transform.any_op, !transform.op<"scf.for">) %tiled_copy_2, %tiled_copy_for_loop_2 = - transform.structured.tile_using_for %copy_2 [256, 0] + transform.structured.tile_using_for %copy_2 tile_sizes [256, 0] : (!transform.any_op) -> (!transform.any_op, !transform.op<"scf.for">) // Second level tile to forall with tile_sizes. @@ -124,7 +124,7 @@ module attributes { transform.with_named_sequence } { // Tile the reduction loop. %tiled_reduction, %for_loop = - transform.structured.tile_using_for %packed_c [0, 0, 4] + transform.structured.tile_using_for %packed_c tile_sizes [0, 0, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op) // Fuse pack ops into the for loop. diff --git a/tests/transform_dialect/matmul_fill_spec_pad_pack_peel.mlir b/tests/transform_dialect/matmul_fill_spec_pad_pack_peel.mlir index f5eff844b..8daa833f9 100644 --- a/tests/transform_dialect/matmul_fill_spec_pad_pack_peel.mlir +++ b/tests/transform_dialect/matmul_fill_spec_pad_pack_peel.mlir @@ -48,7 +48,7 @@ module attributes { transform.with_named_sequence } { // First level for loop. %tiled_reduction, %for_loop = - transform.structured.tile_using_for %tiled_matmul [0, 0, 256] + transform.structured.tile_using_for %tiled_matmul tile_sizes [0, 0, 256] : (!transform.any_op) -> (!transform.any_op, !transform.op<"scf.for">) // Pad operation. @@ -117,7 +117,7 @@ module attributes { transform.with_named_sequence } { // Second level for loop. %tiled_reduction_1, %for_loop_1 = - transform.structured.tile_using_for %packed_c [0, 0, 4] + transform.structured.tile_using_for %packed_c tile_sizes [0, 0, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op) // Fuse pack ops into the for loop. diff --git a/tests/transform_dialect/matmul_fill_spec_simple_pack.mlir b/tests/transform_dialect/matmul_fill_spec_simple_pack.mlir index d2e77b7d1..179b00e1d 100644 --- a/tests/transform_dialect/matmul_fill_spec_simple_pack.mlir +++ b/tests/transform_dialect/matmul_fill_spec_simple_pack.mlir @@ -115,7 +115,7 @@ module attributes { transform.with_named_sequence } { // Tile reduction dimension. %tiled_reduction, %loop = - transform.structured.tile_using_for %packed_c[0, 0, 0, 0, 0, 4] + transform.structured.tile_using_for %packed_c tile_sizes [0, 0, 0, 0, 0, 4] : (!transform.any_op) -> (!transform.any_op, !transform.any_op) // Find the for op and fuse the pack ops into the loop.