Skip to content

Bump LLVM commit to 20ed5b1f4587 #2799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/BuildOnLinuxOSX.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 7ac7d418ac2b16fd44789dcf48e2b5d73de3e715 && cd ..
cd llvm-project && git checkout 20ed5b1f45871612570d3bd447121ac43e083c6a && cd ..
```

[same-as-file]: <> (utils/build-mlir.sh)
Expand Down
2 changes: 1 addition & 1 deletion docs/BuildOnWindows.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 7ac7d418ac2b16fd44789dcf48e2b5d73de3e715 && cd ..
cd llvm-project && git checkout 20ed5b1f45871612570d3bd447121ac43e083c6a && cd ..
```

[same-as-file]: <> (utils/build-mlir.cmd)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ func.func @test_sequence_erase(%arg0: !onnx.Seq<tensor<?x4x5xf32>>) -> tensor<3x
// CHECK-DAG: [[MAP_0_:#.+]] = affine_map<()[s0] -> (s0 - 1)>
// 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<?xmemref<?x4x5xf32>>) -> memref<3xi64> {
// CHECK-DAG: [[VAR_0_:%.+]] = "krnl.global"() {name = "constant_{{[0-9]+}}", shape = [], value = dense<0> : tensor<i64>} : () -> memref<i64>
Expand Down Expand Up @@ -55,7 +54,7 @@ func.func @test_sequence_erase(%arg0: !onnx.Seq<tensor<?x4x5xf32>>) -> tensor<3x
// 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-DAG: [[VAR_14_:%.+]] = affine.apply [[MAP_1_]](){{.}}[[VAR_dim_4_]], [[VAR_12_]]{{.}}
// 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<?xmemref<?x4x5xf32>>, index) -> memref<?x4x5xf32>
// CHECK-DAG: [[CST_3_:%.+]] = arith.constant 3 : index
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func.func @test_batch_normalization(%arg0 : tensor<1x3x10x10xf32>) -> tensor<1x3
// CHECK-NEXT: [[VAR_1_:%.+]] = stablehlo.constant dense<1.000000e+00> : tensor<3xf32>
// CHECK-NEXT: [[VAR_2_:%.+]] = stablehlo.constant dense<1.000000e+00> : tensor<3xf32>
// CHECK-NEXT: [[VAR_3_:%.+]] = stablehlo.constant dense<1.000000e+00> : tensor<3xf32>
// CHECK-NEXT: [[VAR_4_:%.+]] = "stablehlo.batch_norm_inference"(%arg0, %0, %1, %2, %3) {epsilon = 1.00000007E-5 : f32, feature_index = 1 : i64} : (tensor<1x3x10x10xf32>, tensor<3xf32>, tensor<3xf32>, tensor<3xf32>, tensor<3xf32>) -> tensor<1x3x10x10xf32>
// CHECK-NEXT: [[VAR_4_:%.+]] = "stablehlo.batch_norm_inference"([[PARAM_0_]], [[VAR_0_]], [[VAR_1_]], [[VAR_2_]], [[VAR_3_]]) {epsilon = 1.00000007E-5 : f32, feature_index = 1 : i64} : (tensor<1x3x10x10xf32>, tensor<3xf32>, tensor<3xf32>, tensor<3xf32>, tensor<3xf32>) -> tensor<1x3x10x10xf32>
// CHECK-NEXT: return [[VAR_4_]] : tensor<1x3x10x10xf32>
// CHECK-NEXT: }
}
2 changes: 1 addition & 1 deletion test/mlir/conversion/onnx_to_stablehlo/Tensor/ArgMax.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func.func @test_argmax_verifier_1(%arg0 : tensor<5x5x1x32xf32>) -> tensor<*xi64>
// CHECK-DAG: [[VAR_1_:%.+]] = stablehlo.constant dense<0> : tensor<i64>
// CHECK-DAG: [[VAR_2_:%.+]] = stablehlo.constant dense<0xFF800000> : tensor<f32>
// CHECK: [[VAR_3_:%.+]] = stablehlo.dynamic_iota [[VAR_0_]], dim = 3 : (tensor<4xindex>) -> tensor<5x5x1x32xi64>
// CHECK: [[VAR_4_:%.+]]:2 = stablehlo.reduce(%arg0 init: %1), (%3 init: %0) across dimensions = [3] : (tensor<5x5x1x32xf32>, tensor<5x5x1x32xi64>, tensor<f32>, tensor<i64>) -> (tensor<5x5x1xf32>, tensor<5x5x1xi64>)
// CHECK: [[VAR_4_:%.+]]:2 = stablehlo.reduce(%arg0 init: [[VAR_2_]]), (%1 init: [[VAR_1_]]) across dimensions = [3] : (tensor<5x5x1x32xf32>, tensor<5x5x1x32xi64>, tensor<f32>, tensor<i64>) -> (tensor<5x5x1xf32>, tensor<5x5x1xi64>)
// CHECK: reducer(%arg1: tensor<f32>, %arg3: tensor<f32>) (%arg2: tensor<i64>, %arg4: tensor<i64>) {
// CHECK: [[VAR_6_:%.+]] = stablehlo.compare GE, %arg1, %arg3, NOTYPE : (tensor<f32>, tensor<f32>) -> tensor<i1>
// CHECK-DAG: [[VAR_7_:%.+]] = stablehlo.select [[VAR_6_]], %arg1, %arg3 : tensor<i1>, tensor<f32>
Expand Down
6 changes: 3 additions & 3 deletions test/mlir/conversion/onnx_to_stablehlo/Tensor/Pad.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ func.func @test_pad_constant(%arg0: tensor<1x3x5x5xf32>) -> tensor<1x3x7x7xf32>
%3 = "onnx.Pad"(%arg0, %0, %1, %2) {mode = "constant"} : (tensor<1x3x5x5xf32>, tensor<8xi64>, tensor<f32>, none) -> tensor<1x3x7x7xf32>
return %3 : tensor<1x3x7x7xf32>
// CHECK-LABEL: func.func @test_pad_constant(%arg0: tensor<1x3x5x5xf32>) -> tensor<1x3x7x7xf32> {
// CHECK-NEXT: %0 = stablehlo.constant dense<2.000000e+00> : tensor<f32>
// CHECK-NEXT: %1 = stablehlo.pad %arg0, %0, low = [0, 0, 1, 1], high = [0, 0, 1, 1], interior = [0, 0, 0, 0] : (tensor<1x3x5x5xf32>, tensor<f32>) -> tensor<1x3x7x7xf32>
// CHECK-NEXT: return %1 : tensor<1x3x7x7xf32>
// CHECK-NEXT: [[CST_:%.+]] = stablehlo.constant dense<2.000000e+00> : tensor<f32>
// CHECK-NEXT: [[PAD_:%.+]] = stablehlo.pad %arg0, [[CST_]], low = [0, 0, 1, 1], high = [0, 0, 1, 1], interior = [0, 0, 0, 0] : (tensor<1x3x5x5xf32>, tensor<f32>) -> tensor<1x3x7x7xf32>
// CHECK-NEXT: return [[PAD_]] : tensor<1x3x7x7xf32>
}
12 changes: 7 additions & 5 deletions test/mlir/conversion/onnx_to_stablehlo/Tensor/Shape.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ func.func @test_shape1(%arg0 : tensor<2x4x8x16xf32>) -> tensor<4xi64> {
%0 = "onnx.Shape"(%arg0) : (tensor<2x4x8x16xf32>) -> tensor<4xi64>
return %0 : tensor<4xi64>
// CHECK: func.func @test_shape1(%arg0: tensor<2x4x8x16xf32>) -> tensor<4xi64> {
// CHECK: %0 = stablehlo.constant dense<[2, 4, 8, 16]> : tensor<4xi64>
// CHECK: return %0 : tensor<4xi64>
// CHECK: [[CST_:%.+]] = stablehlo.constant dense<[2, 4, 8, 16]> : tensor<4xi64>
// CHECK: return [[CST_]] : tensor<4xi64>
}

