Skip to content

Commit

Permalink
Integrate StableHLO at openxla/stablehlo@d1db6dfe
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 702479909
  • Loading branch information
abhigunj authored and Google-ML-Automation committed Dec 3, 2024
1 parent 2debe51 commit 05f004e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 51 deletions.
49 changes: 0 additions & 49 deletions third_party/stablehlo/temporary.patch
Original file line number Diff line number Diff line change
@@ -1,50 +1 @@
diff --ruN a/stablehlo/docs/interpreter_status.md b/stablehlo/docs/interpreter_status.md
--- stablehlo/docs/interpreter_status.md
+++ stablehlo/docs/interpreter_status.md
@@ -237,15 +237,6 @@
### Convert Not In HLO Ops

```sh
-# broadcast
-mlir-hlo-opt -mhlo-legalize-broadcast-to-broadcast-in-dim <path/to/input>
-
-# create_token
-mlir-hlo-opt -mhlo-legalize-create-token-to-after-all <path/to/input>
-
-# cross-replica-sum
-mlir-hlo-opt -mhlo-legalize-cross-replica-sum-to-all-reduce <path/to/input>
-
# dot
mlir-hlo-opt -mhlo-legalize-dot-to-dot-general <path/to/input>

diff --ruN a/stablehlo/stablehlo/tests/transforms/stablehlo_convert_to_signless.mlir b/stablehlo/stablehlo/tests/transforms/stablehlo_convert_to_signless.mlir
--- stablehlo/stablehlo/tests/transforms/stablehlo_convert_to_signless.mlir
+++ stablehlo/stablehlo/tests/transforms/stablehlo_convert_to_signless.mlir
@@ -7,9 +7,9 @@
%1 = builtin.unrealized_conversion_cast %arg0 : memref<*xui16> to memref<*xi16>
%2 = memref.cast %1 : memref<*xi16> to memref<i16>
%3 = builtin.unrealized_conversion_cast %2 : memref<i16> to memref<ui16>
- %4 = bufferization.to_tensor %3 : memref<ui16>
+ %4 = bufferization.to_tensor %3 : memref<ui16> to tensor<ui16>
%5 = builtin.unrealized_conversion_cast %4 : tensor<ui16> to tensor<i16>
- %6 = bufferization.to_memref %5 : memref<i16>
+ %6 = bufferization.to_memref %5 : tensor<i16> to memref<i16>
%7 = builtin.unrealized_conversion_cast %6 : memref<i16> to memref<ui16>
func.return %7 : memref<ui16>
}
diff --ruN a/stablehlo/stablehlo/transforms/StablehloAggressiveFolder.cpp b/stablehlo/stablehlo/transforms/StablehloAggressiveFolder.cpp
--- stablehlo/stablehlo/transforms/StablehloAggressiveFolder.cpp
+++ stablehlo/stablehlo/transforms/StablehloAggressiveFolder.cpp
@@ -79,8 +79,9 @@
} else {
llvm::report_fatal_error("expected integer type");
}
- return APSInt({/*numBits=*/numBits, value},
- /*isUnsigned=*/isUnsigned);
+ return APSInt(
+ {/*numBits=*/numBits, value, /*isSigned=*/false, /*implicitTrunc=*/true},
+ /*isUnsigned=*/isUnsigned);
}

LogicalResult validateResultTypeForEval(PatternRewriter& rewriter,

4 changes: 2 additions & 2 deletions third_party/stablehlo/workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")

def repo():
# LINT.IfChange
STABLEHLO_COMMIT = "f21104d05371210da8e849901f75e07d3c1ff0d2"
STABLEHLO_SHA256 = "2cf6a75a156beaedd9155a909029de597966897a76a9fc791c849b48330f7466"
STABLEHLO_COMMIT = "d1db6dfe13488b4735a6f08c324145625447fb6d"
STABLEHLO_SHA256 = "c20d305f0c1a9898dec1486ceac40224b6461cb1cc3540891e6425a6627ba40f"
# LINT.ThenChange(Google-internal path)

tf_http_archive(
Expand Down

0 comments on commit 05f004e

Please sign in to comment.