Repository navigation
Description
When widening integers on the vulkan backend, it appears to treat them as unsigned. It seems to be dependent on the bit widths:
These tests fail:
func @widen_int_i8_i32() attributes { iree.module.export } {
%input = iree.unfoldable_constant dense<[-42, 0, 42]> : tensor<3xi8>
%res = "xla_hlo.convert"(%input) : (tensor<3xi8>) -> tensor<3xi32>
check.expect_eq_const(%res, dense<[-42, 0, 42]> : tensor<3xi32>) : tensor<3xi32>
return
}
func @widen_int_i16_i32() attributes { iree.module.export } {
%input = iree.unfoldable_constant dense<[-42, 0, 42]> : tensor<3xi16>
%res = "xla_hlo.convert"(%input) : (tensor<3xi16>) -> tensor<3xi32>
check.expect_eq_const(%res, dense<[-42, 0, 42]> : tensor<3xi32>) : tensor<3xi32>
return
}[ RUN ] module.widen_int_i8_i32
iree/modules/check/native_module.cc:277: Failure
Failed
Expected equality of these values. Contents does not match.
lhs:
3xi32=214 0 42
rhs:
3xi32=-42 0 42
[ RUN ] module.widen_int_i16_i32
iree/modules/check/native_module.cc:277: Failure
Failed
Expected equality of these values. Contents does not match.
lhs:
3xi32=65494 0 42
rhs:
3xi32=-42 0 42
but this one succeeds
func @widen_int_i32_i64() attributes { iree.module.export } {
%input = iree.unfoldable_constant dense<[-42, 0, 42]> : tensor<3xi32>
%res = "xla_hlo.convert"(%input) : (tensor<3xi32>) -> tensor<3xi64>
check.expect_eq_const(%res, dense<[-42, 0, 42]> : tensor<3xi64>) : tensor<3xi64>
return
}It seems telling that https://github.com/google/iree/blob/master/iree/test/e2e/regression/load_i16.mlir uses only positive numbers, whereas https://github.com/google/iree/blob/master/iree/test/e2e/regression/store.mlir uses positive and negative, so I expect this is a known issue somehow :-)
Activity
hanhanW commentedon May 11, 2020
Thanks, it looks like a but we hit last week #1851, I'll take a look.
Fold convert tests into single check test file
Fold convert tests into single check test file
Enalbe clamp.mlir and convert.mlir test on vulkan.
Enable clamp.mlir and convert.mlir test on vulkan.
Enable clamp.mlir and convert.mlir test on vulkan.
Enable clamp.mlir and convert.mlir test on vulkan.