// -----

func.func @test_shape2(%arg0 : tensor<?x4x8x16xf32>) -> tensor<4xi64> {
%0 = "onnx.Shape"(%arg0) : (tensor<?x4x8x16xf32>) -> tensor<4xi64>
return %0 : tensor<4xi64>
// CHECK: func.func @test_shape2(%arg0: tensor<?x4x8x16xf32>) -> tensor<4xi64> {
// CHECK: %0 = shape.shape_of %arg0 : tensor<?x4x8x16xf32> -> tensor<4xindex>
// CHECK: %1 = arith.index_cast %0 : tensor<4xindex> to tensor<4xi64>
// CHECK: return %1 : tensor<4xi64>
// CHECK: [[CST_:%.+]] = shape.shape_of %arg0 : tensor<?x4x8x16xf32> -> tensor<4xindex>
// CHECK: [[CAST_:%.+]] = arith.index_cast [[CST_]] : tensor<4xindex> to tensor<4xi64>
// CHECK: return [[CAST_]] : tensor<4xi64>
}
2 changes: 1 addition & 1 deletion third_party/stablehlo
Submodule stablehlo updated 98 files
+11 −0 BUILD.bazel
+2 −2 WORKSPACE.bazel
+1 −1 build_tools/github_actions/lint_markdown.sh
+1 −1 build_tools/github_actions/lint_whitespace_checks.sh
+1 −1 build_tools/llvm_version.txt
+3 −3 docs/reference.md
+157 −29 docs/spec.md
+1 −1 docs/status.md
+2 −2 examples/c++/BUILD.bazel
+1 −1 examples/python/stablehlo_add.py
+50 −102 rfcs/20230704-dynamism-101.md
+158 −0 rfcs/20231005-hybrid-quantization.md
+495 −0 stablehlo/conversions/linalg/tests/sparse.mlir
+3 −3 stablehlo/conversions/linalg/transforms/LegalizeToLinalgUtils.cpp
+52 −50 stablehlo/conversions/linalg/transforms/MapStablehloToScalarOp.h
+6 −1 stablehlo/conversions/linalg/transforms/Passes.td
+72 −40 stablehlo/conversions/linalg/transforms/StablehloLegalizeToLinalg.cpp
+6 −8 stablehlo/conversions/linalg/transforms/StablehloToLinalgConvolution.cpp
+3 −5 stablehlo/conversions/linalg/transforms/StablehloToLinalgDotProduct.cpp
+3 −3 stablehlo/conversions/linalg/transforms/StablehloToLinalgRandom.cpp
+3 −12 stablehlo/conversions/linalg/transforms/StablehloToLinalgReduce.cpp
+15 −32 stablehlo/conversions/tosa/transforms/StablehloLegalizeToTosa.cpp
+4 −4 stablehlo/conversions/tosa/transforms/StablehloLegalizeToTosa.pdll
+46 −9 stablehlo/dialect/AssemblyFormat.cpp
+14 −4 stablehlo/dialect/AssemblyFormat.h
+25 −25 stablehlo/dialect/Base.cpp
+54 −1 stablehlo/dialect/Base.h
+53 −15 stablehlo/dialect/Base.td
+3 −3 stablehlo/dialect/BroadcastUtils.cpp
+1 −0 stablehlo/dialect/CMakeLists.txt
+64 −94 stablehlo/dialect/ChloOps.cpp
+0 −55 stablehlo/dialect/ChloOps.td
+1 −1 stablehlo/dialect/StablehloAttrs.td
+37 −0 stablehlo/dialect/StablehloBytecode.cpp
+357 −117 stablehlo/dialect/StablehloOps.cpp
+34 −0 stablehlo/dialect/StablehloOps.h
+213 −83 stablehlo/dialect/StablehloOps.td
+646 −380 stablehlo/dialect/TypeInference.cpp
+17 −3 stablehlo/dialect/TypeInference.h
+1 −1 stablehlo/dialect/Version.h
+15 −15 stablehlo/dialect/VhloBytecode.cpp
+5 −5 stablehlo/dialect/VhloOps.cpp
+1 −1 stablehlo/dialect/VhloOps.td
+10 −10 stablehlo/dialect/VhloTypes.cpp
+5 −4 stablehlo/integrations/c/ChloAttributes.cpp
+67 −106 stablehlo/integrations/c/StablehloAttributes.cpp
+1 −1 stablehlo/integrations/c/StablehloTypes.cpp
+1 −1 stablehlo/integrations/python/StablehloModule.cpp
+3 −3 stablehlo/reference/Api.cpp
+15 −17 stablehlo/reference/Element.cpp
+2 −2 stablehlo/reference/Index.cpp
+4 −2 stablehlo/reference/Index.h
+7 −7 stablehlo/reference/InterpreterOps.cpp
+1 −1 stablehlo/reference/NumPy.cpp
+287 −7 stablehlo/reference/Ops.cpp
+10 −0 stablehlo/reference/Ops.h
+11 −11 stablehlo/reference/Tensor.cpp
+2 −2 stablehlo/reference/Types.cpp
+2 −0 stablehlo/tests/BUILD.bazel
+2 −2 stablehlo/tests/CheckOps.cpp
+72 −0 stablehlo/tests/TestUtils.cpp
+11 −0 stablehlo/tests/TestUtils.td
+419 −421 stablehlo/tests/chlo/chlo_legalize_to_stablehlo.mlir
+14 −1 stablehlo/tests/infer_stablehlo.mlir
+79 −0 stablehlo/tests/interpret/convolution.mlir
+2 −2 stablehlo/tests/interpret/tanh.mlir
+0 −55 stablehlo/tests/ops_chlo.mlir
+0 −18 stablehlo/tests/ops_chlo_roundtrip.mlir
+1,763 −0 stablehlo/tests/ops_speculatability.mlir
+40 −16 stablehlo/tests/ops_stablehlo.mlir
+237 −7 stablehlo/tests/ops_stablehlo_quantized.mlir
+1 −2 stablehlo/tests/print_types_invalid.mlir
+4 −4 stablehlo/tests/shape_legalize_to_stablehlo.mlir
+456 −0 stablehlo/tests/stablehlo_aggressive_simplification.mlir
+2 −2 stablehlo/tests/stablehlo_canonicalize_dynamism.mlir
+1 −1 stablehlo/tests/stablehlo_refine_shapes.mlir
+ stablehlo/tests/vhlo/stablehlo_legalize_to_vhlo.0_10_0.mlir.bc
+ stablehlo/tests/vhlo/stablehlo_legalize_to_vhlo.0_11_0.mlir.bc
+ stablehlo/tests/vhlo/stablehlo_legalize_to_vhlo.0_12_0.mlir.bc
+ stablehlo/tests/vhlo/stablehlo_legalize_to_vhlo.0_13_0.mlir.bc
+ stablehlo/tests/vhlo/stablehlo_legalize_to_vhlo.0_14_0.mlir.bc
+ stablehlo/tests/vhlo/stablehlo_legalize_to_vhlo.0_15_0.mlir.bc
+ stablehlo/tests/vhlo/stablehlo_legalize_to_vhlo.0_16_0.mlir.bc
+ stablehlo/tests/vhlo/stablehlo_legalize_to_vhlo.0_17_0.mlir.bc
+ stablehlo/tests/vhlo/stablehlo_legalize_to_vhlo.0_18_0.mlir.bc
+ stablehlo/tests/vhlo/stablehlo_legalize_to_vhlo.0_19_0.mlir.bc
+ stablehlo/tests/vhlo/stablehlo_legalize_to_vhlo.0_9_0.mlir.bc
+1 −1 stablehlo/tools/StablehloTranslateMain.cpp
+107 −109 stablehlo/transforms/ChloLegalizeToStablehlo.cpp
+25 −27 stablehlo/transforms/ShapeLegalizeToStablehlo.cpp
+123 −9 stablehlo/transforms/StablehloAggressiveSimplification.cpp
+2 −2 stablehlo/transforms/StablehloCanonicalizeDynamism.cpp
+2 −2 stablehlo/transforms/StablehloInstrumentWithProbe.cpp
+40 −47 stablehlo/transforms/StablehloLegalizeToVhlo.cpp
+4 −4 stablehlo/transforms/StablehloRefineArguments.cpp
+8 −8 stablehlo/transforms/StablehloRefineShapes.cpp
+90 −83 stablehlo/transforms/VhloLegalizeToStablehlo.cpp
+12 −12 stablehlo/transforms/VhloToVersion.cpp
2 changes: 1 addition & 1 deletion utils/clone-mlir.sh
Original file line number Diff line number Diff line change
@@ -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 7ac7d418ac2b16fd44789dcf48e2b5d73de3e715 && cd ..
cd llvm-project && git checkout 20ed5b1f45871612570d3bd447121ac43e083c6a && cd ..
Loading