Skip to content

Commit

Permalink
[StableHLO][NFC] Add exponential fp16 e2e tests (iree-org#13789)
Browse files Browse the repository at this point in the history
The list of excludes is the same as for the MHLO equivalent. I also
checked and the generated code is identical.

Issue: iree-org#12678
  • Loading branch information
kuhar authored and nhasabni committed Aug 24, 2023
1 parent f1e6052 commit c551d97
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/e2e/stablehlo_ops/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ iree_check_single_backend_test_suite(
"dynamic_slice.mlir",
"dynamic_update_slice.mlir",
"exponential.mlir",
"exponential_fp16.mlir",
"exponential_minus_one.mlir",
"fft.mlir",
"finite.mlir",
Expand Down Expand Up @@ -152,7 +153,9 @@ iree_check_single_backend_test_suite(
"while.mlir",
],
include = ["*.mlir"],
exclude = [],
exclude = [
"exponential_fp16.mlir",
],
),
compiler_flags = ["--iree-input-type=stablehlo"],
driver = "local-task",
Expand Down Expand Up @@ -221,6 +224,7 @@ iree_check_single_backend_test_suite(
],
include = ["*.mlir"],
exclude = [
"exponential_fp16.mlir",
"fft.mlir", # TODO(#9583)
"reverse.mlir", # TODO(#12415): disabled due to miscompilation on Pixel 6.
],
Expand Down Expand Up @@ -257,6 +261,7 @@ iree_check_single_backend_test_suite(
"dynamic_slice.mlir",
"dynamic_update_slice.mlir",
"exponential.mlir",
"exponential_fp16.mlir",
"exponential_minus_one.mlir",
"fft.mlir",
"finite.mlir",
Expand Down Expand Up @@ -346,6 +351,7 @@ iree_check_single_backend_test_suite(
"dynamic_slice.mlir",
"dynamic_update_slice.mlir",
"exponential.mlir",
"exponential_fp16.mlir",
"exponential_minus_one.mlir",
"fft.mlir",
"finite.mlir",
Expand Down Expand Up @@ -426,6 +432,7 @@ iree_check_single_backend_test_suite(
"dynamic_slice.mlir",
"dynamic_update_slice.mlir",
"exponential.mlir",
"exponential_fp16.mlir",
"exponential_minus_one.mlir",
"fft.mlir",
"finite.mlir",
Expand Down
4 changes: 4 additions & 0 deletions tests/e2e/stablehlo_ops/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ iree_check_single_backend_test_suite(
"dynamic_slice.mlir"
"dynamic_update_slice.mlir"
"exponential.mlir"
"exponential_fp16.mlir"
"exponential_minus_one.mlir"
"fft.mlir"
"finite.mlir"
Expand Down Expand Up @@ -236,6 +237,7 @@ iree_check_single_backend_test_suite(
"dynamic_slice.mlir"
"dynamic_update_slice.mlir"
"exponential.mlir"
"exponential_fp16.mlir"
"exponential_minus_one.mlir"
"fft.mlir"
"finite.mlir"
Expand Down Expand Up @@ -308,6 +310,7 @@ iree_check_single_backend_test_suite(
"dynamic_slice.mlir"
"dynamic_update_slice.mlir"
"exponential.mlir"
"exponential_fp16.mlir"
"exponential_minus_one.mlir"
"fft.mlir"
"finite.mlir"
Expand Down Expand Up @@ -384,6 +387,7 @@ iree_check_single_backend_test_suite(
"dynamic_slice.mlir"
"dynamic_update_slice.mlir"
"exponential.mlir"
"exponential_fp16.mlir"
"exponential_minus_one.mlir"
"fft.mlir"
"finite.mlir"
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/stablehlo_ops/exponential_fp16.mlir
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
func.func @tensor_fp16() {
%input = util.unfoldable_constant dense<[0.0, 1.0, 2.0, 4.0]> : tensor<4xf16>
%result = stablehlo.exponential %input : (tensor<4xf16>) -> tensor<4xf16>
check.expect_almost_eq_const(%result, dense<[1.0, 2.7183, 7.3891, 54.5981]> : tensor<4xf16>) : tensor<4xf16>
return
}

0 comments on commit c551d97

Please sign in to comment.