Skip to content
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

[StableHLO] Reshape op failure for unsupported data types #1317

Closed
mmanzoorTT opened this issue Nov 18, 2024 · 0 comments · Fixed by #1319
Closed

[StableHLO] Reshape op failure for unsupported data types #1317

mmanzoorTT opened this issue Nov 18, 2024 · 0 comments · Fixed by #1319
Assignees
Labels
stablehlo conversion bug Bugs in StableHLO conversion

Comments

@mmanzoorTT
Copy link
Contributor

mmanzoorTT commented Nov 18, 2024

StableHLO->TTIR conversion fails for reshape op when it tries to convert unsupported datatypes (e.g. boolean, i64, f64).
Some example stablehlo graph

func.func @main(%arg0: tensor<1x1xi64>) -> tensor<1xi64> {
  %0 = stablehlo.reshape %arg0 : (tensor<1x1xi64>) -> tensor<1xi64>
  return %0 : tensor<1xi64>
}
func.func @main(%arg0:   tensor<1x45xi64>) -> tensor<45xi64> {
  %0 = stablehlo.reshape %arg0 :   (tensor<1x45xi64>) -> tensor<45xi64>
  return %0 :   tensor<45xi64>
}

Error message

error: failed to legalize unresolved materialization from ('tensor<1x1xi32>') to 'tensor<1x1xi64>' that remained live after conversion
  func.func @main(%arg0: tensor<1x1xi64>) -> tensor<1xi64> {
                  ^
tt-mlir/test/ttmlir/Conversion/StableHLOToTTIR/test.mlir:4:19: note: see current operation: %0 = "builtin.unrealized_conversion_cast"(%arg0) : (tensor<1x1xi32>) -> tensor<1x1xi64>
tt-mlir/test/ttmlir/Conversion/StableHLOToTTIR/test.mlir:5:10: note: see existing live user here: %2 = "ttir.reshape"(%0, %1) <{operand_constraints = [#tt.operand_constraint<dram|l1|tile|none|interleaved|single_bank|height_sharded|width_sharded|block_sharded|any_layout|any_device_tile>, #tt.operand_constraint<dram|l1|tile|none|interleaved|single_bank|height_sharded|width_sharded|block_sharded|any_layout|any_device_tile>], shape = [1 : i32]}> : (tensor<1x1xi64>, tensor<1xi32>) -> tensor<1xi32>
    %0 = stablehlo.reshape %arg0 : (tensor<1x1xi64>) -> tensor<1xi64>
         ^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stablehlo conversion bug Bugs in StableHLO conversion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant