From 757e554019806f0fb01e463f1286c4e76b57e3cf Mon Sep 17 00:00:00 2001 From: Megan Hampton Date: Mon, 8 Apr 2024 12:48:10 -0400 Subject: [PATCH 1/7] Upgrade LLVM to c511c90680ee and StableHLO to 1bdf7c2 --- docs/BuildOnLinuxOSX.md | 2 +- docs/BuildOnWindows.md | 2 +- src/Conversion/KrnlToLLVM/ConvertKrnlToLLVM.cpp | 4 ++-- third_party/stablehlo | 2 +- utils/clone-mlir.sh | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/BuildOnLinuxOSX.md b/docs/BuildOnLinuxOSX.md index 5f6c706743..20a3e641d8 100644 --- a/docs/BuildOnLinuxOSX.md +++ b/docs/BuildOnLinuxOSX.md @@ -15,7 +15,7 @@ Firstly, install MLIR (as a part of LLVM-Project): ``` bash git clone -n https://github.com/llvm/llvm-project.git # Check out a specific branch that is known to work with ONNX-MLIR. -cd llvm-project && git checkout a4ca07f13b560b4f6fa5459eef7159e4f9ee9a6b && cd .. +cd llvm-project && git checkout c511c90680eecae2e4adb87f442f41d465feb0f2 && cd .. ``` [same-as-file]: <> (utils/build-mlir.sh) diff --git a/docs/BuildOnWindows.md b/docs/BuildOnWindows.md index 11f8cda7b5..e318851eeb 100644 --- a/docs/BuildOnWindows.md +++ b/docs/BuildOnWindows.md @@ -52,7 +52,7 @@ Install MLIR (as a part of LLVM-Project): ```shell git clone -n https://github.com/llvm/llvm-project.git # Check out a specific branch that is known to work with ONNX-MLIR. -cd llvm-project && git checkout a4ca07f13b560b4f6fa5459eef7159e4f9ee9a6b && cd .. +cd llvm-project && git checkout c511c90680eecae2e4adb87f442f41d465feb0f2 && cd .. ``` [same-as-file]: <> (utils/build-mlir.cmd) diff --git a/src/Conversion/KrnlToLLVM/ConvertKrnlToLLVM.cpp b/src/Conversion/KrnlToLLVM/ConvertKrnlToLLVM.cpp index a67d1b57d7..4010e5a00c 100644 --- a/src/Conversion/KrnlToLLVM/ConvertKrnlToLLVM.cpp +++ b/src/Conversion/KrnlToLLVM/ConvertKrnlToLLVM.cpp @@ -4,7 +4,7 @@ //====------ ConvertKrnlToLLVM.cpp - Krnl Dialect Lowering ---------------===// // -// Copyright 2019-2022 The IBM Research Authors. +// Copyright 2019-2024 The IBM Research Authors. // // ============================================================================= // @@ -875,7 +875,7 @@ void ConvertKrnlToLLVMPass::runOnOperation() { customizeTypeConverter(typeConverter); // omp::ParallelOp can only be legalized when its region is legal - target.addDynamicallyLegalOp( + target.addDynamicallyLegalOp( [&](Operation *op) { return typeConverter.isLegal(&op->getRegion(0)); }); // Currently, only minimum required OpenMP Ops are marked as legal, in the // future integration of OpenMP, probably more OpenMP Ops are required to be diff --git a/third_party/stablehlo b/third_party/stablehlo index 3442dbe0cd..1bdf7c2603 160000 --- a/third_party/stablehlo +++ b/third_party/stablehlo @@ -1 +1 @@ -Subproject commit 3442dbe0cd65ced69f0d1d4a6c274cb154873764 +Subproject commit 1bdf7c2603b7e68d97c1b9be92a51826e06cb6ee diff --git a/utils/clone-mlir.sh b/utils/clone-mlir.sh index 7e10cbc0af..475d96fe5f 100644 --- a/utils/clone-mlir.sh +++ b/utils/clone-mlir.sh @@ -1,3 +1,3 @@ git clone -n https://github.com/llvm/llvm-project.git # Check out a specific branch that is known to work with ONNX-MLIR. -cd llvm-project && git checkout a4ca07f13b560b4f6fa5459eef7159e4f9ee9a6b && cd .. +cd llvm-project && git checkout c511c90680eecae2e4adb87f442f41d465feb0f2 && cd .. From 316d3848a07bf7ce6a7af64654968bd9ba0452e1 Mon Sep 17 00:00:00 2001 From: Megan Hampton Date: Mon, 8 Apr 2024 20:53:34 -0400 Subject: [PATCH 2/7] Fix buffer deallocation pass --- .../Sequence/Sequence_with_dealloc.mlir | 74 +++++++++++-------- 1 file changed, 45 insertions(+), 29 deletions(-) diff --git a/test/mlir/conversion/onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir b/test/mlir/conversion/onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir index 5ed96db5b8..746f47a38d 100644 --- a/test/mlir/conversion/onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir +++ b/test/mlir/conversion/onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir @@ -1,4 +1,4 @@ -// RUN: onnx-mlir-opt -O3 --shape-inference --convert-onnx-to-krnl --buffer-deallocation-pipeline %s -split-input-file | FileCheck %s +// RUN: onnx-mlir-opt -O3 --shape-inference --convert-onnx-to-krnl --buffer-deallocation %s -split-input-file | FileCheck %s // ----- @@ -12,53 +12,69 @@ func.func @test_sequence_erase(%arg0: !onnx.Seq>) -> tensor<3x // mlir2FileCheck.py // CHECK-DAG: [[MAP_0_:#.+]] = affine_map<()[s0] -> (s0 - 1)> -// CHECK-DAG: [[MAP_1_:#.+]] = affine_map<()[s0, s1] -> (s0 + s1)> +// CHECK-DAG: [[MAP_1_:#.+]] = affine_map<()[s0, s1] -> (s1 + s0)> // CHECK-DAG: [[MAP_2_:#.+]] = affine_map<()[s0, s1] -> (s0)> +// CHECK-DAG: [[MAP_3_:#.+]] = affine_map<()[s0, s1] -> (s0 + s1)> // CHECK-LABEL: func.func @test_sequence_erase // CHECK-SAME: ([[PARAM_0_:%.+]]: memref>) -> memref<3xi64> { -// CHECK-DAG: [[CST_5_:%.+]] = arith.constant 5 : i64 -// CHECK-DAG: [[CST_4_:%.+]] = arith.constant 4 : i64 -// CHECK-DAG: [[CST_2_:%.+]] = arith.constant 2 : index -// CHECK-DAG: [[CST_1_:%.+]] = arith.constant 1 : index -// CHECK-DAG: [[CST_0_:%.+]] = arith.constant 0 : index // CHECK-DAG: [[VAR_0_:%.+]] = "krnl.global"() {name = "constant_{{[0-9]+}}", shape = [], value = dense<0> : tensor} : () -> memref -// CHECK: [[VAR_dim_:%.+]] = memref.dim [[PARAM_0_]], [[CST_0_]] : memref> +// CHECK-DAG: [[CST_0_:%.+]] = arith.constant 0 : index +// CHECK-NOT: separator of consecutive DAGs +// CHECK-DAG: [[VAR_dim_:%.+]] = memref.dim [[PARAM_0_]], [[CST_0_]] : memref> +// CHECK-DAG: [[CST_1_:%.+]] = arith.constant 1 : index // CHECK: [[VAR_1_:%.+]] = affine.apply [[MAP_0_]](){{.}}[[VAR_dim_]]{{.}} // CHECK-DAG: [[VAR_2_:%.+]] = "krnl.seqalloc"([[VAR_1_]]) : (index) -> memref> // CHECK-DAG: [[LOAD_VAR_0_MEM_:%.+]] = krnl.load [[VAR_0_]][] : memref // CHECK: [[VAR_4_:%.+]] = arith.index_cast [[LOAD_VAR_0_MEM_]] : i64 to index // CHECK-DAG: [[VAR_5_:%.+]] = affine.apply [[MAP_1_]](){{.}}[[VAR_dim_]], [[VAR_4_]]{{.}} -// CHECK-DAG: [[VAR_6_:%.+]] = arith.cmpi slt, [[VAR_4_]], [[CST_0_]] : index -// CHECK-NOT: separator of consecutive DAGs +// CHECK-DAG: [[CST_0_1_:%.+]] = arith.constant 0 : index +// CHECK: [[VAR_6_:%.+]] = arith.cmpi slt, [[VAR_4_]], [[CST_0_1_]] : index // CHECK-DAG: [[VAR_7_:%.+]] = arith.select [[VAR_6_]], [[VAR_5_]], [[VAR_4_]] : index +// CHECK-DAG: [[CST_0_2_:%.+]] = arith.constant 0 : index // CHECK-DAG: [[LOOP_0_:%.+]] = krnl.define_loops 1 // CHECK: krnl.iterate([[LOOP_0_]]) with ([[LOOP_0_]] -> [[I_0_:%.+]] = 0 to [[VAR_7_]]){ -// CHECK: [[VAR_18_:%.+]] = krnl.get_induction_var_value([[LOOP_0_]]) : (!krnl.loop) -> index -// CHECK: [[LOAD_PARAM_0_MEM_:%.+]] = krnl.load [[PARAM_0_]]{{.}}[[VAR_18_]]{{.}} : memref> +// CHECK: [[VAR_20_:%.+]] = krnl.get_induction_var_value([[LOOP_0_]]) : (!krnl.loop) -> index +// CHECK: [[LOAD_PARAM_0_MEM_:%.+]] = krnl.load [[PARAM_0_]]{{.}}[[VAR_20_]]{{.}} : memref> // CHECK: "krnl.seqstore"([[LOAD_PARAM_0_MEM_]], [[VAR_2_]], [[VAR_7_]]) : (memref, memref>, index) -> () // CHECK: } -// CHECK-DAG: [[VAR_9_:%.+]] = arith.addi [[VAR_7_]], [[CST_1_]] : index -// CHECK: krnl.iterate([[LOOP_0_]]) with ([[LOOP_0_]] -> [[I_1_:%.+]] = [[VAR_9_]] to [[MAP_2_]](){{.}}[[VAR_dim_]], [[VAR_4_]]{{.}}){ -// CHECK: [[VAR_18_1_:%.+]] = krnl.get_induction_var_value([[LOOP_0_]]) : (!krnl.loop) -> index -// CHECK-DAG: [[LOAD_PARAM_0_MEM_1_:%.+]] = krnl.load [[PARAM_0_]]{{.}}[[VAR_18_1_]]{{.}} : memref> -// CHECK-DAG: [[VAR_20_:%.+]] = arith.subi [[VAR_18_1_]], [[CST_1_]] : index -// CHECK: "krnl.seqstore"([[LOAD_PARAM_0_MEM_1_]], [[VAR_2_]], [[VAR_20_]]) : (memref, memref>, index) -> () +// CHECK: [[CST_1_1_:%.+]] = arith.constant 1 : index +// CHECK-DAG: [[VAR_9_:%.+]] = arith.addi [[VAR_7_]], [[CST_1_1_]] : index +// CHECK-DAG: [[LOOP_1_:%.+]] = krnl.define_loops 1 +// CHECK: krnl.iterate([[LOOP_1_]]) with ([[LOOP_1_]] -> [[I_1_:%.+]] = [[VAR_9_]] to [[MAP_2_]](){{.}}[[VAR_dim_]], [[VAR_4_]]{{.}}){ +// CHECK: [[VAR_20_1_:%.+]] = krnl.get_induction_var_value([[LOOP_1_]]) : (!krnl.loop) -> index +// CHECK-DAG: [[LOAD_PARAM_0_MEM_1_:%.+]] = krnl.load [[PARAM_0_]]{{.}}[[VAR_20_1_]]{{.}} : memref> +// CHECK-DAG: [[CST_1_2_:%.+]] = arith.constant 1 : index +// CHECK: [[VAR_22_:%.+]] = arith.subi [[VAR_20_1_]], [[CST_1_2_]] : index +// CHECK: "krnl.seqstore"([[LOAD_PARAM_0_MEM_1_]], [[VAR_2_]], [[VAR_2_]]2) : (memref, memref>, index) -> () // CHECK: } -// CHECK-DAG: [[VAR_dim_0_:%.+]] = memref.dim [[VAR_2_]], [[CST_0_]] : memref> +// CHECK: [[CST_0_3_:%.+]] = arith.constant 0 : index +// CHECK-DAG: [[VAR_dim_4_:%.+]] = memref.dim [[VAR_2_]], [[CST_0_3_]] : memref> // CHECK-DAG: [[LOAD_VAR_0_MEM_1_:%.+]] = krnl.load [[VAR_0_]][] : memref -// CHECK: [[VAR_12_:%.+]] = arith.index_cast [[LOAD_VAR_0_MEM_1_]] : i64 to index -// CHECK-DAG: [[VAR_13_:%.+]] = arith.cmpi slt, [[VAR_12_]], [[CST_0_]] : index -// CHECK-DAG: [[VAR_14_:%.+]] = affine.apply [[MAP_1_]](){{.}}{{%.*}}, {{%.*}}{{.}} +// CHECK-NOT: separator of consecutive DAGs +// CHECK-DAG: [[VAR_12_:%.+]] = arith.index_cast [[LOAD_VAR_0_MEM_1_]] : i64 to index +// CHECK-DAG: [[CST_0_4_:%.+]] = arith.constant 0 : index +// CHECK-NOT: separator of consecutive DAGs +// CHECK-DAG: [[VAR_13_:%.+]] = arith.cmpi slt, [[VAR_12_]], [[CST_0_4_]] : index +// CHECK-DAG: [[VAR_14_:%.+]] = affine.apply [[MAP_3_]](){{.}}[[VAR_12_]], [[VAR_dim_4_]]{{.}} // CHECK: [[VAR_15_:%.+]] = arith.select [[VAR_13_]], [[VAR_14_]], [[VAR_12_]] : index -// CHECK-DAG: [[VAR_16_:%.+]] = "krnl.seqextract"([[VAR_2_]], [[VAR_15_]]) {copy = 1 : ui1} : (memref>, index) -> memref +// CHECK: [[VAR_16_:%.+]] = "krnl.seqextract"([[VAR_2_]], [[VAR_15_]]) {copy = 1 : ui1} : (memref>, index) -> memref +// CHECK: "krnl.seqdealloc"([[VAR_2_]]) : (memref>) -> () +// CHECK-DAG: [[CST_3_:%.+]] = arith.constant 3 : index // CHECK-DAG: [[RES_:%.+]] = memref.alloc() {{.*}}: memref<3xi64> -// CHECK: [[VAR_dim_1_:%.+]] = memref.dim [[VAR_16_]], [[CST_0_]] : memref -// CHECK: [[VAR_17_:%.+]] = arith.index_cast [[VAR_dim_1_]] : index to i64 -// CHECK: krnl.store [[VAR_17_]], [[RES_]]{{.}}[[CST_0_]]{{.}} : memref<3xi64> -// CHECK: krnl.store [[CST_4_]], [[RES_]]{{.}}[[CST_1_]]{{.}} : memref<3xi64> -// CHECK: krnl.store [[CST_5_]], [[RES_]]{{.}}[[CST_2_]]{{.}} : memref<3xi64> -// CHECK: memref.dealloc [[VAR_2_]] : memref> +// CHECK-DAG: [[CST_0_5_:%.+]] = arith.constant 0 : index +// CHECK: [[VAR_dim_7_:%.+]] = memref.dim [[VAR_16_]], [[CST_0_5_]] : memref // CHECK: memref.dealloc [[VAR_16_]] : memref +// CHECK-DAG: [[CST_4_:%.+]] = arith.constant 4 : index +// CHECK-DAG: [[CST_5_:%.+]] = arith.constant 5 : index +// CHECK-DAG: [[VAR_17_:%.+]] = arith.index_cast [[VAR_dim_7_]] : index to i64 +// CHECK-DAG: [[CST_0_6_:%.+]] = arith.constant 0 : index +// CHECK: krnl.store [[VAR_17_]], [[RES_]]{{.}}[[CST_0_6_]]{{.}} : memref<3xi64> +// CHECK-DAG: [[VAR_18_:%.+]] = arith.index_cast [[CST_4_]] : index to i64 +// CHECK-DAG: [[CST_1_3_:%.+]] = arith.constant 1 : index +// CHECK: krnl.store [[VAR_18_]], [[RES_]]{{.}}[[CST_1_3_]]{{.}} : memref<3xi64> +// CHECK-DAG: [[VAR_19_:%.+]] = arith.index_cast [[CST_5_]] : index to i64 +// CHECK-DAG: [[CST_2_:%.+]] = arith.constant 2 : index +// CHECK: krnl.store [[VAR_19_]], [[RES_]]{{.}}[[CST_2_]]{{.}} : memref<3xi64> // CHECK: return [[RES_]] : memref<3xi64> // CHECK: } } From 54a5c738fe8b6519457ec3a71c44d38fa5f87fe0 Mon Sep 17 00:00:00 2001 From: Megan Hampton Date: Mon, 8 Apr 2024 21:39:19 -0400 Subject: [PATCH 3/7] Small syntax fix --- .../onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/mlir/conversion/onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir b/test/mlir/conversion/onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir index 746f47a38d..3766688ee6 100644 --- a/test/mlir/conversion/onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir +++ b/test/mlir/conversion/onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir @@ -1,8 +1,5 @@ // RUN: onnx-mlir-opt -O3 --shape-inference --convert-onnx-to-krnl --buffer-deallocation %s -split-input-file | FileCheck %s -// ----- - - func.func @test_sequence_erase(%arg0: !onnx.Seq>) -> tensor<3xi64> { %0 = onnx.Constant {value = dense<0> : tensor} : tensor %7 = "onnx.SequenceErase"(%arg0, %0) : (!onnx.Seq>, tensor) -> !onnx.Seq> From 93c35cd81f3e737129b80f4d2bd7aad25a9c2ae9 Mon Sep 17 00:00:00 2001 From: Megan Hampton Date: Tue, 9 Apr 2024 13:07:33 -0400 Subject: [PATCH 4/7] Change LLVM and StableHLO commit --- docs/BuildOnLinuxOSX.md | 2 +- docs/BuildOnWindows.md | 2 +- .../onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir | 9 ++++----- third_party/stablehlo | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/BuildOnLinuxOSX.md b/docs/BuildOnLinuxOSX.md index 20a3e641d8..5a43009c72 100644 --- a/docs/BuildOnLinuxOSX.md +++ b/docs/BuildOnLinuxOSX.md @@ -15,7 +15,7 @@ Firstly, install MLIR (as a part of LLVM-Project): ``` bash git clone -n https://github.com/llvm/llvm-project.git # Check out a specific branch that is known to work with ONNX-MLIR. -cd llvm-project && git checkout c511c90680eecae2e4adb87f442f41d465feb0f2 && cd .. +cd llvm-project && git checkout 7ac7d418ac2b16fd44789dcf48e2b5d73de3e715 && cd .. ``` [same-as-file]: <> (utils/build-mlir.sh) diff --git a/docs/BuildOnWindows.md b/docs/BuildOnWindows.md index e318851eeb..d4dc44ec2a 100644 --- a/docs/BuildOnWindows.md +++ b/docs/BuildOnWindows.md @@ -52,7 +52,7 @@ Install MLIR (as a part of LLVM-Project): ```shell git clone -n https://github.com/llvm/llvm-project.git # Check out a specific branch that is known to work with ONNX-MLIR. -cd llvm-project && git checkout c511c90680eecae2e4adb87f442f41d465feb0f2 && cd .. +cd llvm-project && git checkout 7ac7d418ac2b16fd44789dcf48e2b5d73de3e715 && cd .. ``` [same-as-file]: <> (utils/build-mlir.cmd) diff --git a/test/mlir/conversion/onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir b/test/mlir/conversion/onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir index 3766688ee6..e75ab1c78f 100644 --- a/test/mlir/conversion/onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir +++ b/test/mlir/conversion/onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir @@ -1,4 +1,4 @@ -// RUN: onnx-mlir-opt -O3 --shape-inference --convert-onnx-to-krnl --buffer-deallocation %s -split-input-file | FileCheck %s +// RUN: onnx-mlir-opt -O3 --shape-inference --convert-onnx-to-krnl --buffer-deallocation %s -split-input-file | FileCheck %s func.func @test_sequence_erase(%arg0: !onnx.Seq>) -> tensor<3xi64> { %0 = onnx.Constant {value = dense<0> : tensor} : tensor @@ -54,13 +54,13 @@ func.func @test_sequence_erase(%arg0: !onnx.Seq>) -> tensor<3x // CHECK-DAG: [[VAR_13_:%.+]] = arith.cmpi slt, [[VAR_12_]], [[CST_0_4_]] : index // CHECK-DAG: [[VAR_14_:%.+]] = affine.apply [[MAP_3_]](){{.}}[[VAR_12_]], [[VAR_dim_4_]]{{.}} // CHECK: [[VAR_15_:%.+]] = arith.select [[VAR_13_]], [[VAR_14_]], [[VAR_12_]] : index -// CHECK: [[VAR_16_:%.+]] = "krnl.seqextract"([[VAR_2_]], [[VAR_15_]]) {copy = 1 : ui1} : (memref>, index) -> memref -// CHECK: "krnl.seqdealloc"([[VAR_2_]]) : (memref>) -> () +// CHECK-DAG: [[VAR_16_:%.+]] = "krnl.seqextract"([[VAR_2_]], [[VAR_15_]]) {copy = 1 : ui1} : (memref>, index) -> memref // CHECK-DAG: [[CST_3_:%.+]] = arith.constant 3 : index // CHECK-DAG: [[RES_:%.+]] = memref.alloc() {{.*}}: memref<3xi64> // CHECK-DAG: [[CST_0_5_:%.+]] = arith.constant 0 : index // CHECK: [[VAR_dim_7_:%.+]] = memref.dim [[VAR_16_]], [[CST_0_5_]] : memref // CHECK: memref.dealloc [[VAR_16_]] : memref +// CHECK: "krnl.seqdealloc"([[VAR_2_]]) : (memref>) -> () // CHECK-DAG: [[CST_4_:%.+]] = arith.constant 4 : index // CHECK-DAG: [[CST_5_:%.+]] = arith.constant 5 : index // CHECK-DAG: [[VAR_17_:%.+]] = arith.index_cast [[VAR_dim_7_]] : index to i64 @@ -74,5 +74,4 @@ func.func @test_sequence_erase(%arg0: !onnx.Seq>) -> tensor<3x // CHECK: krnl.store [[VAR_19_]], [[RES_]]{{.}}[[CST_2_]]{{.}} : memref<3xi64> // CHECK: return [[RES_]] : memref<3xi64> // CHECK: } -} - +} \ No newline at end of file diff --git a/third_party/stablehlo b/third_party/stablehlo index 1bdf7c2603..2a0595bd31 160000 --- a/third_party/stablehlo +++ b/third_party/stablehlo @@ -1 +1 @@ -Subproject commit 1bdf7c2603b7e68d97c1b9be92a51826e06cb6ee +Subproject commit 2a0595bd31bbdf1a191fc46f249e1734900ab1da From 311e81b18b0182b35dea91e6a83539d9232f7bf9 Mon Sep 17 00:00:00 2001 From: Megan Hampton Date: Tue, 9 Apr 2024 14:47:44 -0400 Subject: [PATCH 5/7] Fix lit test --- .../onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/mlir/conversion/onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir b/test/mlir/conversion/onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir index e75ab1c78f..0c5d8c338b 100644 --- a/test/mlir/conversion/onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir +++ b/test/mlir/conversion/onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir @@ -1,5 +1,8 @@ // RUN: onnx-mlir-opt -O3 --shape-inference --convert-onnx-to-krnl --buffer-deallocation %s -split-input-file | FileCheck %s +// ----- + + func.func @test_sequence_erase(%arg0: !onnx.Seq>) -> tensor<3xi64> { %0 = onnx.Constant {value = dense<0> : tensor} : tensor %7 = "onnx.SequenceErase"(%arg0, %0) : (!onnx.Seq>, tensor) -> !onnx.Seq> @@ -74,4 +77,4 @@ func.func @test_sequence_erase(%arg0: !onnx.Seq>) -> tensor<3x // CHECK: krnl.store [[VAR_19_]], [[RES_]]{{.}}[[CST_2_]]{{.}} : memref<3xi64> // CHECK: return [[RES_]] : memref<3xi64> // CHECK: } -} \ No newline at end of file +} From 024229d9fc8cc1e4fa0542904c7873974e674e08 Mon Sep 17 00:00:00 2001 From: Megan Hampton Date: Tue, 9 Apr 2024 15:09:30 -0400 Subject: [PATCH 6/7] Still trying --- .../conversion/onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir | 1 - 1 file changed, 1 deletion(-) diff --git a/test/mlir/conversion/onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir b/test/mlir/conversion/onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir index 0c5d8c338b..0f07f8a528 100644 --- a/test/mlir/conversion/onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir +++ b/test/mlir/conversion/onnx_to_krnl/Sequence/Sequence_with_dealloc.mlir @@ -63,7 +63,6 @@ func.func @test_sequence_erase(%arg0: !onnx.Seq>) -> tensor<3x // CHECK-DAG: [[CST_0_5_:%.+]] = arith.constant 0 : index // CHECK: [[VAR_dim_7_:%.+]] = memref.dim [[VAR_16_]], [[CST_0_5_]] : memref // CHECK: memref.dealloc [[VAR_16_]] : memref -// CHECK: "krnl.seqdealloc"([[VAR_2_]]) : (memref>) -> () // CHECK-DAG: [[CST_4_:%.+]] = arith.constant 4 : index // CHECK-DAG: [[CST_5_:%.+]] = arith.constant 5 : index // CHECK-DAG: [[VAR_17_:%.+]] = arith.index_cast [[VAR_dim_7_]] : index to i64 From 771b20fca549f0050bee931b2430a15642994082 Mon Sep 17 00:00:00 2001 From: Megan Hampton Date: Tue, 9 Apr 2024 15:20:54 -0400 Subject: [PATCH 7/7] My fault --- utils/clone-mlir.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/clone-mlir.sh b/utils/clone-mlir.sh index 475d96fe5f..7281bf9d36 100644 --- a/utils/clone-mlir.sh +++ b/utils/clone-mlir.sh @@ -1,3 +1,3 @@ git clone -n https://github.com/llvm/llvm-project.git # Check out a specific branch that is known to work with ONNX-MLIR. -cd llvm-project && git checkout c511c90680eecae2e4adb87f442f41d465feb0f2 && cd .. +cd llvm-project && git checkout 7ac7d418ac2b16fd44789dcf48e2b5d73de3e715 && cd ..