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

Add TOSA to TTIR conversion for ConstOp #1513

Open
sdjukicTT opened this issue Dec 5, 2024 · 0 comments
Open

Add TOSA to TTIR conversion for ConstOp #1513

sdjukicTT opened this issue Dec 5, 2024 · 0 comments
Assignees

Comments

@sdjukicTT
Copy link
Contributor

sdjukicTT commented Dec 5, 2024

tosa.const (mlir::tosa::ConstOp)

Can be lowered directly to ttir.const op.

Requires rebuilding of the value attribute in the following cases:

  • Scalar values: TTNN does not support scalar types. So they should be converted to 1-D tensors.
  • Boolean tensor: TTNN does not support boolean data. So they should be converted to bfloat16 tensors.
  • Integer tensor: TTNN does not support 48 bit integer. So they should be converted to 32 bit tensor.
  • Float tensor: TTNN does not support 64 bit float. So they should be converted to 32 bit tensor.

Methods from StableHLOToTTIRConstantOpConversionPattern in lib/Conversion/StableHLOToTTIR/StableHLOToTTIRPatterns.cpp can be reused and should be moved to a file from which they can be used for both TOSA and StableHLO.

@sdjukicTT sdjukicTT self-assigned this Dec 5, 2024
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

No branches or pull requests

1 participant