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

[TTIR, TTNN] Add validation for unary eltwise ops #1289

Open
sdjordjevicTT opened this issue Nov 15, 2024 · 0 comments
Open

[TTIR, TTNN] Add validation for unary eltwise ops #1289

sdjordjevicTT opened this issue Nov 15, 2024 · 0 comments
Assignees
Labels
MLIR Ops Issues related to MLIR dialect ops and their implementations TTIR Dialect Issues related to TTIR dialect TTNN Dialect Issues related to TTNN dialect

Comments

@sdjordjevicTT
Copy link
Contributor

We don't have any validation for unary ops that they verify single input and single output. For example, today it is allowed to compile the following IR, even though the gelu op is a unary op:

#any_device = #tt.operand_constraint<dram|l1|scalar|tile|any_device|any_device_tile>
module attributes {} {
  func.func @forward(%arg0: tensor<64x128xf32>, %arg1: tensor<64x128xf32>) -> tensor<64x128xf32> {
  %0 = tensor.empty() : tensor<64x128xf32>
    %1 = "ttir.gelu"(%arg0, %arg1, %0) <{operandSegmentSizes = array<i32: 2, 1>, operand_constraints = [#any_device, #any_device, #any_device]}> : (tensor<64x128xf32>, tensor<64x128xf32>, tensor<64x128xf32>) -> tensor<64x128xf32>
    return %1 : tensor<64x128xf32>
  }
}
@sdjordjevicTT sdjordjevicTT added MLIR Ops Issues related to MLIR dialect ops and their implementations TTIR Dialect Issues related to TTIR dialect TTNN Dialect Issues related to TTNN dialect labels Nov 15, 2024
@azecevicTT azecevicTT self-assigned this Nov 18, 2024
azecevicTT added a commit that referenced this issue Nov 25, 2024
- Refactoring of ElementwiseOpInteface to better reflect intention, with
  fix of broadcast shape calculation, considering that operand that
represetnts destination shouldn't affect output shape.
- Check number of operands for AttrSizedOperandSegments ops with simple
  traits.
- Minor refactoring of TTIR_GenericOp.

Addresses #1289, but I would
leave it as open to track further progress with similar traits and
interfaces needed in the TTNN dialect.
azecevicTT added a commit that referenced this issue Nov 26, 2024
- Refactoring of ElementwiseOpInteface to better reflect intention, with
  fix of broadcast shape calculation, considering that operand that
represetnts destination shouldn't affect output shape.
- Check number of operands for AttrSizedOperandSegments ops with simple
  traits.
- Minor refactoring of TTIR_GenericOp.

Addresses #1289, but I would
leave it as open to track further progress with similar traits and
interfaces needed in the TTNN dialect.
azecevicTT added a commit that referenced this issue Nov 26, 2024
- Refactoring of ElementwiseOpInteface to better reflect intention, with
  fix of broadcast shape calculation, considering that operand that
represetnts destination shouldn't affect output shape.
- Check number of operands for AttrSizedOperandSegments ops with simple
  traits.
- Minor refactoring of TTIR_GenericOp.

Addresses #1289, but I would
leave it as open to track further progress with similar traits and
interfaces needed in the TTNN dialect.
azecevicTT added a commit that referenced this issue Nov 26, 2024
- Refactoring of ElementwiseOpInteface to better reflect intention, with
  fix of broadcast shape calculation, considering that operand that
represetnts destination shouldn't affect output shape.
- Check number of operands for AttrSizedOperandSegments ops with simple
  traits.
- Minor refactoring of TTIR_GenericOp.

Addresses #1289, but I would
leave it as open to track further progress with similar traits and
interfaces needed in the TTNN dialect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MLIR Ops Issues related to MLIR dialect ops and their implementations TTIR Dialect Issues related to TTIR dialect TTNN Dialect Issues related to TTNN dialect
Projects
None yet
Development

No branches or pull requests

2 participants