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] Add conversion for empty op. #2161

Open
mmanzoorTT opened this issue Feb 10, 2025 · 0 comments · May be fixed by #2162
Open

[StableHLO] Add conversion for empty op. #2161

mmanzoorTT opened this issue Feb 10, 2025 · 0 comments · May be fixed by #2162
Assignees

Comments

@mmanzoorTT
Copy link
Contributor

Stablehlo to TTIR conversion uses a custom type convertor for modifying the unsupported data types to supported data types. tensor::emptyop fails due to not applying this custom type convertor if emptyop is created with unsupported data type.

Sample mlir graph

module {
  func.func @main() -> tensor<1xi1> {
    %0 = tensor.empty() : tensor<1xi1>
    return %0 : tensor<1xi1>
  }
}

Stack dump

aten::empty_strided_0.mlir:4:5: error: failed to legalize unresolved materialization from ('tensor<1xi1>') to 'tensor<1xbf16>' that remained live after conversion	"aten::empty_strided_0.mlir:4:5: error: failed to legalize unresolved materialization from ('tensor<1xi1>') to 'tensor<1xbf16>' that remained live after conversion
    return %0 : tensor<1xi1>
    ^
aten::empty_strided_0.mlir:4:5: note: see current operation: %1 = ""builtin.unrealized_conversion_cast""(%0) : (tensor<1xi1>) -> tensor<1xbf16>
aten::empty_strided_0.mlir:4:5: note: see existing live user here: func.return %1 : tensor<1xbf16>
@mmanzoorTT mmanzoorTT added this to the [Third Party] HLO + XLA milestone Feb 10, 2025
@mmanzoorTT mmanzoorTT self-assigned this Feb 10, 2025
@mmanzoorTT mmanzoorTT linked a pull request Feb 10, 2025 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant